/* Secondary public pages: integrity, privacy, terms, 404, and the brand layer of the sign-in screens. */
@keyframes p-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes p-fade { from { opacity: 0; } }
@keyframes rise-y { from { transform: translate3d(0, 16px, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { from { opacity: .78; transform: scale(.95); } to { opacity: 1; transform: scale(1.04); } }
.p-rise { animation: p-rise .95s var(--ease-out) backwards; }
.p-rise:nth-child(2) { animation-delay: .08s; } .p-rise:nth-child(3) { animation-delay: .16s; } .p-rise:nth-child(4) { animation-delay: .24s; }
/* The title and subtitle are the LCP candidates: they move in but are never invisible. The kicker and CTA row keep the fade. */
.p-title.p-rise, .p-sub.p-rise { animation-name: rise-y; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.on-ink .btn-quiet { background: transparent; border-color: rgba(255, 255, 255, .18); color: var(--night-fg); }
.on-ink .btn-quiet:hover { background: rgba(255, 255, 255, .07); color: var(--night-fg); }
.on-ink .btn-primary { background: #5b52f0; }
.on-ink .btn-primary:hover { background: #4f46e5; }
.on-ink :focus-visible { outline-color: var(--night-brand); }

/* ---------- the swirl stage (same layers as the home page) ---------- */
.hero-stage { position: relative; aspect-ratio: 1; animation: p-fade 1.4s ease .1s backwards; }
.hs-scroll, .hs-tilt, .hs-words, .hs-light { position: absolute; }
.hs-scroll { inset: 0; will-change: transform; }
.hs-light { inset: -24%; pointer-events: none; background: radial-gradient(closest-side, rgba(176, 166, 255, .42), rgba(176, 166, 255, 0) 38%), radial-gradient(closest-side, rgba(104, 96, 245, .5), rgba(91, 82, 240, .16) 52%, rgba(91, 82, 240, 0) 76%); animation: breathe 9s ease-in-out infinite alternate; }
.hs-tilt { inset: 8%; will-change: transform; }
.hs-tilt picture, .auth-swirl picture { display: block; width: 100%; height: 100%; }
.hs-swirl { width: 100%; height: 100%; animation: spin 96s linear infinite; will-change: transform; }
.hs-words { inset: -4%; pointer-events: none; }
.vw { position: absolute; left: 0; top: 0; font: 500 12.5px/1 var(--mono); color: rgba(245, 245, 242, .82); white-space: nowrap; opacity: 0; will-change: transform, opacity; }
.vw-hi { color: #b1b3ff; }

/* ---------- page hero ---------- */
.p-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(36px, 6vw, 72px) 0 clamp(40px, 6vw, 72px); }
.p-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 80% at 80% 50%, rgba(91, 82, 240, .16), transparent 70%); }
.p-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.p-stage { width: min(100%, 420px); justify-self: center; }
.p-title { font-size: clamp(2.5rem, 5.4vw, 4.6rem); line-height: .99; letter-spacing: -.047em; max-width: 13ch; text-wrap: balance; }
.p-sub { margin-top: 22px; font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.55; color: var(--night-fg-2); max-width: 46ch; }

/* ---------- bands ---------- */
.p-band { padding: clamp(60px, 8vw, 104px) 0; }
.p-tint { background: var(--sunken); }
.p-head { margin-bottom: 28px; }
.p-h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.04; letter-spacing: -.037em; max-width: 18ch; text-wrap: balance; }
.p-lead { margin-top: 14px; color: var(--fg-2); font-size: 1.06rem; line-height: 1.55; max-width: 40ch; }
.p-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.p-split .p-head { position: sticky; top: calc(var(--nav-h) + 28px); margin: 0; }

.habits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-3); }
.habit { padding: 22px 24px 8px 0; display: grid; align-content: start; gap: 10px; }
.habit + .habit { padding-left: 24px; border-left: 1px solid var(--line-2); }
.habit-n { font-size: 12.5px; color: var(--brand-fg); letter-spacing: .06em; }
.habit h3 { font-size: 1.3rem; letter-spacing: -.025em; }
.habit p { color: var(--fg-2); line-height: 1.58; }

.refuse { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-3); }
.refuse li { padding: 18px 0 18px 34px; border-bottom: 1px solid var(--line-2); position: relative; color: var(--fg-2); line-height: 1.55; }
.refuse li::before { content: "✕"; position: absolute; left: 2px; top: 19px; font: 500 14px/1.55 var(--mono); color: var(--bad); }
.refuse b { color: var(--fg); font-family: var(--display); font-weight: 700; letter-spacing: -.015em; font-size: 1.08rem; }

