/* ════════════════════════════════════════════════════════════════════════════
   AyaScope site — styled after the software itself.
   Palette and shapes come straight from the app (SAEDDialog / main window):
   graphite panels #14161c/#1b1e26/#20242e, hairlines #2b3140, teal accent
   #2fb5a8, blue #5b8cff, green #3ecf7a, orange #F59E42. Dark is the default
   (the app is dark); light is the same identity on paper. Sections are
   BORDERED PANELS with small teal labels — exactly like the app's group
   boxes ("SAED Image", "Radial Intensity Profile").
   ════════════════════════════════════════════════════════════════════════════ */

:root, html[data-theme="dark"] {
  --bg:      #14161c;   /* app window background */
  --panel:   #1b1e26;   /* app panels */
  --card:    #20242e;   /* raised controls */
  --line:    #2b3140;   /* borders / separators */
  --ink:     #e8ecf3;   /* primary text */
  --muted:   #8b93a3;   /* secondary text */
  --faint:   #6a7280;   /* tertiary */
  --accent:  #2fb5a8;   /* AyaScope teal */
  --accent-ink: #062a27;/* text on teal */
  --blue:    #5b8cff;
  --green:   #3ecf7a;
  --orange:  #F59E42;
  --red:     #E5484D;
  --shadow:  0 14px 34px rgba(0,0,0,.45);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg:      #f2f4f8;
  --panel:   #ffffff;
  --card:    #eef1f6;
  --line:    #d7dce5;
  --ink:     #1a1e26;
  --muted:   #5c6470;
  --faint:   #8b93a3;
  --accent:  #189a8e;
  --accent-ink: #ffffff;
  --blue:    #3f6fe0;
  --green:   #1f9e57;
  --orange:  #d97c1a;
  --red:     #c73a3f;
  --shadow:  0 14px 30px rgba(23,32,48,.12);
  color-scheme: light;
}

/* ── reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ── typography ───────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
.display    { font-size: clamp(38px, 5.6vw, 64px); line-height: 1.08; }
.heading-lg { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; }
.heading-sm { font-size: 22px; line-height: 1.25; }
.display .hl, .heading-lg .hl { color: var(--accent); }
.muted { color: var(--muted); }
.caption { font-size: 14px; line-height: 1.5; }
.tag { font-size: 13.5px; color: var(--faint); letter-spacing: .02em; }

/* app-style section label:  ⊙ DIFFRACTION  */
.sec-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.sec-label::before { content: ""; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); }

/* ── buttons (app style: 10px radius, teal fill) ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; padding: 12px 22px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: filter .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); color: inherit; }
.btn-fill  { background: var(--accent); color: var(--accent-ink); }
.btn-fill:hover { color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: default; }
.link-arrow { color: var(--accent); font-weight: 600; font-size: 15px; }
.link-arrow::after { content: " →"; }

/* ── header (app title-bar feel) ─────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 0;
}
.header-bar { background: var(--panel); border-bottom: 1px solid var(--line); }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.logo::before { content: "⊙"; color: var(--accent); font-size: 22px; }
.logo span { color: var(--faint); font-weight: 400; font-size: 14px; }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { font-size: 14.5px; color: var(--muted); }
.site-nav a:hover { color: var(--accent); }
.header-cta { display: flex; gap: 10px; align-items: center; }

.theme-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
html[data-theme="light"] .theme-toggle .ico-sun { display: none; }
html:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }

.nav-burger { display: none; }
@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column; position: absolute; top: 70px; left: 16px; right: 16px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px; box-shadow: var(--shadow); z-index: 50;
  }
  .nav-burger {
    display: inline-flex; border: 1px solid var(--line); background: var(--card);
    color: var(--ink); border-radius: 10px; width: 38px; height: 38px;
    align-items: center; justify-content: center; cursor: pointer; font-size: 17px;
  }
  .header-cta .btn-fill { display: none; }
}

/* ── sections: bordered app panels, clearly separated ────────────────────── */
.section { padding: 56px 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 36px;
}
.panel + .panel { margin-top: 28px; }
@media (max-width: 700px) { .panel { padding: 22px 18px; } }

/* ── hero ─────────────────────────────────────────────────────────────────── */
.hero { padding: 64px 0 40px; text-align: center; }
.hero .sub { max-width: 540px; margin: 18px auto 26px; color: var(--muted); font-size: 16.5px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 13.5px; color: var(--faint); }
.hero-shot { max-width: 1060px; margin: 44px auto 0; }

/* product screenshots in app-window chrome */
.shot {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #14161c;
}
.shot img { display: block; width: 100%; height: auto; }
.shot-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  background: #1b1e26; border-bottom: 1px solid #2b3140;
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #343a47; }
.shot-bar span { margin-left: 10px; font-size: 12.5px; color: #8b93a3; }

/* format strip */
.strip { border-block: 1px solid var(--line); background: var(--panel); padding: 18px 0; }

/* feature showcase: screenshot + short copy inside a panel */
.feature {
  display: grid; grid-template-columns: 7fr 4fr; gap: 40px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px;
}
.feature.flip { grid-template-columns: 4fr 7fr; }
.feature.flip .f-copy { order: -1; }
.feature + .feature { margin-top: 28px; }
.f-copy h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 12px; }
.f-copy .facts { list-style: none; padding: 0; margin: 0; }
.f-copy .facts li { font-size: 15px; color: var(--muted); padding: 6px 0 6px 24px; position: relative; }
.f-copy .facts li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 960px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .feature.flip .f-copy { order: 0; }
}

