@import url("https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --bg0: #0c0b14;
  --bg1: #15122a;
  --ink: #f3f0ff;
  --muted: #a8a0c4;
  --line: rgba(243, 240, 255, 0.14);
  --accent: #8B7CFF;
  --accent-ink: #120f24;
  --panel: rgba(28, 24, 52, 0.78);
  --warn: #ffb454;
  --ok: #7dffb2;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  --frame: #8B7CFF;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 124, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(139, 124, 255, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a0918);
  line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #c4b8ff; }
.wrap { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 16, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: var(--ink);
  font-family: Syne, sans-serif; font-weight: 800; letter-spacing: -0.03em;
}
.brand-mark {
  width: 2rem; height: 2rem; border-radius: 0.35rem;
  display: grid; place-items: center;
  background: transparent; color: var(--accent);
  font-size: 0.9rem; font-weight: 800;
  border: 1px solid var(--frame);
  box-shadow:
    inset 0 0 0 1px rgba(139, 124, 255, 0.25),
    3px 3px 0 rgba(139, 124, 255, 0.35);
  position: relative;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-color: var(--frame);
  border-style: solid;
}
.brand-mark::before {
  top: -3px; left: -3px;
  border-width: 1px 0 0 1px;
}
.brand-mark::after {
  bottom: -3px; right: -3px;
  border-width: 0 1px 1px 0;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 600;
  font-size: 0.9rem; padding: 0.45rem 0.7rem; border-radius: 999px;
}
.nav a:hover, .nav a.active { color: var(--ink); background: rgba(255,255,255,0.06); }

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-content: center;
  padding: 3.5rem 0 2.5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto auto;
  width: min(70vw, 560px); height: min(70vw, 560px);
  background:
    conic-gradient(from 210deg, rgba(139,124,255,0.32), transparent 40%, rgba(139,124,255,0.18), transparent 75%),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.08), transparent 60%);
  filter: blur(2px);
  pointer-events: none;
}
.hero > * { position: relative; }
.brand-hero {
  font-family: Syne, sans-serif; font-weight: 800; font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  letter-spacing: -0.03em; color: var(--accent); margin: 0 0 0.75rem;
}
h1, h2, h3 { font-family: Syne, sans-serif; letter-spacing: -0.035em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 0.85rem; max-width: 14ch; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.lede {
  margin: 0 0 1.4rem; color: var(--muted); font-size: 1.12rem; max-width: 36rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.15rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #a99cff; color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: rgba(139,124,255,0.5); color: var(--accent); }

.section { padding: 2.75rem 0; border-top: 1px solid var(--line); }
.section .sub {
  color: var(--muted); margin: 0 0 1.25rem; max-width: 40rem;
}
.compare {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 1rem;
  overflow: hidden; box-shadow: var(--shadow);
}
.compare th, .compare td {
  padding: 0.85rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare th {
  background: rgba(139, 124, 255, 0.1); font-family: Syne, sans-serif;
  font-size: 0.82rem; letter-spacing: 0.02em; text-transform: uppercase;
}
.compare tr:last-child td { border-bottom: 0; }
.compare .pick { color: var(--ok); font-weight: 700; }

.list-links {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.list-links a {
  display: block; text-decoration: none; color: var(--ink);
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 0.9rem;
  background: rgba(255,255,255,0.03);
}
.list-links a:hover { border-color: rgba(200,245,66,0.4); }
.list-links strong { display: block; font-family: Syne, sans-serif; margin-bottom: 0.25rem; }
.list-links span { color: var(--muted); font-size: 0.92rem; }

.prose p { color: var(--muted); margin: 0 0 1rem; max-width: 46rem; }
.prose ul { color: var(--muted); padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }
.faq details {
  border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.85rem 1rem;
  margin: 0.6rem 0; background: rgba(255,255,255,0.03);
}
.faq summary { cursor: pointer; font-weight: 700; font-family: Syne, sans-serif; }
.faq p { color: var(--muted); margin: 0.6rem 0 0; }

.tool-panel {
  border: 1px solid var(--line); border-radius: 1rem; padding: 1.1rem;
  background: var(--panel); box-shadow: var(--shadow); max-width: 40rem;
}
.tool-panel label { display: block; font-weight: 700; margin: 0.7rem 0 0.35rem; }
.tool-panel select, .tool-panel textarea, .tool-panel input {
  width: 100%; border-radius: 0.7rem; border: 1px solid var(--line);
  background: rgba(0,0,0,0.28); color: var(--ink); padding: 0.7rem 0.8rem;
  font: inherit;
}
.tool-panel textarea { min-height: 7rem; resize: vertical; }
.tool-panel img { display: block; width: min(100%, 512px); height: auto; margin-top: 0.85rem; border-radius: 0.7rem; }
.tool-out {
  margin-top: 0.85rem; white-space: pre-wrap; color: var(--ink);
  background: rgba(0,0,0,0.35); border-radius: 0.7rem; padding: 0.85rem;
  border: 1px dashed rgba(200,245,66,0.35); min-height: 5rem;
}

.site-footer {
  border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .footer-inner { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: space-between; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .wrap { width: min(1080px, calc(100% - 1.25rem)); }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    min-height: 56px;
    padding: 0.35rem 0;
    gap: 0.5rem;
  }

  .brand { font-size: 0.95rem; }

  .brand {
    min-width: 0;
    max-width: min(100%, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand .brand-mark { flex-shrink: 0; }
  .nav {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.25rem;
    padding-bottom: 0.15rem;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0 1.5rem;
  }

  h1 { max-width: none; font-size: clamp(1.85rem, 8vw, 2.5rem); }
  .lede { font-size: 1rem; }
  .section { padding: 2rem 0; }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  .compare {
    display: table;
    width: max-content;
    min-width: 100%;
    font-size: 0.88rem;
  }

  .compare th,
  .compare td {
    padding: 0.65rem 0.55rem;
    min-width: 6.5rem;
    white-space: nowrap;
  }

  .list-links { grid-template-columns: 1fr; }

  .btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  .tool-panel select,
  .tool-panel textarea,
  .tool-panel input {
    min-height: 44px;
    font-size: 16px;
  }

  .site-footer {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile: keep sticky page-actions from covering primary UI */
@media (max-width: 767px) {
  body.has-page-actions .hero,
  body.has-page-actions .board-shell,
  body.has-page-actions .studio,
  body.has-page-actions #compare,
  body.has-page-actions .calc-section,
  body.has-page-actions main.wrap {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  body.has-page-actions.is-field-focus #page-actions { display: none !important; }
}


/* Gallery frame polish — corner B + 1px card edge */
.card, .panel, .compare, .tool-card, .list-links a, .feature-card {
  border: 1px solid var(--line) !important;
  position: relative;
}
.card.corner-frame,
.panel.corner-frame,
.compare,
.hero-card,
.tool-shell,
.list-links a {
  box-shadow: var(--shadow);
}
.compare,
.list-links a,
.card,
.panel {
  background-image:
    linear-gradient(var(--frame), var(--frame)),
    linear-gradient(var(--frame), var(--frame)),
    linear-gradient(var(--frame), var(--frame)),
    linear-gradient(var(--frame), var(--frame));
  background-repeat: no-repeat;
  background-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px;
  background-position: left top, left top, right bottom, right bottom;
}


/* --- tool-first deepen 2026-11-04 --- */
.hero.hero-tool {
  min-height: auto;
  padding: 1.35rem 0 1.1rem;
  align-content: start;
}
.hero.hero-tool h1 {
  max-width: 18ch;
  font-size: clamp(1.85rem, 4.6vw, 2.85rem);
  margin-bottom: 0.55rem;
}
.hero.hero-tool .lede {
  margin-bottom: 0.95rem;
  font-size: 1.05rem;
}
.tool-panel.tool-atf {
  max-width: 100%;
  margin-top: 0.25rem;
}
.tool-panel.tool-atf textarea {
  min-height: 4.6rem;
}
.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem 1rem;
  align-items: end;
  margin-top: 0.35rem;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: 0.15rem;
}
.gen-remaining {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.gen-status {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.2em;
}
.gen-status.is-error { color: var(--warn); }
.gen-nudge {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 180, 84, 0.35);
  border-radius: 0.85rem;
  background: rgba(255, 180, 84, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.gen-nudge p { margin: 0; color: var(--ink); max-width: 46rem; font-size: 0.95rem; }
.steps { color: var(--muted); padding-left: 1.2rem; max-width: 46rem; }
.steps li { margin: 0.45rem 0; }
.sample-figure, .result-figure {
  margin: 1rem 0 0;
  padding: 0;
  max-width: 36rem;
}
.sample-figure img, .result-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}
.result-prompt {
  white-space: pre-wrap;
  color: var(--ink);
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.75rem 0.85rem;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.legal-topbar {
  padding: 0.55rem 0;
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}
.legal-topbar a { color: var(--accent); text-decoration: none; margin: 0 0.1rem; }
.legal-topbar a:hover { text-decoration: underline; }
.editorial-note {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: rgba(139, 124, 255, 0.08);
  border-radius: 0.35rem;
}
.options-block { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.options-block h2 { font-size: 1.1rem; }
@media (max-width: 720px) {
  .tool-row { grid-template-columns: 1fr; }
  .tool-actions { width: 100%; }
  .tool-actions .btn { flex: 1 1 auto; }
  .hero.hero-tool { padding-top: 1.1rem; }
}
