/* Wherlyst landing A ("Hat"): shared styles for every page.
   Tokens: docs/design/tokens.json ("Mürekkep ve Limon"). Plan: design-plan.md (§2, §12). */
:root {
  --paper: #F3F3F0;      /* color.bg.default */
  --ink: #141414;        /* color.primary.default */
  --lemon: #D7F25C;      /* color.accent.default */
  --street: #E4E4DF;     /* color.border.default */
  --lead: #5C5C57;       /* color.text.secondary */
  --sunken: #ECECE8;     /* color.surface.sunken */
  --pending-fg: #8A4B00; /* color.pending.fg */
  --pending-bg: #FFF1D6; /* color.pending.bg */
  --white: #FFFFFF;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 76px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: "kern" 1;
  overflow-x: hidden;
  padding-top: var(--header-h); /* room for the fixed header */
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 999px; z-index: 40; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
/* Fixed header (founder-brief md. 323): transparent at the top of the page, white once the page scrolls (.scrolled, set in i18n.js) */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background-color: transparent; box-shadow: 0 1px 0 transparent; transition: background-color .25s var(--ease), box-shadow .25s var(--ease); }
.top.scrolled { background-color: var(--white); box-shadow: 0 1px 0 var(--street), 0 6px 18px rgba(20, 20, 20, .04); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; text-decoration: none; }
.brand svg { width: 26px; height: 30px; }
.nav { display: flex; gap: 26px; margin-left: 18px; }
.nav a { text-decoration: none; font-weight: 500; font-size: 16px; color: var(--lead); }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .45em; }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang { display: inline-flex; background: var(--sunken); border-radius: 999px; padding: 3px; }
.lang button { font: inherit; font-size: 14px; font-weight: 700; border: 0; background: transparent; color: var(--lead); padding: 7px 13px; border-radius: 999px; cursor: pointer; min-width: 44px; min-height: 36px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.get { font-weight: 700; font-size: 16px; text-decoration: none; background: var(--ink); color: var(--white); padding: 11px 20px; border-radius: 999px; white-space: nowrap; }
.get:hover { background: #2B2B2A; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-weight: 700; font-size: 15px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1.5px solid var(--street); border-radius: 22px; padding: 10px; min-width: 210px; display: grid; }
.menu nav a { padding: 12px 14px; text-decoration: none; font-weight: 500; border-radius: 14px; }
.menu nav a:hover { background: var(--sunken); }
.menu nav a[aria-current="page"] { background: var(--sunken); font-weight: 700; }

/* ---------- Shared type ---------- */
section.band { padding: clamp(72px, 10vw, 136px) 0; }
h2 { font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; max-width: 14em; }
.sub { color: var(--lead); font-size: 18px; margin-top: 16px; max-width: 34em; }

/* Official store badges (static/badges, unmodified files; design-plan.md §6).
   Both drawn at the same visible height; Apple first; clear space >= 1/4 height.
   The Google PNGs ship with transparent padding (EN: 41px on every side of 646x250,
   TR: 29px top/bottom only), so the image is scaled up and pulled in with negative
   margins until the visible badge is exactly --bh tall. The file itself is not cropped. */
.stores { --bh: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--bh) / 4) calc(var(--bh) / 3); margin-top: 36px; padding: calc(var(--bh) / 4) 0; }
.store { display: inline-flex; height: var(--bh); align-items: center; border-radius: 9px; flex: none; }
.store img { display: block; max-width: none; }
.store.apple img { height: var(--bh); width: auto; }
.store.google img { height: calc(var(--bh) * 250 / 168); width: auto; margin: calc(var(--bh) * -41 / 168); }
html[lang="tr"] .store.google img { height: calc(var(--bh) * 250 / 192); margin: calc(var(--bh) * -29 / 192) 0; }
.store:focus-visible { outline-offset: 4px; }
.soon { margin-top: 2px; font-size: 15px; color: var(--lead); }

/* Phone frame around a real screenshot (store composite 1080x1920, screen x140–940, y430–1920) */
.phone { background: var(--ink); padding: 9px; border-radius: 46px; width: 100%; max-width: 330px; position: relative; }
.screen { position: relative; aspect-ratio: 800 / 1490; overflow: hidden; border-radius: 37px; background: var(--paper); }
.screen img { position: absolute; width: 135%; height: auto; max-width: none; left: -17.5%; top: -28.859%; }

