/* Sopravo — shared stylesheet
   Studio palette "Spruce & Apricot" (October 2026). Independent of every app's palette:
   apps keep their own colours in their icons; the website wears the studio's.

   Fonts are self-hosted on purpose: hotlinking Google Fonts would send every visitor's IP
   to Google and falsify the "no embedded third-party scripts" claim on /privacy.
   Licences: SIL OFL, see assets/fonts/OFL-*.txt. Latin subsets cover English, Spanish
   and Portuguese. */

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ----------
   Light is the default. Dark applies when the system asks for it, unless the visitor
   picked light with the header switch (data-theme="light"), or when they picked dark
   (data-theme="dark"). The dark values are written twice for that reason; keep the two
   blocks identical. assets/js/theme.js sets data-theme. Every pair below passes WCAG AA. */

:root {
  color-scheme: light;

  --spruce:  #22474A;
  --apricot: #F2C29A;
  --cream:   #F5F1E8;   /* ink of every icon, see docs/icon-system.md */

  --bg:         #EEF1EE;
  --surface:    #DFE6E2;
  --fg:         #162123;   /* 14.5:1 on bg */
  --fg-muted:   #4F5E5E;   /*  6.0:1 on bg, 5.4:1 on surface */
  --border:     #CBD0CE;
  --link:       var(--spruce);   /* 8.9:1 */
  --focus:      var(--spruce);

  --btn-bg:     var(--spruce);
  --btn-fg:     #EEF1EE;
  --band-bg:    var(--spruce);
  --band-fg:    #EEF1EE;
  --band-body:  #D6DDDA;   /* 7.4:1 on spruce */
  --band-rule:  #5F7A7B;
  --band-accent: var(--apricot);   /* 6.3:1 on spruce */
  --dot-soon:   #A79576;
  --dot-live:   var(--spruce);
  --code-bg:    rgba(22, 33, 35, 0.07);

  --show-moon: inline;
  --show-sun:  none;

  --font-display: "Jost", "Futura", "Century Gothic", "Segoe UI", sans-serif;
  --font-body: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;

  --radius-l: 32px;
  --radius-m: 20px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:         #0F1C1D;
    --surface:    #172A2B;
    --fg:         #E4EAE6;
    --fg-muted:   #9FB0AD;
    --border:     #2A3D3E;
    --link:       var(--apricot);
    --focus:      var(--apricot);
    --btn-bg:     var(--apricot);
    --btn-fg:     #0F1C1D;
    --band-bg:    #1A3739;
    --band-fg:    #E4EAE6;
    --band-body:  #C9D3CF;
    --band-rule:  #34514F;
    --band-accent: var(--apricot);
    --dot-soon:   var(--apricot);
    --dot-live:   #8FC7B4;
    --code-bg:    rgba(228, 234, 230, 0.10);
    --show-moon: none;
    --show-sun:  inline;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:         #0F1C1D;
  --surface:    #172A2B;
  --fg:         #E4EAE6;
  --fg-muted:   #9FB0AD;
  --border:     #2A3D3E;
  --link:       var(--apricot);
  --focus:      var(--apricot);
  --btn-bg:     var(--apricot);
  --btn-fg:     #0F1C1D;
  --band-bg:    #1A3739;
  --band-fg:    #E4EAE6;
  --band-body:  #C9D3CF;
  --band-rule:  #34514F;
  --band-accent: var(--apricot);
  --dot-soon:   var(--apricot);
  --dot-live:   #8FC7B4;
  --code-bg:    rgba(228, 234, 230, 0.10);
  --show-moon: none;
  --show-sun:  inline;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; display: block; }

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- layout ---------- */

/* One container for every page. Long text keeps a ~70-character measure through
   .prose / .doc__body, not by narrowing the whole page. */
.wrap { max-width: 80rem; margin: 0 auto; padding-inline: var(--gutter); }

.band { background: var(--band-bg); color: var(--band-fg); }