.ck-progress { margin-top: 22px; font-size: 14px; color: var(--fg-3); }
.ck-progress b { font-family: var(--display); font-size: 2.2rem; color: var(--fg); letter-spacing: -.03em; margin-right: 2px; text-align: right; }
.ck-meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 10px; max-width: 320px; }
.ck-meter i { display: block; height: 100%; background: var(--ok); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease-out); }
.ck-done { margin-top: 14px; color: var(--ok); font-weight: 600; animation: p-rise .5s var(--ease-out); }
.ck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ck-list label { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); cursor: pointer; font-size: 1.04rem; transition: border-color .2s ease, background-color .2s ease, transform .16s var(--ease-out); }
.ck-list label:active { transform: scale(.99); }
.ck-list input { appearance: none; -webkit-appearance: none; margin: 0; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-3); background: var(--bg); display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.ck-list input::after { content: ""; width: 11px; height: 6px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(.6); opacity: 0; transition: transform .25s var(--ease-out), opacity .2s ease; }
.ck-list input:checked { background: var(--ok); border-color: var(--ok); }
.ck-list input:checked::after { opacity: 1; transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.ck-list input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ck-list .is-checked label { border-color: color-mix(in srgb, var(--ok) 45%, var(--line-2)); background: color-mix(in srgb, var(--ok-tint) 55%, var(--surface)); }
@media (hover: hover) and (pointer: fine) { .ck-list label:hover { border-color: var(--line-3); } }

.quote-box { margin: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: clamp(22px, 3vw, 32px); }
.quote-box blockquote { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.35; letter-spacing: -.02em; color: var(--fg); border-left: 3px solid var(--brand); padding-left: 18px; }
.quote-box figcaption { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.say-ok { color: var(--ok); font-weight: 600; font-size: 14px; animation: p-rise .3s var(--ease-out); }

.p-cta { padding: clamp(64px, 8vw, 104px) 0; text-align: center; position: relative; overflow: hidden; }
.p-cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 70% at 50% 100%, rgba(91, 82, 240, .22), transparent 70%); pointer-events: none; }
.p-cta-in { position: relative; display: grid; justify-items: center; gap: 16px; }
.p-cta .p-h2 { max-width: 16ch; }
.p-cta .cta-row { justify-content: center; margin-top: 8px; }

/* ---------- 404 ---------- */
.nf { position: relative; overflow: hidden; isolation: isolate; min-height: min(calc(100svh - var(--nav-h)), 1000px); display: grid; align-content: center; justify-items: center; text-align: center; padding: 32px 0 64px; }
.nf::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 50% at 50% 34%, rgba(91, 82, 240, .16), transparent 70%); }
.nf-stage { width: min(70vw, 380px); margin-bottom: 8px; }
.nf-copy { display: grid; justify-items: center; }
.nf .p-title { max-width: 15ch; font-size: clamp(2.2rem, 4.6vw, 3.8rem); }
.nf .p-sub { margin-inline: auto; }
.nf .cta-row { justify-content: center; margin-top: 28px; }

/* ---------- privacy and terms ---------- */
.legal-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px); position: relative; overflow: hidden; isolation: isolate; }
.legal-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 90% at 90% 0%, rgba(91, 82, 240, .18), transparent 70%); }
.legal-hero .updated { margin-top: 14px; color: var(--night-fg-2); font-size: 14px; }
.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding: clamp(36px, 5vw, 64px) 0 clamp(64px, 8vw, 104px); }
.toc { position: sticky; top: calc(var(--nav-h) + 28px); align-self: start; }
.toc-h { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc-list a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--fg-3); text-decoration: none; font-size: 14px; line-height: 1.35; transition: color .2s ease, border-color .2s ease; }
.toc-list a:hover { color: var(--fg); }
.toc-list a.is-on { color: var(--fg); border-left-color: var(--brand); }
.legal { max-width: 72ch; }
.legal h2 { font-size: 1.4rem; margin: 40px 0 12px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.legal h2:first-of-type { margin-top: 28px; }
.legal p, .legal li { color: var(--fg-2); line-height: 1.68; }
.legal p { margin-bottom: 12px; }
.legal ul { padding-left: 22px; display: grid; gap: 8px; margin: 0 0 12px; }
.legal li::marker { color: var(--brand-fg); }
.legal b { color: var(--fg); }

/* ---------- sign in / sign up (layout from app.css; this is the brand layer) ---------- */
.auth-body { background: var(--bg); }
.auth-grid { min-height: min(100svh, 1100px); }
.auth-side { background: var(--ink); justify-content: flex-start; gap: 0; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 50% at 50% 42%, rgba(91, 82, 240, .2), transparent 70%); pointer-events: none; }
.auth-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-side .auth-top .btn-ghost { align-self: center; }
.auth-side .logo-wm small { font-family: var(--display); font-weight: 500; font-size: .84em; letter-spacing: -.02em; color: var(--night-fg); opacity: .62; }
.auth-swirl { position: relative; width: min(68%, 340px); aspect-ratio: 1; margin: clamp(24px, 6vh, 64px) auto clamp(20px, 4vh, 40px); }
.auth-swirl img { position: relative; width: 100%; height: 100%; animation: spin 96s linear infinite, p-fade 1.4s ease backwards; }
.auth-light { position: absolute; inset: -30%; background: radial-gradient(closest-side, rgba(176, 166, 255, .38), rgba(104, 96, 245, .2) 48%, transparent 76%); animation: breathe 9s ease-in-out infinite alternate; }
.auth-pitch { position: relative; margin-top: auto; }
.auth-pitch h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); max-width: 16ch; text-wrap: balance; color: var(--night-fg); }
.auth-pitch li { font-size: 15px; }
.auth-card h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); letter-spacing: -.035em; }
.auth-card { animation: p-rise .8s var(--ease-out) .05s backwards; }
.auth-honest { margin-top: 4px; }

