/* Landing page. */

.nowrap { white-space: nowrap; }
.section-head { display: grid; gap: 10px; max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); }

/* --- Hero: the Home banner painting, faded into the paper on the left ---------------------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-art { position: absolute; inset: 0 0 0 auto; width: min(76vw, 1180px); z-index: -1; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--paper) 0%, rgb(16 28 38 / 0.82) 26%, rgb(16 28 38 / 0) 58%),
    linear-gradient(0deg, var(--paper) 0%, rgb(16 28 38 / 0) 30%);
}
.hero-inner { display: grid; gap: 22px; align-content: center; min-height: min(84vh, 720px); padding-block: 72px 88px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); max-width: 11.5em; letter-spacing: -0.01em; }
.hero .lede { font-size: clamp(17px, 1.6vw, 19px); max-width: 33em; color: #d7d9d6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-facts { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--ink-muted); font-size: 14px; }
.hero-facts b { color: var(--ink); font-family: var(--display); font-size: 17px; }

@media (max-width: 760px) {
  .hero-art { inset: 0; width: 100%; height: 340px; }
  .hero-art::after { background: linear-gradient(0deg, var(--paper) 2%, rgb(16 28 38 / 0.25) 60%, rgb(16 28 38 / 0.5) 100%); }
  .hero-art img { object-position: 78% 50%; }
  .hero-inner { min-height: 0; padding-top: 250px; padding-bottom: 56px; }
}

/* --- Mock exams: a ledger of six levels, not a grid of cards ------------------------------ */
.exams { padding-block: 56px 24px; }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger-row { border-bottom: 1px solid var(--line); }
.ledger-row a {
  display: grid;
  grid-template-columns: 112px 1fr auto 40px;
  gap: 24px;
  align-items: center;
  padding: 22px 8px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .15s;
}
.ledger-row a:hover { background: linear-gradient(90deg, rgb(31 49 64 / 0.7), rgb(31 49 64 / 0)); }
.ledger-row a:hover .ledger-go { color: var(--on-accent); background: var(--accent); }
.lvl { font: 800 32px/1 var(--display); color: var(--accent); white-space: nowrap; }
.ledger-body { display: grid; gap: 8px; min-width: 0; }
.ledger-title { font: 700 19px/1.3 var(--display); }
.ledger-parts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-muted); }
.ledger-meta { text-align: right; font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.ledger-meta b { color: var(--ink); font: 800 17px var(--display); }
.sep { display: block; }
@media (max-width: 640px) { .sep { display: inline; } }
.ledger-go {
  width: 40px; height: 40px; border-radius: var(--r-tile);
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-muted);
  transition: background-color .15s, color .15s;
}
@media (max-width: 640px) {
  .ledger-row a { grid-template-columns: 66px 1fr 32px; gap: 14px; padding: 18px 4px; }
  .lvl { font-size: 22px; }
  .ledger-meta { grid-column: 2; grid-row: 2; text-align: left; }
  .sep::before { content: " · "; }
  .ledger-go { grid-row: 1 / span 2; grid-column: 3; width: 32px; height: 32px; }
}