/* ---------- header ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-block: 1.25rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--fg);
  text-decoration: none;
}
.nav__brand img { width: 30px; height: 30px; flex: 0 0 auto; }
.nav__brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.nav__right { display: flex; align-items: center; gap: 0.5rem; }

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
}
.nav__links a:hover { background: var(--surface); }
.nav__links a[aria-current="page"] { background: var(--surface); }
.nav__links .nav__cta, .nav__links .nav__cta:hover { background: var(--btn-bg); color: var(--btn-fg); }

/* Shown only once theme.js has run, because without it the switch would do nothing. */
.theme-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.js .theme-toggle { display: grid; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle .icon-moon { display: var(--show-moon); }
.theme-toggle .icon-sun  { display: var(--show-sun); }

/* ---------- buttons, status ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: none;
}

/* "Soon on Android", "Android": a quiet line, never a badge. The dot carries the state. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--dot-soon);
  flex: 0 0 auto;
}
.status--live::before { background: var(--dot-live); }

/* Small inline label for paid features, e.g. "Pro" */
.tag {
  display: inline-block;
  vertical-align: 0.2em;
  margin-left: 0.4rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg-muted);
}

/* An email address shown as text, with a copy button instead of a mailto link.
   One field: the address and its button share a single rounded box. The field takes the
   surface colour on the page ground, and the page ground inside a surface card. */
.contact {
  --field-bg: var(--surface);
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  margin: 0;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.contact__address {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--fg);
  -webkit-user-select: all;   /* Safari still needs the prefix */
  user-select: all;
  overflow-wrap: anywhere;
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.copy svg { flex: 0 0 auto; }
.copy:hover, .copy.is-copied { background: var(--btn-bg); color: var(--btn-fg); }
.copy:focus-visible { outline-offset: -3px; }

/* ---------- page heads ---------- */

.section-title {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--fg-muted); margin: 0; max-width: 36em; }

/* Home: headline and tagline on the left, the mark drawn large on the right. */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem 3.5rem;
  padding-block: clamp(2rem, 5vw, 4.5rem) clamp(4rem, 8vw, 7rem);
}
.hero__copy { flex: 1 1 26rem; display: flex; flex-direction: column; gap: 1.75rem; min-width: 0; }
.hero h1 {
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.hero__tagline { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.25rem); max-width: 34em; }
.hero__art {
  flex: 1 1 24rem;
  height: clamp(18rem, 36vw, 32rem);
  background: var(--band-bg);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.hero__art svg { display: block; width: 100%; height: 100%; }
.horizon__s    { stroke: var(--cream); }
.horizon__line { stroke: var(--band-accent); }

/* Product and help pages: icon, title and lede, with an optional panel on the right. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 3rem;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem);
}
.page-head__main { flex: 1 1 26rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.page-head__icon { width: 72px; height: 72px; border-radius: 16px; }
.page-head h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.page-head__eyebrow { margin: 0; color: var(--fg-muted); font-size: 1rem; }

/* ---------- home: apps ---------- */

.apps { display: flex; flex-direction: column; gap: 1.75rem; padding-bottom: clamp(4rem, 8vw, 7rem); }

.app-cards { display: flex; flex-wrap: wrap; gap: 1.25rem; }

.app-card {
  flex: 999 1 32rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem 2rem;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background: var(--surface);
  border-radius: var(--radius-l);
  color: var(--fg);
  text-decoration: none;
  min-width: 0;
}
.app-card__icon { width: 136px; height: 136px; border-radius: 30px; flex: 0 0 auto; }
.app-card__body { flex: 1 1 18rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; min-width: 0; }
.app-card h3 { margin: 0; font-size: clamp(2.4rem, 4vw, 3.25rem); line-height: 1; }
.app-card p { margin: 0; font-size: 1.1rem; max-width: 30em; }
.app-card .button { margin-top: 0.5rem; }
.app-card:hover .button { text-decoration: underline; text-underline-offset: 4px; }

.app-more {
  flex: 1 1 16rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-l);
  color: var(--fg-muted);
}
.app-more svg { stroke: currentColor; }
.app-more p { margin: 0; font-family: var(--font-display); font-size: 1.75rem; line-height: 1.2; }

/* ---------- home: values ---------- */

.values-band .wrap { display: flex; flex-direction: column; gap: 3rem; padding-block: clamp(4rem, 8vw, 7.5rem); }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 3rem 3.5rem; }
.value { display: flex; flex-direction: column; gap: 0.85rem; padding-top: 1.5rem; border-top: 1px solid var(--band-rule); }
.value h3 { margin: 0; font-size: 1.9rem; color: var(--band-accent); line-height: 1.15; }
.value p { margin: 0; color: var(--band-body); }

/* ---------- contact strip ---------- */

