/* Estoico — the colors come from Palette in Shared/DitheredImage.swift. */
:root {
  --ink: #0d0d0e;
  --ink-2: #141416;
  --ink-3: #1b1b1e;
  --parchment: #ede3cc;
  --muted: rgb(237 227 204 / 0.64);
  --faint: rgb(237 227 204 / 0.4);
  --line: rgb(237 227 204 / 0.09);
  --gold: #cca866;
  --gold-soft: rgb(204 168 102 / 0.14);
  --serif: ui-serif, "Newsreader", "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1160px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--ink); }

/* Language: every text exists in en and pt; the html element picks one. */
html[data-lang="en"] [data-l="pt"],
html[data-lang="pt"] [data-l="en"] { display: none !important; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.display, h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.012em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1.02; }
h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; }
h3 { font-size: 24px; line-height: 1.2; }
.lede { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; text-wrap: pretty; margin: 22px 0 0; max-width: 34em; }
p { text-wrap: pretty; }

/* Header */
.site-header { position: absolute; inset: 0 0 auto; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 400 22px/1 var(--serif); }
.brand img { width: 34px; height: 34px; border-radius: 8px; outline: 1px solid rgb(255 255 255 / 0.1); outline-offset: -1px; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a.link { color: var(--muted); text-decoration: none; font-size: 15px; padding: 10px 12px; border-radius: 10px; transition: color 0.2s, background-color 0.2s; }
.nav a.link:hover { color: var(--parchment); background: rgb(255 255 255 / 0.05); }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 1px var(--line); }
.lang-switch button {
  appearance: none; border: 0; cursor: pointer; min-width: 44px; height: 34px; padding: 0 10px; border-radius: 9px;
  background: transparent; color: var(--faint); font: 600 12px/1 var(--sans); letter-spacing: 0.08em;
  transition: color 0.2s, background-color 0.2s, scale 0.15s;
}
.lang-switch button:active { scale: 0.96; }
html[data-lang="en"] .lang-switch [data-set-lang="en"],
html[data-lang="pt"] .lang-switch [data-set-lang="pt"] { background: var(--parchment); color: var(--ink); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border-radius: 14px; border: 0; cursor: pointer; text-decoration: none; font: 600 16px/1 var(--sans);
  transition: background-color 0.2s, color 0.2s, scale 0.15s, box-shadow 0.2s;
}
.btn:active { scale: 0.96; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 10px 30px -10px rgb(204 168 102 / 0.55); }
.btn-gold:hover { background: #d8b678; }
.btn-ghost { background: rgb(255 255 255 / 0.06); color: var(--parchment); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgb(255 255 255 / 0.1); }
.btn svg { width: 18px; height: 18px; }
.soon { color: var(--faint); font-size: 14px; }

/* Dithered Images: keep the 1-bit dots sharp where the image is scaled up.
   Scaled down, nearest-neighbor makes a coarse checkerboard, so small images stay smooth. */
.hero-bust { image-rendering: pixelated; }
@media (min-resolution: 2dppx) { .dither { image-rendering: pixelated; } }

/* Hero */
.hero { position: relative; padding: 140px 0 90px; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; z-index: -2;
  background: radial-gradient(closest-side, rgb(204 168 102 / 0.13), transparent 70%);
}
.hero-bust {
  position: absolute; z-index: -1; top: 40px; right: max(-120px, calc((100vw - var(--max)) / 2 - 180px));
  width: min(720px, 62vw); opacity: 0.42;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 55% 42%, #000 35%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 55% 42%, #000 35%, transparent 75%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 48px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 34px 0 0; padding: 0; list-style: none; color: var(--faint); font-size: 14px; }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0.8; }
.hero-phone { justify-self: center; }

/* Phone frame around a raw screenshot (1320 × 2868). */
.phone {
  --w: 300px; --pad: 9px; --r: calc(var(--w) * 0.13);
  position: relative; width: var(--w); max-width: 100%; aspect-ratio: 1320 / 2868; padding: var(--pad);
  border-radius: calc(var(--r) + var(--pad));
  background: linear-gradient(160deg, #2c2c30, #121214 60%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.1),
    0 1px 1px rgb(0 0 0 / 0.4),
    0 30px 60px -20px rgb(0 0 0 / 0.9),
    0 60px 120px -40px rgb(204 168 102 / 0.18);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); outline: 1px solid rgb(255 255 255 / 0.1); outline-offset: -1px; }
.phone.lg { --w: 330px; }
.phone.sm { --w: 250px; }

/* Mockups cropped from the Onboarding: fade the cut edge into the page. */
.mock { width: 100%; max-width: 360px; mix-blend-mode: lighten; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }

/* Sections */
section { position: relative; }
.section { padding: clamp(80px, 12vw, 150px) 0; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); border: 0; margin: 0; }

/* Today: the Daily Quote, the same as in the app. */
.today { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.today-art {
  position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -30px rgb(0 0 0 / 0.9);
}
.today-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.78; transition: opacity 0.4s ease; }
.today-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgb(13 13 14 / 0.85)); pointer-events: none; }
.today-art figcaption { position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 1; color: var(--faint); font-size: 12px; line-height: 1.4; }
.today-art figcaption a { color: var(--muted); }
.today-date { color: var(--faint); font-size: 15px; margin: 0 0 26px; font-variant-numeric: tabular-nums; }
.quote-text { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.22; margin: 0; text-wrap: pretty; transition: opacity 0.3s ease, translate 0.3s ease; }
.quote-author { margin: 28px 0 4px; color: var(--gold); font: 600 13px/1.3 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; }
.quote-work { margin: 0; color: var(--faint); font: italic 400 16px/1.4 var(--serif); }
.today-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.is-changing .quote-text, .is-changing .quote-meta { opacity: 0; translate: 0 6px; }
.quote-meta { transition: opacity 0.3s ease, translate 0.3s ease; }
.is-changing .today-art img { opacity: 0.2; }