/* --- AI grading: real results from a phone, scrolling in a frame (tools/stitch_phone_screens.py) */
.ai { padding-block: 96px 40px; }
.ai-body { display: grid; gap: 48px; }
.shots { display: grid; grid-template-columns: repeat(2, 384px); gap: 40px; justify-content: center; align-items: start; }
.results { padding-block: 56px 40px; }
.shot { margin: 0; display: grid; gap: 14px; position: relative; }
.screen-thumb { position: absolute; right: 5px; width: 4px; border-radius: 2px; background: var(--ink-muted); opacity: .55; z-index: 2; pointer-events: none; }
.screen {
  position: relative;
  aspect-ratio: 1080 / 2095;  /* one phone screen, without the status bar */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border-radius: 24px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.6);
}
.screen img { width: 100%; height: auto; }
.screen::-webkit-scrollbar { display: none; }
.screen-head { position: sticky; top: 0; z-index: 1; }
.screen-foot { position: sticky; bottom: 0; z-index: 1; }
.shot figcaption { font-size: 14px; color: var(--ink-muted); }
.shot figcaption b { display: block; color: var(--ink); font: 700 17px var(--display); }
.ai-points { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.ai-points li { color: var(--ink-muted); font-size: 15px; padding-top: 14px; border-top: 2px solid var(--accent); }
.ai-points b { color: var(--ink); display: block; font: 700 17px var(--display); margin-bottom: 4px; }
@media (max-width: 960px) {
  .ai-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shots { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 300px; gap: 20px; justify-content: start; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .shot { scroll-snap-align: center; }
}
@media (max-width: 640px) {
  .ai-points { grid-template-columns: 1fr; }
}

/* --- Free and Premium ------------------------------------------------------------------- */
.tiers { padding-block: 64px; }
.tier-scroll { overflow-x: auto; border-radius: var(--r-card); border: 1px solid var(--card-edge); background: var(--surface); }
.tier-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.tier-table th, .tier-table td { padding: 15px 18px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.tier-table thead th { border-top: 0; font: 800 12px/16px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); background: var(--inset); }
.tier-table tbody th { font-weight: 700; width: 30%; }
.tier-table td { color: var(--ink-muted); }
.tier-table td.none { color: var(--line); }
.tier-table td, .tier-table thead th + th { border-left: 1px solid var(--line); }
.tier-table .t-free { background: rgb(242 182 128 / 0.08); color: var(--ink); }
.tier-table thead .t-free { color: var(--accent); background: rgb(242 182 128 / 0.14); }
.tier-table .t-free b { color: var(--accent); }
.tier-table thead .t-prem { color: var(--highlight); }
.tier-foot { display: flex; align-items: center; gap: 24px; margin-top: 24px; }
.tier-foot p { font-size: 14px; max-width: 56ch; }
@media (max-width: 640px) { .tier-foot { flex-direction: column; align-items: stretch; } }
@media (max-width: 640px) {
  .tier-table, .tier-table tbody, .tier-table tr, .tier-table th, .tier-table td { display: block; min-width: 0; width: auto; }
  .tier-table thead { display: none; }
  .tier-table tbody th { padding-bottom: 6px; width: auto; }
  .tier-table td { border-top: 0; border-left: 0; padding: 6px 18px; text-align: right; }
  .tier-table td::before { content: attr(data-label); float: left; margin-right: 16px; color: var(--ink-muted); font-size: 13px; line-height: 22px; }
  .tier-table td.none { display: none; }
  .tier-table tr td:last-child { padding-bottom: 14px; }
}

/* --- Showcase: phones over the lantern painting --------------------------------------------- */
.showcase { position: relative; isolation: isolate; padding-block: 120px 80px; }
.showcase-art { position: absolute; inset: 0 0 auto; height: 620px; z-index: -1; overflow: hidden; }
.showcase-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: .85; }
.showcase-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--paper) 0%, rgb(16 28 38 / 0.2) 30%, rgb(16 28 38 / 0.4) 60%, var(--paper) 100%);
}
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); align-items: start; }
.phone { margin: 0; display: grid; gap: 16px; }

.phone-screen {
  border-radius: 34px;
  padding: 9px;
  background: #0a1117;
  box-shadow: 0 0 0 1px rgb(240 235 224 / 0.12), 0 30px 60px -20px rgb(0 0 0 / 0.7);
}
.phone-screen > img { border-radius: 26px; width: 100%; aspect-ratio: 1080 / 2095; object-fit: cover; object-position: top; background: var(--paper); }
.phone-screen { position: relative; }
.phone-screen .screen { border: 0; box-shadow: none; border-radius: 26px; }
.phone-screen .screen-thumb { right: 14px; }
.phone figcaption { font-size: 14px; color: var(--ink-muted); padding-inline: 8px; text-align: center; }
@media (max-width: 760px) {
  .phones { grid-template-columns: repeat(3, 72%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .phone { scroll-snap-align: center; }
  .phone-b { margin-top: 0; }
}
/* Rows of three phones (exam results, showcase) fill the column: 384px each at full width. */
@media (min-width: 861px) {
  .shots-3, .phones { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}

.features { list-style: none; padding: 0; margin: 88px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; }
.features li { display: flex; gap: 16px; align-items: start; }
.features .tile { width: 56px; height: 56px; }
.features h3 { font-size: 18px; margin-bottom: 4px; }
.features p { color: var(--ink-muted); font-size: 15px; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; gap: 24px; } }

.showcase-cta { display: flex; align-items: center; gap: 24px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.showcase-cta p { font-size: 14px; max-width: 52ch; }
@media (max-width: 640px) { .showcase-cta { flex-direction: column; align-items: stretch; } }

/* --- Format table ----------------------------------------------------------------------- */
.format { padding-block: 64px; }

/* --- FAQ -------------------------------------------------------------------------------- */
.faq { padding-block: 64px; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; }
.faq h2 { font-size: clamp(28px, 3vw, 36px); }
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 40px 20px 0;
  font: 700 18px/1.35 var(--display);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute; right: 6px; top: 50%;
  width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { color: var(--ink-muted); padding: 0 40px 22px 0; max-width: 64ch; }
@media (max-width: 760px) { .faq-grid { grid-template-columns: 1fr; gap: 16px; } }

/* --- Closing ---------------------------------------------------------------------------- */
.closing { padding-top: 48px; }
.closing-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--r-dialog);
  padding: 32px 48px 32px 32px;
  margin-inline: auto;
  max-width: calc(var(--measure) - 2 * var(--gutter));
}
.closing-inner img { width: 200px; height: 200px; border-radius: var(--r-card); }
.closing-inner div { display: grid; gap: 14px; justify-items: start; }
.closing-inner h2 { font-size: clamp(24px, 2.6vw, 32px); max-width: 18em; }
@media (max-width: 680px) {
  .closing-inner { grid-template-columns: 1fr; padding: 24px; margin-inline: var(--gutter); width: auto; justify-items: center; text-align: center; }
  .closing-inner img { width: 160px; height: 160px; }
  .closing-inner div { justify-items: center; }
}