.say-hello {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-block: clamp(4rem, 7vw, 5.5rem);
}
.say-hello__text { flex: 1 1 24rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.say-hello p { margin: 0; color: var(--fg-muted); max-width: 32em; }
.say-hello .contact__address { font-size: 1.15rem; }

/* ---------- Diemo product page ---------- */

.product-art {
  flex: 1 1 22rem;
  display: grid;
  place-items: center;
  min-height: clamp(16rem, 30vw, 26rem);
  background: var(--surface);
  border-radius: var(--radius-l);
}
.product-art img { width: clamp(9rem, 16vw, 13rem); height: auto; border-radius: 22.5%; }

/* Pre-launch box: status, invite and address grouped apart from the lede.
   At launch the whole box is replaced by the Play badge. */
.launch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 30rem;
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.launch .status { font-size: 1rem; font-weight: 700; color: var(--fg); }
.launch p { margin: 0; color: var(--fg-muted); font-size: 1rem; }
.launch .contact { margin-top: 0.6rem; }

.badge-play img { height: 60px; width: auto; }

/* One row per feature: name on the left, description on the right, so the list reads
   down the names and any number of features fits without an orphan in the last row. */
.features { padding-block: 1rem clamp(4rem, 7vw, 6rem); }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: 0.5rem 3rem;
  align-items: baseline;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}
.feature:last-child { border-bottom: 1px solid var(--border); }
.feature h3 { margin: 0; font-size: 1.55rem; line-height: 1.15; }
.feature p { margin: 0; color: var(--fg-muted); }
@media (max-width: 44rem) {
  .feature { grid-template-columns: 1fr; }
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem 2.5rem;
  margin: 0 0 clamp(4rem, 7vw, 6rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  border-radius: var(--radius-m);
}
.facts div { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.facts dt { font-size: 0.9rem; color: var(--fg-muted); }
.facts dd { margin: 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; }

/* ---------- screenshots ---------- */

.shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 3.5rem;
  scroll-snap-type: x mandatory;
}
.shots img {
  flex: 0 0 auto;
  width: 15rem;
  aspect-ratio: 9 / 19.5;
  border-radius: 20px;
  border: 1px solid var(--border);
  scroll-snap-align: center;
}

/* ---------- text pages: side column + reading column ---------- */

.doc {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem clamp(2.5rem, 6vw, 6rem);
  padding-block: 2rem clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--border);
}
.doc__aside { flex: 1 1 15rem; display: flex; flex-direction: column; gap: 2rem; min-width: 0; }
.doc__body { flex: 999 1 34rem; max-width: 46rem; min-width: 0; }
@media (min-width: 60rem) {
  .doc__aside { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
}
/* On the help page, answers come first on a phone; the contact box follows them. */
@media (max-width: 59.99rem) {
  .doc__aside--after { order: 2; }
}

.toc { display: flex; flex-direction: column; font-size: 0.98rem; }
.toc__title { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.toc a { padding: 0.35rem 0; color: var(--fg-muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--fg); text-decoration: underline; }

.side-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-m);
}
.side-card h2 { margin: 0; font-size: 1.4rem; line-height: 1.2; }
.side-card p { margin: 0; font-size: 0.98rem; color: var(--fg-muted); }
.side-card .contact { --field-bg: var(--bg); }
.side-card .contact__address { font-size: 0.95rem; padding-inline: 0.8rem; }
.side-card .copy { padding-inline: 0.8rem; }

.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.75rem; line-height: 1.2; margin: 3rem 0 0.75rem; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin: 0.4rem 0; }
.prose li::marker { color: var(--fg-muted); }

.callout {
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2rem;
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child  { margin-bottom: 0; }
.callout h2 { font-size: 1.4rem; }

/* ---------- help page (FAQ) ---------- */

.faq-group + .faq-group { margin-top: 3rem; }
.faq-group h2 { margin: 0 0 0.5rem; font-size: 1.75rem; }

/* Each question is a native <details>, so it works without script. */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 1.1rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  color: var(--link);
  transition: transform .15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--link); }
.faq__answer { padding: 0 0 1.4rem; }
.faq__answer p { margin: 0 0 0.75rem; }
.faq__answer p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */

.not-found { padding-block: clamp(4rem, 12vw, 9rem); display: flex; flex-direction: column; gap: 1.25rem; }
.not-found h1 { margin: 0; font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.02em; }
.not-found p { margin: 0; font-size: 1.2rem; }

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.75rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer a { color: var(--fg-muted); text-decoration: none; }
.footer a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- utility ---------- */

.muted { color: var(--fg-muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