/* Features */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.feature + .feature { margin-top: clamp(90px, 12vw, 160px); }
.feature.flip .feature-copy { order: 2; }
.feature-visual { display: flex; justify-content: center; gap: 24px; position: relative; }
.feature-visual::before {
  content: ""; position: absolute; inset: 10% 5%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(204 168 102 / 0.1), transparent);
}
.feature-copy .lede { max-width: 26em; }
.points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 14px; }
.points li { display: flex; gap: 14px; color: var(--muted); font-size: 16px; }
.points li::before { content: ""; flex: none; width: 18px; height: 1px; margin-top: 13px; background: var(--gold); }
.pair { display: flex; gap: 20px; align-items: flex-start; }
.pair .phone:last-child { margin-top: 60px; }

/* Widgets: two mockups side by side. */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); margin-top: 56px; }
.widget-card {
  border-radius: 28px; padding: 32px 28px 0; background: linear-gradient(180deg, var(--ink-2), var(--ink) 80%);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.widget-card h3 { margin-bottom: 8px; }
.widget-card p { color: var(--muted); margin: 0 0 28px; font-size: 16px; max-width: 24em; }
.widget-card .mock { max-width: 300px; }

/* Authors */
.authors { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; margin-top: 56px; }
.author { margin: 0; }
.author-img {
  aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.author-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.86; transition: scale 0.6s cubic-bezier(0.2, 0, 0, 1); }
.author:hover .author-img img { scale: 1.04; }
.author figcaption { padding: 14px 2px 0; }
.author strong { display: block; font: 400 18px/1.2 var(--serif); }
.author span { display: block; margin-top: 4px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.sources { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.translators { margin: 0; color: var(--muted); font-size: 16px; }
.translators em { font-family: var(--serif); color: var(--parchment); }

/* Privacy band */
.privacy-band {
  border-radius: 32px; padding: clamp(36px, 6vw, 72px); position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, #18171a, var(--ink-2));
  box-shadow: inset 0 0 0 1px var(--line);
}
.privacy-band .band-art {
  position: absolute; right: 0; top: 0; height: 100%; width: 50%; z-index: -1; opacity: 0.22; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 48px 0 40px; }
.trio div { display: grid; gap: 8px; align-content: start; }
.trio svg { width: 28px; height: 28px; color: var(--gold); margin-bottom: 6px; }
.trio strong { font: 400 21px/1.25 var(--serif); }
.trio span { color: var(--muted); font-size: 15px; }

/* Footer */
.site-footer { padding: 64px 0 48px; color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: grid; gap: 28px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-links a { color: var(--muted); text-decoration: none; padding: 10px; border-radius: 10px; }
.footer-links a:hover { color: var(--parchment); background: rgb(255 255 255 / 0.05); }
.site-footer p { margin: 0; max-width: 60em; line-height: 1.6; }

/* Reveal on scroll (only with JavaScript and without reduced motion). */
.js .reveal { opacity: 0; translate: 0 14px; transition: opacity 0.8s cubic-bezier(0.2, 0, 0, 1), translate 0.8s cubic-bezier(0.2, 0, 0, 1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* Privacy page */
.policy-hero { position: relative; padding: 150px 0 70px; overflow: hidden; isolation: isolate; }
.policy-hero .hero-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: 0.2;
  -webkit-mask-image: linear-gradient(#000, transparent 92%); mask-image: linear-gradient(#000, transparent 92%);
}
.policy-hero h1 { font-size: clamp(40px, 6vw, 72px); max-width: 12em; }
.updated { margin: 24px 0 0; color: var(--faint); font-size: 15px; }
.policy { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); padding-bottom: 60px; }
.toc { position: sticky; top: 32px; align-self: start; display: grid; gap: 2px; font-size: 14px; }
.toc a { color: var(--faint); text-decoration: none; padding: 7px 12px; border-radius: 8px; transition: color 0.2s, background-color 0.2s; }
.toc a:hover { color: var(--parchment); background: rgb(255 255 255 / 0.05); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 64px; }
.summary div { border-radius: 20px; padding: 24px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 6px; align-content: start; }
.summary svg { width: 24px; height: 24px; color: var(--gold); margin-bottom: 8px; }
.summary strong { font: 400 19px/1.25 var(--serif); }
.summary span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.policy article { max-width: 680px; }
.policy article section { padding-top: 8px; scroll-margin-top: 24px; }
.policy article section + section { margin-top: 48px; }
.policy h2 { font-size: clamp(26px, 3vw, 32px); display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.policy h2 .n { color: var(--gold); font: 600 13px/1 var(--sans); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
.policy p, .policy li { color: var(--muted); }
.policy p strong { color: var(--parchment); font-weight: 600; }
.policy ul { padding-left: 0; list-style: none; display: grid; gap: 10px; margin: 18px 0; }
.policy ul li { display: flex; gap: 14px; }
.policy ul li::before { content: ""; flex: none; width: 18px; height: 1px; margin-top: 14px; background: var(--gold); }
.policy a { color: var(--gold); text-underline-offset: 3px; }
.data-table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15px; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.data-table th, .data-table td { text-align: left; padding: 14px 18px; vertical-align: top; }
.data-table th { color: var(--faint); font: 600 11px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; background: var(--ink-2); }
.data-table td { color: var(--muted); border-top: 1px solid var(--line); }
.data-table td:first-child { color: var(--parchment); }

/* Layout: tablet and phone */
@media (max-width: 960px) {
  .hero .wrap, .today, .feature, .sources { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .feature-copy { order: 0; }
  .hero { padding-top: 120px; }
  .hero-bust { width: 90vw; right: -25vw; top: 60px; opacity: 0.28; }
  .today-art { max-width: 420px; order: 2; }
  .authors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .policy { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav a.link { display: none; }
  .phone.lg { --w: 270px; }
  .phone { --w: 240px; }
  .pair .phone { --w: 46vw; --pad: 6px; }
  .pair .phone:last-child { margin-top: 40px; }
  .widgets, .trio, .summary { grid-template-columns: minmax(0, 1fr); }
  .authors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { width: 100%; }
}