/* Pending chip (app meaning: waiting for a location) */
.pending {
  display: inline-flex; align-items: center; gap: .45em; flex-wrap: nowrap;
  background: var(--pending-bg); color: var(--pending-fg);
  border: 1.5px solid #F0D9A8; border-radius: 999px;
  font-size: clamp(19px, 2.6vw, 32px); font-weight: 500; letter-spacing: -.015em;
  padding: .42em .9em .42em .5em; max-width: 100%;
}
/* "?" icon: circle and glyph in one SVG with a shared centre (T-1227) */
.pending .q { flex: none; width: 1.15em; height: 1.15em; display: inline-flex; }
.pending .q .qi { display: block; width: 100%; height: 100%; }

/* ---------- Download band (lemon: one per page, product pages only) ---------- */
.get-band { background: var(--lemon); padding: clamp(72px, 9vw, 120px) 0; }
.get-band .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 40px; align-items: end; }
.get-band h2 { max-width: 12em; }
.get-band .stores { margin-top: 0; }
.get-band .soon { color: var(--ink); }

/* ---------- Footer ---------- */
footer { padding: 64px 0 48px; font-size: 16px; }
.foot { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot ul a { text-decoration: none; color: var(--lead); }
.foot ul a:hover { color: var(--ink); text-decoration: underline; }
.foot ul a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.foot .tag { color: var(--lead); margin-top: 12px; max-width: 18em; }
.legal-line { margin-top: 56px; padding-top: 22px; border-top: 2px solid var(--street); color: var(--lead); font-size: 14px; line-height: 1.5; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 48px; }
.legal-line p { max-width: 62em; justify-self: end; }
/* "Wherlyst is a [90Pixel logo] project." Logo centred on the text line (md. 316). */
.legal-line .made-by { justify-self: start; align-self: start; display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; }
.legal-line .made-by .p90 { display: inline-flex; align-items: center; color: inherit; border-radius: 4px; line-height: 0; }
.legal-line .made-by .p90 svg { display: block; height: 28px; width: auto; aspect-ratio: 780 / 505; }
.legal-line .made-by .p90:hover { color: var(--ink); }
@media (max-width: 760px) { .legal-line { grid-template-columns: 1fr; } .legal-line p { justify-self: start; } }

/* ================= Inner pages ================= */
.page-head { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 72px); border-bottom: 2px solid var(--street); }
.page-head h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: .98; letter-spacing: -.04em; font-weight: 800; text-wrap: balance; max-width: 13em; }
.page-head .lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.48; max-width: 34em; margin-top: 24px; }
.page-head .meta { margin-top: 18px; color: var(--lead); font-size: 16px; }
h3.h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; }
.prose p + p { margin-top: 1em; }
.prose p, .prose li { max-width: 34em; }
.note { color: var(--lead); font-size: 16px; }

/* Two-column "text + screen" row */
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(40px, 7vw, 112px); align-items: center; }
.split .phone { justify-self: center; max-width: 300px; }
.split.flip > :first-child { order: 2; }

/* Plain table (permissions, sources) */
.table-scroll { overflow-x: auto; margin-top: 40px; position: relative; }
table.grid { width: 100%; border-collapse: collapse; font-size: 17px; }
table.grid th, table.grid td { text-align: left; vertical-align: top; padding: 16px 18px 16px 0; border-bottom: 2px solid var(--street); }
table.grid thead th { font-size: 16px; font-weight: 700; color: var(--lead); border-bottom-color: var(--ink); }
table.grid tbody th { font-weight: 700; }

/* Ordered steps inside a section (real sequences only) */
ol.steps { list-style: none; margin: 28px 0 0; padding: 0; counter-reset: s; display: grid; gap: 18px; max-width: 34em; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; align-items: start; }
ol.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 16px; line-height: 1; }

/* Draft banner on legal pages (pending colours: "waiting for review") */
.draft {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--pending-bg); color: var(--pending-fg);
  border: 1.5px solid #F0D9A8; border-radius: 20px;
  padding: 16px 20px; margin-top: 28px; max-width: 46em; font-size: 16px;
}
.draft strong { font-weight: 700; }
.draft .q { flex: none; width: 26px; height: 26px; border: 2px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 1px; }

