/* home.css - the page at latintest.io.
   Palette and type come straight from style.css (the builder's own cream,
   oxblood and Cinzel/Crimson Pro), so the site and the app read as one.
   Layout: a dark oxblood hero band whose screenshot overlaps onto cream,
   then alternating feature rows, a details grid, three steps, and the two
   sign-in doors last. */

.home {
  /* style.css pads the body for the test page's fixed score bar; this page
     has none, so cancel it rather than leave a strip under the footer. */
  margin-bottom: -5rem;
  background: var(--paper);
  color: var(--ink);
  --band: #6b2824;
  --band-deep: #4a1b18;
  --card-shadow: 0 30px 60px -30px rgba(60, 25, 20, 0.45);
}
.home h1, .home h2, .home h3 { font-family: "Cinzel", serif; font-weight: 600; letter-spacing: 0.01em; margin: 0; color: var(--ink); }
.home p { margin: 0; }
.home a { color: var(--oxblood); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.home section[id] { scroll-margin-top: 4.5rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ------------------------------------------------------------ buttons */
.h-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Crimson Pro", Georgia, serif; font-size: 1rem; font-weight: 600; line-height: 1.2;
  padding: 0.6rem 1.15rem; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.h-btn:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.h-btn-solid { background: var(--oxblood); color: #fff; }
.h-btn-solid:hover { background: var(--oxblood-soft); }
.h-btn-quiet { background: transparent; color: var(--oxblood); border-color: #cfc3b4; }
.h-btn-quiet:hover { background: #f1ebe0; }
.h-btn-outline { background: transparent; color: var(--oxblood); border-color: var(--oxblood); }
.h-btn-outline:hover { background: var(--oxblood); color: #fff; }
.h-btn-light { background: #fbf6ec; color: var(--band); }
.h-btn-light:hover { background: #fff; }
.h-btn-ghost { background: transparent; color: #fbf6ec; border-color: rgba(251, 246, 236, 0.5); }
.h-btn-ghost:hover { background: rgba(251, 246, 236, 0.12); }
.link-btn {
  background: none; border: none; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* ---------------------------------------------------------------- nav */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 242, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 3.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink) !important; }
.brand-mark {
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 4px;
  background: var(--oxblood); color: #fbf6ec; font-size: 1.25rem; line-height: 1;
}
.brand-name { font-family: "Cinzel", serif; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.95rem; }
.nav-links { display: flex; gap: 1.6rem; margin-left: 1rem; flex: 1; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.98rem; }
.nav-links a:hover { color: var(--oxblood); }
.nav-actions { display: flex; gap: 0.6rem; margin-left: auto; }

/* --------------------------------------------------------------- hero */
.hero {
  background: radial-gradient(120% 140% at 50% 0%, var(--band) 0%, var(--band-deep) 100%);
  color: #f6efe4; position: relative; text-align: center;
  padding: clamp(2.4rem, 5vw, 3.8rem) 0 0;
  /* A slide drifting sideways mid-transition must not widen the page. */
  overflow-x: clip;
}
.hero::before {
  content: ""; position: absolute; inset: 0.75rem; border: 1px solid rgba(246, 239, 228, 0.18);
  pointer-events: none;
}
.hero-copy { max-width: 1060px; position: relative; }
.kicker {
  font-family: "Cinzel", serif; font-size: 0.74rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(246, 239, 228, 0.72); margin-bottom: 1rem !important;
}
.hero h1 {
  color: #fbf6ec; font-size: clamp(1.8rem, 4vw, 2.9rem); line-height: 1.15; letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.14), 0 -1px 1px rgba(0, 0, 0, 0.4);
  text-wrap: balance;
}
.lead { font-size: clamp(1.05rem, 1.9vw, 1.22rem); line-height: 1.55; color: rgba(246, 239, 228, 0.9); margin: 1.1rem auto 0 !important; max-width: 44rem; text-wrap: balance; }
.hero-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-student { margin-top: 0.9rem !important; font-size: 0.98rem; color: rgba(246, 239, 228, 0.78); }
.hero-student .link-btn { color: #fbf6ec; }
.hero-showcase { margin-top: clamp(1.8rem, 4vw, 2.6rem); position: relative; max-width: 1060px; }

/* The screenshot hangs off the band onto the cream below it. */
.hero-showcase { margin-bottom: calc(-1 * clamp(3rem, 8vw, 6.5rem)); }
.hero + .features { padding-top: clamp(3rem, 8vw, 6.5rem); }

/* ------------------------------------------------- screenshot frames */
.shot { margin: 0; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; box-shadow: var(--card-shadow); }
.shot img { display: block; width: 100%; height: auto; }
.shot-bar { display: flex; gap: 0.38rem; padding: 0.55rem 0.8rem; background: #f1ebe0; border-bottom: 1px solid var(--rule); }
.shot-bar i { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: #d9cdbd; }
.shot-hero { border-color: rgba(246, 239, 228, 0.25); box-shadow: 0 40px 80px -30px rgba(20, 5, 4, 0.7); }

/* ------------------------------------------------------------ pillars
   The things the page leads with. They're tabs: choosing one swaps the
   screenshot below, and nothing changes on its own. */
.pillars {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1rem; text-align: left;
}
.pillar {
  display: flex; flex-direction: column; justify-content: flex-start; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 0; border-top: 2px solid rgba(246, 239, 228, 0.28);
  padding: 0.55rem 0.5rem 0.6rem; border-radius: 0 0 3px 3px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pillar:hover { background: rgba(246, 239, 228, 0.07); border-top-color: rgba(246, 239, 228, 0.6); }
.pillar[aria-selected="true"] { background: rgba(246, 239, 228, 0.12); border-top-color: #fbf6ec; }
.pillar:focus-visible { outline: 2px solid #fbf6ec; outline-offset: 2px; }
.pillar-title {
  display: block; font-family: "Cinzel", serif; font-weight: 600; font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(251, 246, 236, 0.78); margin-bottom: 0.2rem;
}
.pillar[aria-selected="true"] .pillar-title { color: #fff; }
/* Two lines of title on every tab, so the descriptions line up across them. */
@media (min-width: 901px) { .pillar-title { line-height: 1.3; min-height: 2.6em; } }
.pillar-text { display: block; font-size: 0.86rem; line-height: 1.3; color: rgba(246, 239, 228, 0.78); }

.showcase-stage { margin-top: 1.3rem; position: relative; }
/* Previous / next arrows, centered on the screenshot's edges. */
.car-arrow {
  position: absolute; top: 50%; z-index: 2; width: 2.8rem; height: 2.8rem; margin-top: -1.4rem; padding: 0;
  display: grid; place-items: center; cursor: pointer; border-radius: 50%;
  background: #fbf6ec; border: 1px solid rgba(60, 10, 8, 0.25); color: var(--oxblood);
  box-shadow: 0 6px 18px -4px rgba(20, 5, 4, 0.55); transition: transform 0.15s ease, background 0.15s ease;
}
.car-arrow svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.car-arrow:hover { background: #fff; transform: scale(1.07); }
.car-arrow:focus-visible { outline: 3px solid #fbf6ec; outline-offset: 2px; }
.car-prev { left: -1.4rem; }
.car-next { right: -1.4rem; }
@media (max-width: 1100px) { .car-prev { left: 0.5rem; } .car-next { right: 0.5rem; } .car-arrow { opacity: 0.92; } }
@media (max-width: 640px) { .car-arrow { width: 2.4rem; height: 2.4rem; margin-top: -1.2rem; } }
/* The slides share one grid cell, so the old one can fade out while the new
   one fades in (home.js does the animating; nothing moves on its own). */
.showcase-stage { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* While the height eases, a taller outgoing slide is cut off instead of
   spilling over what's below (the margin leaves its shadow and the arrows). */
.showcase-stage.is-sliding { overflow: clip; overflow-clip-margin: 100px; }
.showcase-stage > [role=tabpanel] { grid-area: 1 / 1; min-width: 0; will-change: transform, opacity; }
/* Every screenshot is cropped to the same shape, so the page doesn't jump
   when a different one is chosen. */
.shot-hero img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; height: auto; }
/* On a desktop, keep the whole stretch from the top of the tabs to the bottom
   of the screenshot and its caption inside one screen: the 358px is the nav,
   the tabs, the window bar, the caption, and a little air. */
@media (min-width: 901px) { .shot-hero img { max-height: max(300px, calc(100svh - 358px)); } }
/* Two screenshots side by side in one tab (partial credit). */
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.shot-pair .shot-hero img { aspect-ratio: 604 / 760; }
.shot figcaption {
  padding: 0.7rem 1.1rem; border-top: 1px solid var(--rule); background: #fffdf9;
  font-size: 0.98rem; line-height: 1.4; color: var(--ink-soft); text-align: left;
}
/* The three macron states, drawn like the tiles in the builder. */
.m-req, .m-no, .m-ok {
  display: inline-block; min-width: 1.5em; padding: 0 0.28em; text-align: center; font-weight: 600;
  border-radius: 3px; border: 1px solid #c9beb0; background: #fff; color: var(--ink); line-height: 1.35;
}
.m-req { background: #e2eef3; border-color: #9fc0d0; color: #2f6f8f; }
.m-no { background: #f7e4e2; border-color: #d89a94; color: #8c3b34; }

/* ----------------------------------------------------------- features */
.eyebrow {
  font-family: "Cinzel", serif; font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--oxblood); margin-bottom: 0.6rem !important;
}
.feature { padding: clamp(2.5rem, 6vw, 4.75rem) 0; }
.feature:nth-of-type(even) { background: #fffdf9; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.feature-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.feature-flip .feature-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature-flip .feature-text { order: 2; }
.feature h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); line-height: 1.2; }
.feature-text > p:not(.eyebrow) { margin-top: 1rem; font-size: 1.1rem; line-height: 1.6; color: var(--ink-soft); }
.ticks { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: 0.65rem; }
.ticks li { position: relative; padding-left: 1.6rem; line-height: 1.45; }
.ticks li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.5em; width: 0.62rem; height: 0.34rem;
  border-left: 2px solid var(--oxblood); border-bottom: 2px solid var(--oxblood); transform: rotate(-45deg);
}
.shot-tall { max-width: 460px; justify-self: center; }
.shot-sq { max-width: 600px; justify-self: center; }

/* The two smaller cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.duo-card .shot { margin-bottom: 1.4rem; aspect-ratio: 4 / 3; }
.duo-card .shot img { height: calc(100% - 2rem); object-fit: cover; object-position: top left; }
.duo-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.duo-card p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.55; }

/* ------------------------------------------------------------ details */
.details { background: #fffdf9; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(2.75rem, 6vw, 4.75rem) 0; }
.details h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); max-width: 30rem; line-height: 1.2; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 2.5rem; margin-top: 2.2rem; }
.detail-grid h3 { font-size: 1rem; margin-bottom: 0.35rem; color: var(--oxblood); }
.detail-grid p { color: var(--ink-soft); line-height: 1.5; font-size: 1.02rem; }

/* ----------------------------------------------------------- how it works */
.how { padding: clamp(2.75rem, 6vw, 4.75rem) 0; }
.how h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); line-height: 1.2; }
.steps { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 4px; padding: 1.5rem 1.4rem 1.4rem; position: relative; }
.steps li::before {
  content: counter(step); font-family: "Cinzel", serif; font-weight: 600; font-size: 1.1rem; color: #fbf6ec;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--oxblood); display: grid; place-items: center; margin-bottom: 0.9rem;
}
.steps h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.steps p { color: var(--ink-soft); line-height: 1.5; }

/* ------------------------------------------------------------ get started */
.start { background: radial-gradient(120% 140% at 50% 0%, var(--band) 0%, var(--band-deep) 100%); color: #f6efe4; padding: clamp(3rem, 6vw, 4.5rem) 0; }
.start h2 { color: #fbf6ec; text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 920px; margin: 2rem auto 0; }
.start-card { background: var(--paper); color: var(--ink); border-radius: 4px; padding: 1.7rem 1.7rem 1.6rem; box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.6); }
.start-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.start-card p { color: var(--ink-soft); line-height: 1.5; }
.start-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ------------------------------------------------------------- footer */
.site-foot { padding: 1.6rem 0 2rem; border-top: 1px solid var(--rule); background: var(--paper); }
.foot-inner { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: 0.95rem; }
.foot-inner .brand-name { color: var(--ink); }
.foot-note { color: var(--ink-soft); }
.foot-inner nav { margin-left: auto; display: flex; gap: 1.3rem; flex-wrap: wrap; }
.foot-inner nav a, .foot-inner nav .link-btn { color: var(--ink-soft); }
.foot-inner nav a:hover, .foot-inner nav .link-btn:hover { color: var(--oxblood); }

/* ------------------------------------------------------------ dialogs */
.sheet-dialog {
  border: none; padding: 0; background: var(--paper-raised); color: var(--ink);
  border-radius: 6px; width: min(26rem, calc(100vw - 2rem)); box-shadow: 0 40px 90px -30px rgba(20, 5, 4, 0.7);
}
.sheet-dialog::backdrop { background: rgba(38, 20, 18, 0.55); backdrop-filter: blur(2px); }
.dialog-body { padding: 2rem 1.9rem 1.7rem; position: relative; }
.dialog-body h2 { font-size: 1.3rem; }
.dialog-sub { color: var(--ink-soft); font-style: italic; margin: 0.35rem 0 1.4rem !important; }
.dialog-close {
  position: absolute; top: 0.55rem; right: 0.7rem; width: 2rem; height: 2rem; border: none; background: none;
  font-size: 1.6rem; line-height: 1; color: var(--ink-soft); cursor: pointer; border-radius: 3px;
}
.dialog-close:hover { background: #f1ebe0; color: var(--ink); }
.dialog-close:focus-visible { outline: 2px solid var(--focus); }

.sheet-dialog label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.sheet-dialog input, .sheet-dialog select {
  width: 100%; font-family: "Crimson Pro", serif; font-size: 1.1rem; padding: 0.55rem 0.7rem;
  border: 1px solid #c9beb0; border-radius: 3px; background: var(--paper); color: var(--ink); margin-bottom: 1rem;
}
.sheet-dialog input:focus, .sheet-dialog select:focus { outline: 2px solid var(--focus); outline-offset: 1px; background: var(--paper-raised); }
.sheet-dialog #studentHeading + .dialog-sub { margin-bottom: 1.2rem !important; }
/* Codes are read off a slip of paper, so give the characters room. */
.sheet-dialog input.home-code { text-transform: uppercase; letter-spacing: 0.22em; font-size: 1.25rem; text-align: center; }
.sheet-dialog input.home-code::placeholder { letter-spacing: 0.22em; opacity: 0.45; }
.sheet-dialog .check-btn, .sheet-dialog .home-btn {
  display: block; width: 100%; padding: 0.65rem 1rem; font-size: 1.02rem; text-align: center; text-decoration: none; line-height: 1.4; color: #fff;
}
.sheet-dialog .check-btn:disabled { opacity: 0.6; cursor: default; }
.sheet-dialog .home-btn-quiet { background: transparent; color: var(--oxblood); border: 1px solid #c9beb0; margin-top: 0.6rem; }
.sheet-dialog .home-btn-quiet:hover { background: var(--paper); }
.sheet-dialog .login-error { margin-top: 0.9rem; margin-bottom: 0; }
.sheet-dialog .login-note { margin: 0.9rem 0 0; }
.home-welcome { margin-bottom: 1rem !important; font-size: 1.05rem; }
.home-welcome strong { font-weight: 600; }

/* ------------------------------------------------------------ narrow */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .feature-inner, .feature-flip .feature-inner { grid-template-columns: 1fr; }
  .feature-flip .feature-text { order: 0; }
  .shot-tall { max-width: 380px; }
  /* Five tabs don't fit across a narrow screen, so they scroll sideways;
     the next one peeking in at the edge is the hint. */
  .pillars {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(12rem, 1fr);
    gap: 0 0.6rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 0.3rem;
  }
  .pillar { scroll-snap-align: start; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .duo-card .shot { aspect-ratio: auto; }
  .duo-card .shot img { height: auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 1.1rem; }
  .feature-text > p:not(.eyebrow) { font-size: 1.02rem; line-height: 1.55; }
  .ticks li { font-size: 0.98rem; }
  .detail-grid p, .steps p, .start-card p, .duo-card p:not(.eyebrow) { font-size: 0.98rem; }
  .hero-actions .h-btn { flex: 1 1 100%; }
  .shot-pair { grid-template-columns: 1fr; }
  .nav-inner { gap: 0.6rem; }
  .brand-name { font-size: 0.82rem; letter-spacing: 0.08em; }
  .nav-actions .h-btn { padding: 0.5rem 0.75rem; font-size: 0.92rem; }
  .hero::before { inset: 0.5rem; }
  .hero h1 { font-size: 1.65rem; }
  .pillars { grid-auto-columns: 68%; }
  .pillar-text { font-size: 0.88rem; }
  .shot figcaption { font-size: 0.92rem; padding: 0.6rem 0.85rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .start-grid { grid-template-columns: 1fr; }
  .foot-inner nav { margin-left: 0; width: 100%; }
}
@media (max-width: 400px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home * { transition: none !important; }
}
