/* Ghi website. Palette, faces, paper edges and buttons come from the app (lib/app/paper_theme.dart,
   onboarding_screen.dart). Layout follows the screen grid: the hero alone on the first screen, every
   other section one or two screens, one .wrap for every edge. */
@font-face { font-family: "Inter"; src: url("assets/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/Inter-SemiBold.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }

:root {
  /* the app's own tokens */
  --bg: #F8F3E8; --ink: #2D261E; --muted: #5B4E40; --paper: #FFF8E6;
  --accent: #85CED1; --accent-hover: #9BDADC; --accent-press: #6FBFC3; --link: #1B686C;
  --yellow: #F7E2A0; --aqua: #C8E7E8; --peach: #F0DDCC; --green: #E4E9CE; --sky: #D9EAF4; --pink: #EDE1EB; --coral: #F0C4B8;
  --line: rgba(45, 38, 30, .14); --edge: rgba(45, 38, 30, .16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* rhythm */
  --nav: 72px; --padt: 120px; --padb: 72px; --gut: 80px; --hpadb: 64px; --btn-h: 48px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-lg: 28px; --r-md: 20px; --r-btn: 16px;
  --t-h1: 72px; --t-h2: 48px; --t-lead: 20px;
}
@media (max-width: 1023px) { :root { --gut: 48px; --t-h1: 56px; --t-h2: 40px; } }
@media (max-width: 639px) {
  :root { --nav: 56px; --padt: 96px; --padb: 48px; --gut: 24px; --hpadb: 24px; --t-h1: 38px; --t-h2: 30px; --t-lead: 18px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 0; scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.footer-dark :focus-visible, .closing :focus-visible { outline-color: var(--accent); }

.wrap { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- headings and text ---------- */
h1, h2 { font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: var(--t-h1); line-height: 1.04; }
h2 { font-size: var(--t-h2); line-height: 1.1; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.lead { font-size: var(--t-lead); line-height: 1.5; max-width: 34em; text-wrap: pretty; }
.body { font-size: 16px; line-height: 1.6; max-width: 62ch; }

/* ---------- skip link, nav ---------- */
.skip-link { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 3; padding: 10px 16px; border-radius: var(--r-btn);
  background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none; opacity: 0; pointer-events: none; }
.skip-link:focus { opacity: 1; pointer-events: auto; }
.nav { position: fixed; inset: 0 0 auto 0; height: var(--nav); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav__bar { position: relative; height: 100%; display: flex; align-items: center; gap: 32px; }
.nav__logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.nav__mark { width: 32px; height: 32px; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 12px; }
.nav__link:hover { background: var(--accent-hover); }
.nav__link[aria-current] { box-shadow: inset 0 -3px 0 var(--accent-press); }
.nav__cta { flex: none; }
.nav__toggle { display: none; width: 44px; height: 44px; padding: 0; margin-left: auto; border: 1px solid var(--line); border-radius: var(--r-btn);
  background: var(--paper); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.nav__toggle svg { width: 20px; height: 20px; }
@media (max-width: 1023px) {
  .nav__links { position: fixed; top: var(--nav); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 8px var(--gut) 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav[data-open] .nav__links { display: flex; }
  .nav__link { min-height: 56px; padding: 0; border-radius: 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .nav__link:hover { background: none; }
  .nav__toggle { display: inline-flex; margin-left: 0; }
  .nav__cta { margin-left: auto; }
}
@media (max-width: 639px) {
  .nav .nav__cta { display: none; }
  .nav .nav__toggle { margin-left: auto; }
  .nav[data-open] .nav__links { height: calc(100svh - var(--nav)); }
}

/* ---------- buttons: the app's paper tabs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 24px; border: 0; border-radius: var(--r-btn);
  font: 600 16px/1.2 var(--font); letter-spacing: -.005em; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  box-shadow: 0 3px 0 var(--edge); }
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 0 var(--edge); }
.btn--primary:active { background: var(--accent-press); transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn--secondary { background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--edge), inset 0 0 0 1.5px var(--ink); }
.btn--secondary:hover { background: #fff; transform: translateY(-1px); }
.btn--secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge), inset 0 0 0 1.5px var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link:hover { text-decoration-color: transparent; }
@media (max-width: 639px) { .btn-row .btn { width: 100%; } }

/* ---------- the screen grid ---------- */
main > section, footer.closing { height: calc(var(--h, 1) * 100svh); padding: var(--padt) 0 var(--padb); position: relative; }
.hero { padding-top: calc(var(--nav) + 48px); padding-bottom: var(--hpadb); }
.ground-aqua { background: var(--aqua); }
@media (max-width: 1023px) {
  main > section, footer.closing { height: auto; min-height: calc(var(--h, 1) * 100svh); }
  .hero { min-height: 100svh; }
}
@media (max-width: 639px) {
  main > section:not(.hero), footer.closing { min-height: calc(var(--hm, var(--h, 1)) * 100lvh); }
}

.split { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.split__text { grid-column: 1 / span 5; }
.split__art { grid-column: 7 / span 6; }
@media (max-width: 1023px) {
  .split { display: block; }
  .split__art { margin-top: 32px; }
}
.split__text > * + * { margin-top: 24px; }
.split__text h1 + .lead, .split__text h2 + .lead { margin-top: 24px; }

/* ---------- stage: a sticky pad of paper holding the art ---------- */
.stage { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 0 var(--edge); overflow: hidden; }
.stage--anim { aspect-ratio: 4 / 3; }
@media (min-width: 1024px) { .stage--anim { aspect-ratio: 1 / 1; } }
.anim { position: absolute; inset: 0; }
.anim svg { width: 100%; height: 100%; }
/* ---------- feature cards ---------- */
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head > * + * { margin-top: 24px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card { display: flex; flex-direction: column; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 6px 0 var(--edge); overflow: hidden; }
.card__art { position: relative; aspect-ratio: 5 / 4; }
.card__text { padding: 4px 20px 20px; }
.card__text h3 { font-size: 20px; }
.card__text p { margin-top: 2px; font-size: 16px; line-height: 1.5; }
@media (min-width: 1024px) and (max-width: 1279px) { .card__text { padding: 4px 16px 16px; } .card__text p { font-size: 16px; } }
@media (min-width: 640px) and (max-width: 1023px) { .cards { grid-template-columns: repeat(2, 1fr); } .card__art { aspect-ratio: 16 / 10; } .section-head { margin-bottom: 32px; } }
@media (max-width: 639px) { .section-head { margin-bottom: 32px; } .cards { grid-template-columns: 1fr; gap: 12px; } .card__art { aspect-ratio: 16 / 10; } .card__text { padding: 2px 20px 16px; } }

/* ---------- rows ---------- */
.rows { margin-top: 32px; }
.rows li { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding: 14px 0; border-top: 1.5px solid var(--line); }
.rows li:last-child { border-bottom: 1.5px solid var(--line); }
.rows strong { font-weight: 600; }
.rows span { color: var(--ink); }
@media (max-width: 639px) { .rows { display: none; } }

/* ---------- swatches ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.swatch { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; cursor: pointer; background: var(--c); box-shadow: 0 3px 0 var(--edge), inset 0 0 0 1.5px var(--line);
  transition: transform .12s ease, box-shadow .12s ease; }
.swatch:hover { transform: translateY(-2px); }
.swatch:active { transform: translateY(1px); }
.swatch[aria-pressed="true"] { box-shadow: 0 3px 0 var(--edge), inset 0 0 0 3px var(--ink); }
.swatch--shuffle { width: auto; padding: 0 16px; background: var(--paper); font: 600 15px/1 var(--font); color: var(--ink); }

/* ---------- close and footer ---------- */
footer.closing { background: var(--ink); color: var(--paper); display: flex; flex-direction: column; }
footer.closing > .wrap { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.closing__top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.closing__main { grid-column: 1 / span 6; }
.closing__art { grid-column: 7 / span 6; position: relative; aspect-ratio: 72 / 64; }
@media (max-width: 1023px) { .closing__top { display: block; } .closing__art { margin-top: 24px; aspect-ratio: auto; height: clamp(220px, 26svh, 340px); } }
@media (max-width: 639px) { .closing__art { display: none; } }
.closing__main h2 { font-size: var(--t-h1); line-height: 1.04; }
.closing__main > * + * { margin-top: 24px; }
.closing__main .lead { color: #E9DFC9; }
.closing .btn--primary { box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.closing__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-top: 24px; border-top: 1.5px solid rgba(255, 248, 230, .22); font-size: 15px; }
.closing__brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; font-size: 20px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.closing__brand img { width: 28px; height: 28px; }
.closing__links a, .closing__links button { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 248, 230, .45); }
.closing__links a:hover, .closing__links button:hover { text-decoration-color: currentColor; }
.closing__brand { text-decoration: none !important; }
.closing__legal { color: #CFC4AE; }
.credits { flex-basis: 100%; font-size: 14px; color: #CFC4AE; }
.credits summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; color: var(--paper); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 248, 230, .45); }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.credits[open] summary::after { transform: translateY(1px) rotate(225deg); }
.credits summary:hover { text-decoration-color: currentColor; }
.credits p { padding-bottom: 8px; }
[hidden] { display: none !important; }

/* ---------- policy page ---------- */
.policy-page main { padding-top: calc(var(--nav) + 64px); padding-bottom: 96px; }
.policy { width: min(100% - 2 * var(--gut), 760px); margin-inline: auto; }
.policy > * + * { margin-top: 24px; }
.policy h1 { font-size: clamp(34px, 5vw, 56px); }
.policy h2 { font-size: 26px; letter-spacing: -.02em; margin-top: 48px; }
.policy p { max-width: 62ch; }
.policy .stamp { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--yellow); font-size: 14px; font-weight: 500; }
.policy a { color: var(--link); font-weight: 500; }
.policy .callout { padding: 20px 24px; border-radius: var(--r-md); background: var(--paper); box-shadow: 0 5px 0 var(--edge); }
.policy-page footer.closing { height: auto; padding: 48px 0 24px; }

@media (prefers-reduced-motion: reduce) { .btn, .swatch { transition: none; } }

/* hero entrance: the words rise once on load; the picture never waits */
html.m-enter .hero .split__text > * { opacity: 0; transform: translateY(14px); }
html.m-enter.m-enter-go .hero .split__text > * { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
html.m-enter.m-enter-go .hero .split__text > :nth-child(2) { transition-delay: 70ms; }
html.m-enter.m-enter-go .hero .split__text > :nth-child(3) { transition-delay: 140ms; }
@media (prefers-reduced-motion: reduce) { html.m-enter .hero .split__text > * { opacity: 1; transform: none; } }

/* 1024 to 1279: the text takes six columns so a screen of 768 holds a heading, a lead and the rows */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --t-h1: 56px; --t-h2: 38px; --t-lead: 18px; }
  .split__text { grid-column: 1 / span 6; padding-right: 24px; }
}
/* tablet: a wide, low stage that runs from line to line */
@media (min-width: 640px) and (max-width: 1023px) {
  .split__art .stage--anim { aspect-ratio: auto; height: clamp(260px, 31svh, 460px); }
  .split__art .stage--shot { width: 100%; height: clamp(260px, 31svh, 460px); }
  .stage--shot img { height: 100%; object-fit: cover; object-position: 50% 14%; }
  .rows li { padding: 10px 0; }
  .rows { margin-top: 24px; }
}