/* Responsive */
@media (max-width: 980px) {
  .get-band .wrap { grid-template-columns: 1fr; }
  .foot { grid-template-columns: repeat(2, 1fr); }
  .foot > div:first-child { grid-column: 1 / -1; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .split.flip > :first-child { order: 0; }
  .split .phone { max-width: 260px; }
}
@media (max-width: 760px) {
  .nav, .top .get { display: none; }
  .menu { display: block; }
  .top-end { gap: 8px; }
  table.grid { font-size: 16px; }
  table.grid th, table.grid td { padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}

/* ================= Legal pages (privacy, terms) =================
   Contents rail = a small Hat: one line, a stop per section, the current
   section's stop is the app pin (ink ring, lemon core). */
.legal-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; padding: clamp(32px, 5vw, 64px) 0 clamp(64px, 8vw, 112px); }
.toc { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding: 4px 8px 12px 4px; }
.toc summary { list-style: none; cursor: pointer; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--sunken); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 10px; height: 10px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .25s var(--ease); }
.toc[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.toc-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.toc-rail { position: relative; --dot: 14px; }
.toc-rail::before, .toc-fill { content: ""; position: absolute; left: calc(var(--dot) / 2 - 2px); top: 10px; bottom: 10px; width: 4px; border-radius: 4px; }
.toc-rail::before { background: var(--street); }
.toc-fill { background: var(--ink); bottom: auto; height: var(--rail-len, 0px); transform-origin: top; transform: scaleY(var(--fill, 0)); transition: transform .45s var(--ease); }
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; position: relative; }
.toc-list a { display: grid; grid-template-columns: var(--dot) minmax(0, 1fr); gap: 14px; align-items: start; text-decoration: none; color: var(--lead); font-size: 15px; line-height: 1.35; padding: 6px 0; border-radius: 8px; }
.toc-list a:hover { color: var(--ink); text-decoration: underline; }
.toc-pin { width: var(--dot); height: var(--dot); margin-top: 2px; border-radius: 50%; background: var(--paper); border: 3px solid #B9B9B2; position: relative; transition: transform .3s var(--ease), background .2s, border-color .2s; }
.toc-list a.passed .toc-pin { border-color: var(--ink); background: var(--ink); }
.toc-list a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.toc-list a[aria-current="true"] .toc-pin { border-color: var(--ink); background: var(--lemon); transform: scale(1.35); box-shadow: 0 0 0 3px var(--paper); }

.legal { max-width: 42em; }
.legal-title { font-size: clamp(34px, 4.4vw, 56px); line-height: 1; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.legal-disclaimer { margin-top: 20px; color: var(--lead); font-size: 16px; }
.draft-notes { margin-top: 18px; font-size: 15px; color: var(--lead); border-top: 2px solid var(--street); border-bottom: 2px solid var(--street); }
.draft-notes summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--ink); }
.draft-notes p { margin: 0 0 12px; overflow-wrap: anywhere; }
.legal h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -.025em; max-width: none; margin: 2.2em 0 .6em; }
.legal h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; margin: 1.6em 0 .5em; }
.legal h4 { font-size: 18px; font-weight: 700; margin: 1.4em 0 .4em; }
.legal p, .legal li { line-height: 1.65; overflow-wrap: break-word; }
.legal p + p { margin-top: .9em; }
.legal ul, .legal ol { padding-left: 1.3em; margin: .8em 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5em; }
.legal li::marker { color: var(--lead); }
.legal blockquote { margin: 1em 0; padding: 12px 18px; border-left: 4px solid var(--street); color: var(--lead); }
.legal code { font-family: inherit; background: var(--sunken); padding: 1px 6px; border-radius: 6px; font-size: .92em; overflow-wrap: anywhere; }
.legal .ph { background: var(--pending-bg); color: var(--pending-fg); padding: 1px 6px; border-radius: 6px; font-size: .9em; overflow-wrap: anywhere; }
.legal-table { font-size: 15px; min-width: 560px; }
.legal-table th, .legal-table td { padding: 12px 14px 12px 0; }
.legal .table-scroll { margin: 1.2em 0; }
.legal :target { background: linear-gradient(var(--pending-bg), var(--pending-bg)) no-repeat; }

@media (min-width: 981px) {
  .toc summary { display: none; }
}
@media (max-width: 980px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: relative; top: 0; max-height: none; overflow: visible; padding: 0; }
  .toc .toc-title { display: none; }
  .toc .toc-rail { padding: 16px 4px 4px; }
  .toc-fill { display: none; }
}

/* Plain list with small pin bullets (not a sequence) */
ul.plain { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
ul.plain li { position: relative; padding-left: 26px; max-width: 34em; }
ul.plain li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 3.5px var(--ink), inset 0 0 0 6px var(--lemon); }
.more { font-weight: 700; }
.split h2 { font-size: clamp(34px, 4vw, 54px); max-width: 12em; }

