/* Rituals — web home. Mirrors the app: ivory paper, warm ink, serif voice, bento tiles.
   ui-serif resolves to New York on Apple devices (the app's typeface); Georgia elsewhere. */

:root {
  /* Noir + champagne gold: the brand's signature look, same as the app. */
  color-scheme: dark;
  --paper: #0b0a09;
  --card: #171512;
  --ink: #ede6da;
  --muted: rgba(237, 230, 218, 0.6);
  --hairline: rgba(237, 230, 218, 0.12);
  --gold: #d9bf8c;
  --gold-rim: rgba(217, 191, 140, 0.32);
  --gold-grad: linear-gradient(135deg, #f3e4bd 0%, #d8bb80 50%, #ad8646 100%);
  --on-gold: #1a140b;
  --shadow: 0 0 0 1px var(--gold-rim), 0 10px 30px rgba(0, 0, 0, 0.35);
  --ochre: #c49a45;
  --sage: #8a9a7b;
  --slate: #5e6e7e;
  --plum: #7a5470;
  --radius: 24px;       /* tile */
  --pad: 22px;          /* tile padding */
  --inner: 8px;         /* nested radius = 24 - 16 */
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(900px 520px at 50% -120px, rgba(216, 187, 128, 0.12), transparent 70%) no-repeat, var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom));
}

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.brand span { font: 400 15px/1 var(--serif); letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.nav { display: flex; gap: 6px; }
.nav a {
  font-size: 15px; text-decoration: none; padding: 10px 12px; min-height: 44px;
  display: inline-flex; align-items: center; border-radius: 999px;
}
.nav a:hover { background: var(--hairline); color: var(--ink); }

/* Type */
.label {
  font: 600 11px/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(42px, 8vw, 76px); line-height: 1.02; letter-spacing: -.015em; }
h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
.lede { font-family: var(--serif); font-size: clamp(19px, 2.4vw, 22px); color: var(--muted); max-width: 34ch; }
.muted { color: var(--muted); }
.num { font-family: var(--serif); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }

/* Bento */
.bento { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.hero { padding: 32px 26px; gap: 22px; box-shadow: 0 0 0 1px var(--gold-rim), 0 0 60px rgba(216, 187, 128, 0.10); }
.tile .grow { flex: 1; }

@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .span-4 { grid-column: span 4; }
  .span-3 { grid-column: span 3; }
  .span-2 { grid-column: span 2; }
  .span-1 { grid-column: span 1; }
  .hero { padding: 48px 44px; }
}

/* Ritual ring mark */
.ring {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  border: 2px solid var(--c, var(--ink)); color: var(--c, var(--ink));
  font: 20px/1 var(--serif);
}
.ring.kept { background: var(--c); color: var(--paper); box-shadow: 0 0 14px var(--c); }
.rings { display: flex; gap: 10px; flex-wrap: wrap; }

.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hairline); }
.dots i.on { background: var(--c, var(--ink)); }

.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 64px; max-width: 220px; }
.bars i { flex: 0 0 12px; border-radius: 999px; background: var(--hairline); position: relative; height: 100%; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: auto 0 0 0; height: var(--h); background: var(--ink); opacity: .32; border-radius: 999px; }
.bars i.today::after { opacity: 1; background: var(--gold-grad); }

/* Badge / button */
.badge {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  background: var(--gold-grad); color: var(--on-gold); border-radius: 999px;
  padding: 0 24px; min-height: 52px; font: 600 16px/1 var(--sans);
  box-shadow: 0 6px 24px rgba(216, 187, 128, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Long-form documents (privacy, support) */
.doc { max-width: 680px; }
.doc h1 { font-size: clamp(38px, 6vw, 56px); margin-bottom: 14px; }
.doc h2 { font-size: 24px; margin: 38px 0 10px; }
.doc p, .doc li { color: var(--ink); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 20px; margin: 10px 0 0; }
.doc li + li { margin-top: 6px; }
.doc .tile { margin-top: 18px; }

/* Footer */
footer {
  margin-top: 40px; padding: 22px 4px 0; border-top: 1px solid var(--gold-rim);
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
  font-size: 14px; color: var(--muted);
}
footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer a { display: inline-flex; min-height: 44px; align-items: center; }