@media (max-width: 980px) {
  .habits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit:nth-child(3) { padding-left: 0; border-left: 0; }
  .habit:nth-child(n+3) { border-top: 1px solid var(--line-2); margin-top: 8px; }
  .p-split { grid-template-columns: minmax(0, 1fr); }
  .p-split .p-head { position: static; }
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .auth-swirl { width: 120px; margin: 8px auto 4px; }
  .auth-pitch { margin-top: 8px; }
  .auth-pitch h2 { font-size: 1.5rem; }
}
@media (max-width: 760px) {
  .p-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .p-stage { order: -1; width: min(62vw, 240px); margin-bottom: -4px; }
}
@media (max-width: 640px) {
  .habits { grid-template-columns: minmax(0, 1fr); }
  .habit, .habit + .habit { padding: 18px 0 10px; border-left: 0; }
  .habit + .habit { border-top: 1px solid var(--line-2); }
  .habit:nth-child(n+3) { margin-top: 0; }
}

/* Pages with one article per language show only the chosen one. */
[data-doc-lang][hidden] { display: none; }
/* Cookie table. */
.legal-table { margin: 6px 0 14px; overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.legal th, .legal td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-1); color: var(--fg-2); line-height: 1.55; }
.legal thead th { font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); background: var(--sunken); }
.legal tbody tr:last-child th, .legal tbody tr:last-child td { border-bottom: 0; }
.legal tbody th { font-weight: 400; width: 1%; white-space: nowrap; color: var(--fg); }
.legal code { font: 500 .88em/1 var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--sunken); color: var(--fg); }

/* Narrow screens: each cookie becomes a small card instead of a table that scrolls sideways. */
@media (max-width: 640px) {
  .legal-table { overflow: visible; border: 0; }
  .legal table, .legal tbody, .legal tr, .legal th, .legal td { display: block; min-width: 0; width: auto; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal tbody tr { margin: 0 0 12px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
  .legal tbody th code { white-space: nowrap; }
  .legal tbody th { padding: 12px 14px 8px; white-space: normal; background: var(--sunken); border-bottom: 1px solid var(--line-1); }
  .legal tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-1); }
  .legal tbody td:last-child { border-bottom: 0; }
  .legal tbody td::before { content: attr(data-label); display: block; margin-bottom: 2px; font: 500 11.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
}

/* ---------- Sign in with Google (follows Google's button guidelines: white or dark surface, the four-colour G, no recolouring) ---------- */
.oauth { display: grid; gap: 12px; margin: 4px 0 6px; }
.btn-google { --g-bg: #ffffff; --g-fg: #1f1f1f; --g-line: #747775; --g-hover: #f2f2f2;
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 16px; border: 1px solid var(--g-line); border-radius: 10px; background: var(--g-bg); color: var(--g-fg); font: 500 15px/1 var(--body); text-decoration: none; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease; }
.btn-google:hover { background: var(--g-hover); }
.btn-google:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.btn-google .g-logo { flex: none; width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-google { --g-bg: #131314; --g-fg: #e3e3e3; --g-line: #8e918f; --g-hover: #1f2021; } }
:root[data-theme="dark"] .btn-google { --g-bg: #131314; --g-fg: #e3e3e3; --g-line: #8e918f; --g-hover: #1f2021; }
.oauth-terms { margin: -2px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg-3); text-align: center; }
.oauth-terms a { color: var(--fg-2); text-underline-offset: 3px; }
.oauth-or { display: flex; align-items: center; gap: 12px; margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.oauth-or::before, .oauth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