/* Single-column legal pages (sub-processors, archive) */
.legal-single { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(72px, 9vw, 120px); }
.legal-single .legal { max-width: 64em; }
.archive-line { margin-top: 24px; max-width: 42em; font-size: 19px; line-height: 1.6; }
.legal-title + p { margin-top: 20px; }

/* ================= Inner page heads with imagery (T-1239, founder-brief md. 327) =================
   One tone per page from the home rhythm: How it works = paper + streets, Shared lists = ink,
   Support = cream. Each band starts below the fixed header (body padding), so the transparent
   header always sits on paper. One light, one-off motion; reduced motion shows the end state. */
.page-head.has-art { position: relative; overflow: hidden; border-bottom: 0; padding: clamp(36px, 5vw, 72px) 0; }
.page-head.has-art .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.head-art svg { display: block; width: 100%; height: auto; max-width: 480px; margin-left: auto; }
.head-streets { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.page-head.tone-paper { background: var(--paper); box-shadow: inset 0 -2px 0 var(--street); }
.page-head.tone-cream { background: var(--pending-bg); }
.page-head.tone-ink { background: var(--ink); color: var(--white); }
.page-head.tone-ink .lede { color: #D9D9D3; }
.page-head.tone-ink :focus-visible { outline-color: var(--white); }
/* Motion: slower and lighter than the home hero */
.head-art .pin-drop { transform-box: fill-box; transform-origin: 50% 100%; }
.head-art .m, .head-art .link-pill { transform-box: fill-box; transform-origin: 50% 50%; }
.motion .head-art .route-draw { stroke-dasharray: 1; animation: hdraw 1.8s cubic-bezier(.45, .05, .2, 1) .3s both; }
.motion .head-art .pin-drop { animation: hdrop .9s cubic-bezier(.3, 1.4, .5, 1) 1.8s both; }
.motion .tone-cream .head-art .pin-drop { animation-delay: .4s; }
.motion .head-art .m { animation: hpop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.motion .head-art .m:nth-child(1) { animation-delay: .4s; } .motion .head-art .m:nth-child(2) { animation-delay: .6s; } .motion .head-art .m:nth-child(3) { animation-delay: .8s; }
.motion .head-art .link-pill { animation: hslide .8s var(--ease) 1.1s both; }
@keyframes hdraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hdrop { from { transform: translateY(-60px); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes hpop { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hslide { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .page-head.has-art .wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .head-art svg { max-width: 300px; margin: 0; max-height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .motion .head-art * { animation: none !important; }
}

/* Legal pages: one shared, quiet head band (paper + faint street pattern), title and date; no motion */
.legal-head { background-color: var(--paper); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='240' viewBox='0 0 480 240'%3E%3Cg fill='none' stroke='%23E4E4DF'%3E%3Cpath stroke-width='10' d='M0 170 H480'/%3E%3Cpath stroke-width='6' d='M150 0 V240'/%3E%3Cpath stroke-width='4' d='M370 0 V240'/%3E%3Cpath stroke-width='3' d='M0 240 L480 0'/%3E%3C/g%3E%3C/svg%3E"); background-size: 480px 240px; background-position: right top; box-shadow: inset 0 -2px 0 var(--street); padding: clamp(32px, 5vw, 64px) 0 clamp(28px, 4vw, 48px); }
.legal-head .legal-title { max-width: 18em; }
.legal-meta { margin-top: 14px; color: var(--lead); font-size: 16px; }
.legal-meta strong { color: var(--ink); font-weight: 700; }

/* Section tones for inner product pages (T-1239 / founder-brief md. 328). Legal pages keep one light background. */
section.tone-white { background: var(--white); }
section.tone-paper { background: var(--paper); }
section.tone-cream { background: var(--pending-bg); }
section.tone-ink { background: var(--ink); color: var(--white); }
section.tone-ink .prose p, section.tone-ink .sub, section.tone-ink .note { color: #D9D9D3; }
section.tone-ink a { color: var(--white); }
section.tone-ink :focus-visible { outline-color: var(--white); }
section.tone-ink .demo :focus-visible { outline-color: var(--ink); }
section.tone-ink .demo { color: var(--ink); }
section.tone-cream table.grid th, section.tone-cream table.grid td { border-bottom-color: #F0D9A8; }
section.tone-cream table.grid thead th { border-bottom-color: var(--ink); }

/* Store placeholder while the official badges are off (founder-brief md. 331; design-plan §6) */
.soon-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px 20px 10px 16px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 700; font-size: 16px; line-height: 1.2; }
.soon-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lemon); box-shadow: 0 0 0 3px rgba(215, 242, 92, .25); }
.stores-soon + .soon { display: none; }