/* ── cards / pricing ─────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 22px;
}
.card h3 { font-size: 19px; margin: 6px 0 8px; }
.card p { font-size: 15px; color: var(--muted); margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.price-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.price-strip .card.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lic-price { font-size: 30px; font-weight: 700; margin: 8px 0 2px; }
.lic-price small { font-size: 14px; color: var(--faint); font-weight: 400; }
.lic-term { font-size: 13.5px; color: var(--faint); }
.fine-list { list-style: none; margin: 14px 0 0; padding: 0; }
.fine-list li { font-size: 14px; color: var(--muted); padding: 4px 0 4px 22px; position: relative; }
.fine-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); }
@media (max-width: 880px) { .price-strip { grid-template-columns: 1fr; } }

/* teal accent panel (universities / CTA) */
.panel-accent {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 16px; padding: 32px 36px;
}
.panel-accent h3 { color: var(--ink); margin: 0 0 8px; font-size: 21px; }
.panel-accent p { color: var(--muted); margin: 0; font-size: 15.5px; }

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.faq { max-width: 780px; margin: 0 auto; }
.faq details {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 2px 20px; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; font-size: 15.5px; font-weight: 600; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 0 16px; color: var(--muted); font-size: 15px; }

/* ── forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 130px; }
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.form-note { font-size: 13px; color: var(--faint); margin-top: 12px; }
.msg { border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 14px 0; display: none; }
.msg.show { display: block; }
.msg-ok  { background: color-mix(in srgb, var(--green) 15%, var(--panel)); color: var(--green); }
.msg-err { background: color-mix(in srgb, var(--red) 15%, var(--panel)); color: var(--red); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.keybox {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; word-break: break-all; user-select: all; color: var(--ink);
}

/* ── footer ──────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--panel);
  padding: 44px 0 56px; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 12.5px; color: var(--faint); font-weight: 600; margin: 0 0 12px;
  text-transform: uppercase; letter-spacing: .1em; }
.site-footer a { display: block; font-size: 14px; color: var(--muted); padding: 4px 0; }
.site-footer .fine { font-size: 12.5px; color: var(--faint); margin-top: 28px; line-height: 1.6; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ── admin ───────────────────────────────────────────────────────────────── */
.admin-shell { max-width: 1100px; margin: 32px auto; padding: 0 24px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0; }
.admin-tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.admin-tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.panel-view { display: none; }
.panel-view.active { display: block; }
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--panel); }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { background: var(--card); font-weight: 600; white-space: nowrap; color: var(--muted); }
.data-table td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; background: var(--card); color: var(--muted); }
.pill-ok  { background: color-mix(in srgb, var(--green) 18%, var(--panel)); color: var(--green); }
.pill-err { background: color-mix(in srgb, var(--red) 18%, var(--panel)); color: var(--red); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .n { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat .l { font-size: 12.5px; color: var(--faint); }
@media (max-width: 860px) { .stat-row { grid-template-columns: 1fr 1fr; } }

/* legal pages */
.legal { max-width: 780px; margin: 0 auto; }
.legal h2 { font-size: 20px; font-weight: 600; margin: 32px 0 10px; }
.legal p, .legal li { font-size: 15px; color: var(--muted); line-height: 1.65; }
.legal strong { color: var(--ink); }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; color: var(--muted); }
.legal th { color: var(--ink); font-weight: 600; }

/* utility */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

/* ── theme-paired screenshots ────────────────────────────────────────────── */
html[data-theme="light"] .only-dark { display: none; }
html:not([data-theme="light"]) .only-light { display: none; }

/* ── the analysis journey: sticky menu rail + animated sections ──────────── */
.journey { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.rail {
  position: sticky; top: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
}
.rail .rail-title { font-size: 11.5px; color: var(--faint); text-transform: uppercase;
  letter-spacing: .12em; padding: 4px 12px 10px; }
.rail a {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted); padding: 9px 12px; border-radius: 9px;
  border-left: 2px solid transparent;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.rail a .ri { width: 18px; text-align: center; color: var(--faint); transition: color .25s ease; }
.rail a:hover { color: var(--ink); background: var(--card); }
.rail a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border-left-color: var(--accent); font-weight: 600; }
.rail a.active .ri { color: var(--accent); }
.rail a.clicked { animation: railClick .45s ease; }
@keyframes railClick {
  0% { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); }
  100% { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
}
@media (max-width: 1000px) { .journey { grid-template-columns: 1fr; } .rail { display: none; } }

/* window-open + reveal animations */
[data-animate] { opacity: 0; transform: translateY(26px); }
[data-animate].in { opacity: 1; transform: none;
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
[data-animate="window"] { transform: translateY(30px) scale(.97); transform-origin: 50% 70%; }
[data-animate="window"].in { transform: none; }
.d1.in { transition-delay: .08s; } .d2.in { transition-delay: .16s; } .d3.in { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .rail a.clicked { animation: none; }
}

/* two-up secondary windows inside a section */
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 880px) { .twoup { grid-template-columns: 1fr; } }

/* conclusion (report) section emphasis */
.conclusion { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.conclusion .sec-label::before { border-radius: 50%; }

/* ── floating parallel-sales pill ────────────────────────────────────────── */
.buy-pill {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 12px;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.buy-pill.show { opacity: 1; transform: none; pointer-events: auto; }
.buy-pill .free { font-size: 13px; color: var(--muted); }
.buy-pill .free b { color: var(--green); }
.buy-pill .sep { width: 1px; height: 22px; background: var(--line); }
@media (max-width: 700px) { .buy-pill { right: 12px; bottom: 12px; } .buy-pill .free span { display: none; } }
