/* MySom - mysom.app
   One typeface (Source Serif 4, the app's), sentence case throughout,
   five sizes. Colours mirror lib/core/theme/app_theme.dart in the app repo.
   Square corners everywhere. */

@font-face { font-family: 'Source Serif 4'; src: url(fonts/SourceSerif4-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url(fonts/SourceSerif4-Italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url(fonts/SourceSerif4-SemiBold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F6F3ED;
  --surface: #EDE8DF;
  --ink: #2A2520;
  --ink-2: #4A4239;
  --mute: #6E655D;
  --rule: #D5CFC4;
  --rule-2: #C2BCB0;
  --accent: #7A2A2A;
  --accent-2: #5C1F22;
  --accent-text: #7A2A2A;
  --on-accent: #F6F3ED;

  /* the always-dark band */
  --night: #170E08;
  --night-ink: #EDE9E0;
  --night-ink-2: #CEBFB2;
  --night-rule: #3C2B1C;
  --night-accent-text: #CB7D72;

  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;

  /* the whole type scale */
  --t-display: clamp(40px, 6vw, 76px);
  --t-title: clamp(28px, 3.6vw, 40px);
  --t-heading: clamp(22px, 2.4vw, 27px);
  --t-body: 18px;
  --t-small: 15px;

  --gutter: 22px;
  --wide: 1080px;
  --text: 640px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #170E08;
    --surface: #211509;
    --ink: #EDE9E0;
    --ink-2: #CEBFB2;
    --mute: #B0A89E;
    --rule: #2E1F14;
    --rule-2: #3C2B1C;
    --accent: #8F3535;
    --accent-2: #7A2A2A;
    --accent-text: #CB7D72;
    --night: #0F0905;
    --night-rule: #33241A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--bg); padding: 8px 12px; z-index: 20; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--text); }
.stack { display: grid; gap: 20px; }

/* ---------- type: five sizes, one family ---------- */
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 { font-size: var(--t-display); line-height: 1.02; letter-spacing: -0.02em; font-style: italic; }
h2 { font-size: var(--t-title); line-height: 1.12; letter-spacing: -0.012em; }
h3 { font-size: var(--t-heading); line-height: 1.2; letter-spacing: -0.008em; }
p { margin: 0; }
.lede { font-size: clamp(19px, 2vw, 21px); line-height: 1.5; color: var(--ink-2); }
.small { font-size: var(--t-small); line-height: 1.5; color: var(--mute); }
/* a quiet label above a heading: small, in the accent colour, sentence case */
.label { font-size: var(--t-small); color: var(--accent-text); margin: 0; }

/* ---------- header / footer ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-head.scrolled { border-bottom-color: var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: block; width: 116px; flex: none; }
.brand img { width: 116px; }
.nav { display: flex; gap: 4px; margin-right: -10px; }
.nav a, .text-link {
  font-size: var(--t-small);
  text-decoration: none;
  color: var(--ink-2);
  padding: 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a[aria-current="page"], .text-link:hover { color: var(--accent-text); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 96px; padding: 40px 0 48px; }
.site-foot .wrap { display: grid; gap: 24px; }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.foot-mark { width: 56px; height: 56px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -10px; }
.foot-legal { display: grid; gap: 4px; }
.foot-legal p { font-size: var(--t-small); color: var(--mute); }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(64px, 9vw, 120px); }
.hero .wrap { display: grid; gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 26px; }
h1 span { display: block; white-space: nowrap; }
.hero-shot { margin: 0; max-width: 320px; width: 100%; justify-self: center; }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.2fr 0.8fr; gap: 72px; min-height: calc(100vh - 160px); }
}

/* ---------- real app screens ---------- */
.shot { width: 100%; border: 1px solid var(--rule-2); background: var(--bg); }

/* ---------- feature rows ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: clamp(48px, 8vw, 88px); }
.rows { display: grid; gap: clamp(72px, 12vw, 140px); }
.row { display: grid; gap: 32px; align-items: center; }
.row-shot { margin: 0; max-width: 300px; width: 100%; justify-self: center; }
/* On a phone the heading sits above its screenshot, as its caption. */
@media (max-width: 759px) {
  .row { gap: 16px; }
  .row .feature { order: -1; max-width: 300px; width: 100%; justify-self: center; }
}
.feature { display: grid; gap: 12px; align-content: start; max-width: 460px; }
.feature p { color: var(--ink-2); }
.feature p + p { margin-top: 4px; }
@media (min-width: 760px) {
  .row { grid-template-columns: 300px 1fr; gap: 80px; }
  .row.flip { grid-template-columns: 1fr 300px; }
  .row.flip .row-shot { order: 2; }
  .row.flip .feature { justify-self: end; }
}
.more { margin-top: clamp(80px, 12vw, 140px); padding-top: 48px; border-top: 1px solid var(--rule); display: grid; gap: 40px 56px; }
@media (min-width: 760px) { .more { grid-template-columns: repeat(2, 1fr); } }

/* ---------- the dark privacy band ---------- */
.band { background: var(--night); color: var(--night-ink); padding: clamp(72px, 11vw, 136px) 0; }
.band .label { color: var(--night-accent-text); }
.band .lede { color: var(--night-ink-2); }
.promises { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 0 64px; }
@media (min-width: 760px) { .promises { grid-template-columns: 1fr 1fr; } }
.promises li { border-top: 1px solid var(--night-rule); padding: 20px 0 22px; display: grid; gap: 6px; }
.promises strong { font-weight: 400; font-size: var(--t-heading); line-height: 1.2; }
.promises span { color: var(--night-ink-2); }
.band .text-link { color: var(--night-accent-text); padding-left: 0; }

/* ---------- support ladder ---------- */
.ladder { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--rule); }
@media (min-width: 640px) { .ladder { grid-template-columns: repeat(4, 1fr); } }
.ladder li { padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-heading); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font-size: var(--t-body); text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.button:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* ---------- long-form pages (privacy, terms, support) ---------- */
.doc { padding: clamp(32px, 6vw, 72px) 0 0; }
.doc .wrap { max-width: calc(var(--text) + 2 * var(--gutter)); }
.doc-head { display: grid; gap: 14px; margin-bottom: 40px; }
.doc-head h1 { font-style: normal; font-size: var(--t-title); line-height: 1.1; }
.doc-body h2 { font-size: var(--t-heading); margin: 48px 0 12px; }
.doc-body h3 { font-size: var(--t-body); font-weight: 600; margin: 28px 0 8px; }
.doc-body p, .doc-body li { color: var(--ink-2); }
.doc-body p { margin: 0 0 16px; }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body ul, .doc-body ol { padding-left: 1.2em; margin: 0 0 18px; }
.doc-body li { margin: 0 0 8px; }
.doc-body li::marker { color: var(--accent-text); }
.doc-body hr { height: 1px; background: var(--rule); border: 0; margin: 40px 0; }
.doc-body code { font-family: inherit; font-style: italic; }
.doc-body a { color: var(--accent-text); text-underline-offset: 3px; }
.doc-body .meta { font-size: var(--t-small); color: var(--mute); margin: 0 0 2px; }
.doc-body p.meta + p:not(.meta) { margin-top: 28px; }
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: var(--t-small); }
.doc-body th { text-align: left; font-weight: 400; font-size: var(--t-small); color: var(--mute); padding: 0 16px 10px 0; border-bottom: 1px solid var(--rule-2); }
.doc-body td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: top; }

/* support page */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative; font-size: var(--t-heading); line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 18px; font-size: 24px; color: var(--accent-text); }
.faq details[open] summary::after { content: '\2013'; }
.faq .answer { padding: 0 0 22px; display: grid; gap: 12px; }
.faq .answer p, .faq .answer li { color: var(--ink-2); }
.faq .answer ul { margin: 0; padding-left: 1.2em; }
.faq .answer li { margin-bottom: 6px; }
.faq-group { margin-top: 56px; }
.faq-group > .label { margin-bottom: 14px; }
.contact { margin-top: 64px; background: var(--surface); border: 1px solid var(--rule-2); padding: 22px 22px 24px; display: grid; gap: 12px; }
.contact a { color: var(--accent-text); }

/* 404 */
.lost { min-height: 50vh; display: grid; align-content: center; gap: 20px; padding: 64px 0; }

/* ---------- discovering each section as you scroll ----------
   Only when site.js has run (it adds .js to <html>), so with scripts off
   everything simply shows. Off entirely for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease), transform 900ms var(--ease);
  }
  .js [data-reveal="from-left"] { transform: translateX(-40px); }
  .js [data-reveal="from-right"] { transform: translateX(40px); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .d1 { transition-delay: 120ms; }
  .js .d2 { transition-delay: 240ms; }
  .js .d3 { transition-delay: 360ms; }
  .js .d4 { transition-delay: 480ms; }
}
.after { margin-top: 36px; }
.after-sm { margin-top: 18px; }

/* small phones: the logo and three links must fit beside each other */
@media (max-width: 420px) {
  .brand, .brand img { width: 96px; }
  .nav { margin-right: -7px; }
  .nav a { padding: 10px 7px; }
}
/* sideways reveals must never widen the page */
main { overflow-x: clip; }
