/* FlashLoop project page, adapted to the visual structure of AlphaQ/docs. */
:root {
  --color-primary: #1a1a2e;
  --color-secondary: #16213e;
  --color-accent: #0f3460;
  --color-highlight: #e94560;
  --color-bg: #fafafa;
  --color-card: #fff;
  --color-muted: #667085;
  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--color-primary); font-family: var(--font-sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--color-highlight); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--color-accent); }
button { font: inherit; }
sup { color: var(--color-highlight); font-size: .65em; font-weight: 600; line-height: 0; vertical-align: super; }
::selection { background: rgba(233,69,96,.2); color: var(--color-primary); }
:focus-visible { outline: 2px solid var(--color-highlight); outline-offset: 3px; }

.shell { width: min(1152px, calc(100% - 36px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 100; left: 10px; top: -60px; padding: 10px 14px; border-radius: 5px; background: var(--color-primary); color: #fff; }
.skip-link:focus { top: 8px; }
.site-header { position: sticky; z-index: 50; top: 0; background: rgba(255,255,255,.95); border-bottom: 1px solid #e5e7eb; backdrop-filter: blur(9px); }
.nav { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { flex: 0 0 auto; color: var(--color-primary); font-size: 1.125rem; font-weight: 600; }
.brand:hover { color: var(--color-primary); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a, .nav-github { color: #666; font-size: .875rem; }
.nav-links a:hover, .nav-github:hover { color: var(--color-highlight); }
.nav-github { flex: 0 0 auto; }

.hero { padding-block: 72px 54px; text-align: center; }
.hero h1 { max-width: 1040px; margin: 0 auto 22px; font-size: clamp(2.2rem, 3.9vw, 3.125rem); line-height: 1.17; letter-spacing: -.037em; font-weight: 700; }
.hero-subtitle { max-width: 770px; margin: 0 auto 30px; color: #5e6676; font-size: 1.2rem; line-height: 1.55; }
.highlight, em { color: var(--color-highlight); font-style: normal; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 28px; color: #303644; font-size: 1rem; font-weight: 700; }
.affiliations { max-width: 800px; margin: 13px auto 0; color: #687281; font-size: .86rem; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 6px; font-size: .93rem; font-weight: 500; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--color-primary); color: #fff; }
.button-primary:hover { background: var(--color-highlight); color: #fff; }
.button:disabled, .button:disabled:hover { background: #7c8492; color: #fff; cursor: not-allowed; transform: none; }
.button-outline { border: 1px solid #ddd; background: #fff; color: var(--color-primary); }
.button-outline:hover { border-color: var(--color-highlight); color: var(--color-highlight); }

.section { padding-block: 80px; scroll-margin-top: 68px; }
.section-tinted { background: #f9fafb; }
.section-heading { max-width: 850px; margin: 0 0 32px; }
.section-heading.centered { margin-inline: auto; text-align: center; }
.eyebrow { display: block; margin: 0 0 7px; color: var(--color-highlight); font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.section-heading h2 { margin: 0; font-size: clamp(1.75rem, 2.5vw, 2rem); line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
.section-heading.centered h2::after { content: ""; display: block; width: 64px; height: 4px; margin: 15px auto 0; border-radius: 2px; background: var(--color-highlight); }
.section-heading p:last-child { margin: 18px 0 0; color: #667085; font-size: 1rem; line-height: 1.7; }

.figure, .contribution, .citation, .takeaways p { border-radius: 12px; background: var(--color-card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.figure { max-width: 1060px; margin: 0 auto; padding: 18px; }
.figure img { width: 100%; height: auto; object-fit: contain; border-radius: 5px; }
.figure figcaption { margin-top: 10px; color: #666; font-size: .875rem; text-align: center; line-height: 1.6; }
.figure figcaption strong { color: var(--color-primary); }
.demo-card { max-width: 1000px; margin-bottom: 24px; }
.demo-card img { width: 100%; height: auto; border-radius: 6px; background: #121b2a; }
.demo-card figcaption { max-width: 880px; margin: 12px auto 2px; }
.quickstart { max-width: 1000px; margin: 0 auto 75px; padding: 28px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.quickstart-heading { margin-bottom: 20px; }
.quickstart-heading .eyebrow { margin-bottom: 3px; }
.quickstart-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 1.9rem); line-height: 1.25; letter-spacing: -.02em; }
.code-panel { overflow: hidden; border-radius: 8px; background: #16213e; color: #eef2f8; }
.code-panel + .code-panel { margin-top: 14px; }
.code-panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 7px 14px; border-bottom: 1px solid rgba(255,255,255,.12); color: #b9c4d8; font-size: .77rem; font-weight: 600; letter-spacing: .03em; }
.code-copy { padding: 3px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: transparent; color: #eef2f8; cursor: pointer; font-size: .75rem; letter-spacing: 0; }
.code-copy:hover { background: rgba(255,255,255,.1); }
.code-panel pre { margin: 0; overflow-x: auto; padding: 16px 18px; font: .82rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.overview-heading { margin-bottom: 40px; }
.contribution-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.contribution { padding: 30px 32px; transition: box-shadow .2s ease, transform .2s ease; }
.contribution:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-2px); }
.contribution-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 17px; border-radius: 8px; font-size: 1.5rem; line-height: 1; }
.contribution-icon.blue { background: #eff6ff; color: #0f3460; }
.contribution-icon.green { background: #f0fdf4; color: #16a34a; }
.contribution-icon.red { background: #fef2f2; color: var(--color-highlight); }
.contribution h3 { margin: 0 0 8px; font-size: 1.17rem; line-height: 1.32; }
.contribution p { margin: 0; color: #667085; font-size: .9rem; }
.overview-figure-heading { margin-top: 75px; }

#motivation .section-heading, #motivation .insight-grid { max-width: 900px; margin-inline: auto; }
#motivation .section-heading { margin-bottom: 25px; }
#motivation .figure { margin-top: 34px; }
#motivation .motivation-extra-figure { margin-top: 24px; }
.insight-grid { display: grid; gap: 17px; }
.insight { position: relative; padding: 0 0 0 35px; }
.insight::before { content: ""; position: absolute; top: 6px; left: 0; width: 23px; height: 23px; border-radius: 5px; background: #fdecef; }
.insight::after { content: "✓"; position: absolute; top: 5px; left: 5px; color: var(--color-highlight); font-size: .85rem; font-weight: 700; }
.insight-num { color: var(--color-highlight); font-size: .7rem; font-weight: 600; letter-spacing: .05em; }
.insight h3 { margin: 1px 0; font-size: 1rem; font-weight: 600; }
.insight p { margin: 0; color: #667085; font-size: .9rem; }

.insight-box { max-width: 1000px; margin: 0 auto 36px; padding: 23px 28px; border-left: 4px solid var(--color-highlight); border-radius: 0 8px 8px 0; background: #f0f1f3; }
.insight-box h3 { margin: 0 0 8px; color: var(--color-highlight); font-size: 1.1rem; }
.insight-box p { margin: 0; color: #3f4652; font-size: 1.05rem; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.method-card { padding: 26px; border-left: 3px solid var(--color-accent); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.method-step { color: var(--color-accent); font-size: .75rem; font-weight: 700; letter-spacing: .07em; }
.method-card h3 { margin: 7px 0 8px; font-size: 1.07rem; }
.method-card p { margin: 0; color: #667085; font-size: .89rem; }
.method-footnote { max-width: 850px; margin: 28px auto 0; color: #667085; font-size: .88rem; text-align: center; }

.result-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 30px; }
.result-badges > div { display: inline-flex; align-items: baseline; gap: 12px; padding: 13px 21px; border-radius: 8px; background: linear-gradient(135deg, var(--color-highlight), #fb667c); color: #fff; box-shadow: 0 4px 12px rgba(233,69,96,.2); }
.result-badges strong { font-size: 1.25rem; }
.result-badges span { font-size: .83rem; }
.table-wrap { max-width: 1100px; margin: 0 auto; overflow-x: auto; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 15px 16px; border-bottom: 1px solid #edf0f2; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead { background: #f4f5f7; }
thead th { color: #474d5b; font-size: .81rem; }
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
.positive { color: #168056; font-weight: 600; }
.table-note { max-width: 1100px; margin: 11px auto 0; color: #7b8492; font-size: .78rem; }
.result-gallery { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 37px; }
.result-gallery .figure { width: 100%; }
.figure-gallery-wide { grid-column: 1 / -1; }

.summary-shell { max-width: 900px; }
.takeaways { display: grid; gap: 16px; margin-bottom: 48px; }
.takeaways p { position: relative; margin: 0; padding: 20px 23px 20px 67px; color: #485162; }
.takeaways p::before { content: "✓"; position: absolute; left: 23px; top: 19px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #eff6ff; color: #2563eb; font-weight: 700; }
.takeaways p:nth-child(2)::before { background: #f5f3ff; color: #7c3aed; }
.takeaways p:nth-child(3)::before { background: #f0fdf4; color: #16a34a; }
.takeaways strong { color: var(--color-primary); }
.citation { padding: 25px; }
.citation-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.citation-header h3 { margin: 0 0 4px; font-size: 1.12rem; }
.citation-header p { margin: 0; color: #667085; font-size: .85rem; }
.copy-button { flex: 0 0 auto; padding: 6px 12px; border: 0; border-radius: 4px; background: #f0f0f0; cursor: pointer; font-size: .85rem; }
.copy-button:hover { background: #e0e0e0; }
.bibtex { overflow-x: auto; border-radius: 6px; background: #f3f4f6; }
.bibtex pre { margin: 0; padding: 18px; color: #4b5563; font: .85rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.site-footer { background: var(--color-primary); }
.site-footer .shell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; padding-block: 34px; color: #9ca3af; font-size: .85rem; }
.site-footer span:first-child { color: #fff; font-size: 1.05rem; font-weight: 600; }
.site-footer a { color: #9ca3af; }
.site-footer a:hover { color: #fff; }

@media (max-width: 800px) {
  .nav-links { display: none; }
  .hero { padding-block: 62px 45px; }
  .hero h1 { font-size: clamp(2rem, 5.7vw, 2.6rem); }
  .section { padding-block: 64px; }
  .contribution-grid, .method-grid { grid-template-columns: 1fr; gap: 15px; }
  .quickstart { margin-bottom: 60px; }
  .overview-figure-heading { margin-top: 60px; }
  .result-gallery { grid-template-columns: 1fr; }
  .figure-gallery-wide { grid-column: auto; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1152px); }
  .hero { padding-block: 45px 35px; }
  .hero h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 1.02rem; margin-bottom: 22px; }
  .authors { font-size: .95rem; }
  .affiliations { font-size: .78rem; }
  .hero-actions { margin-top: 22px; }
  .button { min-height: 40px; padding: 8px 15px; font-size: .85rem; }
  .section { padding-block: 52px; }
  .section-heading h2 { font-size: 1.75rem; }
  .figure { padding: 10px; }
  .figure figcaption { font-size: .8rem; }
  .quickstart { margin-bottom: 50px; padding: 18px; }
  .code-panel pre { padding: 13px 14px; font-size: .76rem; }
  .contribution { padding: 25px; }
  .result-badges > div { width: 100%; justify-content: center; }
  .citation { padding: 18px; }
  .citation-header { flex-direction: column; }
  .bibtex pre { font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
