/* ==========================================================================
   Sabinoor — sabinoor.com design system
   Hand-written, no build step. One stylesheet for the whole site.

   Palette mirrors lib/theme/app_design.dart. If the app is retuned, retune
   the :root block here and in the inline critical block of every page
   (index.html, privacy/, terms/, sources/, delete-account/, get/).
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------
   NOTE: also inlined as critical CSS in each page's <head>. Keep in sync. */
:root {
  --emerald:      #0B5D1E;
  --emerald-deep: #073D14;
  --emerald-soft: #1F8C3A;
  --gold:         #C9A057;
  --gold-deep:    #A47B2E;
  --gold-soft:    #E2C384;
  --paper:        #FAF7F0;
  --cream:        #F4EDD8;
  --cream-soft:   #FBF6E4;
  --ink:          #1F1A14;
  --ink-soft:     #6B655A;
  --ink-faint:    #8B8473;
  --line:         #E8DFC6;
  --line-strong:  #D9CFB0;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, sans-serif;
  --arabic: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;

  --wrap: 1140px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(64px, 9vw, 124px);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(31,26,20,.05), 0 6px 18px -8px rgba(31,26,20,.14);
  --shadow-md: 0 2px 4px rgba(31,26,20,.05), 0 18px 44px -18px rgba(31,26,20,.28);
  --shadow-lg: 0 3px 8px rgba(31,26,20,.06), 0 40px 80px -28px rgba(31,26,20,.40);
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--emerald); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--emerald-soft); }
ul, ol { padding-left: 1.2em; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}

/* --- Focus + screen-reader utilities ------------------------------------- */
:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -140%);
  z-index: 200; background: var(--emerald); color: #fff;
  padding: 12px 22px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700; text-decoration: none; transition: transform .16s ease;
}
.skip:focus { transform: translate(-50%, 0); color: #fff; }

/* --- Layout --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 780px; }
.section { padding-block: var(--section); }
.section--cream { background: var(--cream); }
.section--soft  { background: var(--cream-soft); }
.section--ink   { background: var(--emerald-deep); color: #F3EEE1; }
.section--ink h2, .section--ink h3 { color: #FFFDF7; }

/* --- Type helpers --------------------------------------------------------- */
.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-deep);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--gold);
  border-radius: 2px; flex: none;
}
.eyebrow--center { justify-content: center; }
.section--ink .eyebrow { color: var(--gold-soft); }

.h-xl { font-size: clamp(2.35rem, 6.4vw, 4.25rem); }
.h-lg { font-size: clamp(1.95rem, 4.4vw, 3rem); }
.h-md { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.58;
  max-width: 62ch;
}
.section--ink .lede { color: #CFC6B2; }
.center { text-align: center; }
.center .lede, .center .eyebrow { margin-inline: auto; }
.center .eyebrow { justify-content: center; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--body); font-weight: 700; font-size: 15px;
  padding: 14px 26px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--emerald); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--emerald-soft); color: #fff; box-shadow: var(--shadow-md); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: rgba(255,255,255,.55); }
.btn--ghost:hover { border-color: var(--gold); color: var(--ink); background: #fff; }
.btn--gold { background: var(--gold); color: #2A1F0A; box-shadow: var(--shadow-sm); }
.btn--gold:hover { background: var(--gold-soft); color: #2A1F0A; }
.btn--sm { padding: 10px 19px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* --- Store buttons -------------------------------------------------------
   Our own design, not a reproduction of Apple's or Google's official badge
   artwork. Swap for the official badges when they are licensed and on disk. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.stores--center { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--ink); color: #FBF8F1; text-decoration: none;
  padding: 11px 20px 11px 17px; border-radius: 14px;
  border: 1.5px solid var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.store:hover { background: #33291E; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.store svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.store b { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.store span { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .68; line-height: 1.5; }
.section--ink .store { background: #FBF8F1; color: var(--ink); border-color: #FBF8F1; }
.section--ink .store:hover { background: #fff; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .store:hover { transform: none; } }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,240,.86);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 22px -18px rgba(31,26,20,.5); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 20px;
  letter-spacing: -.02em; color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
/* :not(.btn) matters — without it these win on specificity over .btn--primary
   and the header CTA loses its white label. */
.site-nav a:not(.btn) {
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 600;
  padding: 8px 13px; border-radius: 999px; transition: color .15s ease, background-color .15s ease;
}
.site-nav a:not(.btn):hover { color: var(--ink); background: rgba(201,160,87,.14); }
.header-cta { margin-left: 10px; }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1.5px solid var(--line-strong);
  border-radius: 10px; width: 42px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-toggle .x { display: none; }
.nav-toggle[aria-expanded="true"] .x { display: block; }
.nav-toggle[aria-expanded="true"] .bars { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 20px; margin: 0;
    box-shadow: var(--shadow-md);
  }
  .site-nav[hidden] { display: none; }
  .site-nav a:not(.btn) { padding: 13px 4px; font-size: 16px; border-radius: var(--r-sm); }
  .site-nav .btn { margin-top: 10px; justify-content: center; }
  .site-nav .header-cta { display: inline-flex; }
}

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--emerald-deep); color: #CFC6B2;
  padding-block: clamp(48px, 7vw, 76px) 30px;
  font-size: 14.5px;
}
.footer-grid {
  display: grid; gap: 38px 28px;
  grid-template-columns: 1.4fr repeat(4, minmax(120px, 1fr));
  align-items: start;
}
.footer-brand .brand { color: #FFFDF7; font-size: 21px; }
.footer-brand .brand:hover { color: #fff; }
.footer-brand p { margin-top: 14px; max-width: 30ch; color: #A9A190; font-size: 14px; line-height: 1.6; }
.footer-col h3 {
  font-family: var(--body); font-size: 11.5px; font-weight: 800; letter-spacing: .15em;
  text-transform: uppercase; color: var(--gold-soft); margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: #CFC6B2; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-base {
  margin-top: clamp(38px, 5vw, 58px); padding-top: 24px;
  border-top: 1px solid rgba(233,223,198,.16);
  display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center;
  font-size: 13px; color: #968E7E;
}
.footer-base .attribution { color: #B6AE9C; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }

/* --- Device mockup -------------------------------------------------------- */
.device {
  position: relative; width: 100%; max-width: 300px; margin-inline: auto;
  border-radius: 40px; padding: 9px;
  background: linear-gradient(160deg, #40372B 0%, #241D14 46%, #3A3126 100%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.1);
}
.device::after {
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 28%; height: 7px; border-radius: 99px; background: rgba(0,0,0,.42);
}
.device img { width: 100%; border-radius: 32px; background: var(--paper); }
.device--lg { max-width: 330px; }

/* --- Prose pages (privacy, terms, sources, delete-account) ---------------- */
.page-head {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(46px, 7vw, 78px);
}
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); }
.page-head .updated {
  display: inline-block; margin-top: 16px; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep);
  background: rgba(201,160,87,.16); border: 1px solid rgba(201,160,87,.34);
  padding: 5px 13px; border-radius: 999px;
}
.page-head .lede { margin-top: 20px; }

.prose { padding-block: clamp(42px, 6vw, 68px) clamp(56px, 8vw, 92px); }
.prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin-top: 2.2em; margin-bottom: .55em;
  padding-top: .9em; border-top: 1px solid var(--line);
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.14rem; margin-top: 1.7em; margin-bottom: .45em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.05em; color: #332D24; }
.prose li { margin-bottom: .42em; }
.prose li::marker { color: var(--gold-deep); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { font-weight: 600; }

.contact-card, .step-card, .callout {
  border-radius: var(--r-md); padding: 20px 22px; margin: 24px 0;
}
.contact-card { background: var(--cream-soft); border: 1px solid var(--line); }
.step-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.step-card h3 { margin-top: 0; }
.callout { background: rgba(201,160,87,.13); border-left: 4px solid var(--gold); }
.contact-card p:last-child, .step-card p:last-child,
.callout p:last-child, .step-card ol:last-child { margin-bottom: 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
