/* Matrix of Love site. Palette and type from the app (Core/Theme/Theme.swift,
   Listen tokens): candlelit night, gold as engraved line, paper for answers. */
@import url("/matrixoflove/site/fonts/fonts.css");

:root {
  --night: #1A120B;
  --night-2: #2B1D12;
  --panel: #3A2818;
  --gold: #D9B264;
  --gold-hi: #E9C98A;
  --gold-deep: #8A611D;
  --cream: #FAF2E3;
  --cream-2: rgba(250, 242, 227, .74);
  --cream-3: rgba(250, 242, 227, .58);
  --parch: #F5ECDC;
  --parch-2: #EFE2CB;
  --paper: #FBF5EA;
  --ink: #2B1D12;
  --ink-2: #6B513A;
  --line-d: rgba(217, 178, 100, .28);
  --line-p: rgba(43, 29, 18, .14);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: Manrope, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gut: clamp(16px, 5vw, 72px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
::selection { background: rgba(217, 178, 100, .38); color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
h1 em, h2 em, .wordmark em, .wheel__q em, .rcard__title em { font-style: italic; font-weight: 400; color: var(--gold-hi); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 2000; background: var(--cream); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 48px; }

/* ---------- masthead */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gut) 0; max-width: 1440px; margin: 0 auto; }
.mast__brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.mast__brand img { border-radius: 10px; box-shadow: 0 0 0 1px var(--line-d); }
.wordmark { font: 500 1.55rem/1 var(--serif); letter-spacing: .005em; }
.pill {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid currentColor; color: var(--gold); text-decoration: none;
  font: 600 .72rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.pill:hover { background: var(--gold); color: var(--night); }
.mast--paper { color: var(--ink); }
.mast--paper .pill { color: var(--gold-deep); }
.mast--paper .pill:hover { background: var(--gold-deep); color: var(--paper); }
.mast--paper .wordmark em { color: var(--gold-deep); }

/* ---------- night fields */
.night { position: relative; background: radial-gradient(120% 70% at 70% 0%, #3b2616 0%, var(--night-2) 38%, var(--night) 100%); }
.night--bottom { background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, var(--night) 100%); }

/* ---------- hero */
.hero {
  max-width: 1440px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gut) clamp(56px, 8vw, 112px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center;
}
.hero h1 { font-size: clamp(3.4rem, 7.2vw, 5.9rem); line-height: .92; letter-spacing: -.01em; }
.hero h1 em { display: block; }
.lede { margin-top: 28px; max-width: 30ch; font-size: clamp(1.08rem, 1.5vw, 1.22rem); color: var(--cream-2); }
.cta { margin-top: 36px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.badge { display: inline-block; line-height: 0; border-radius: 10px; transition: transform .4s var(--ease), opacity .3s; }
.badge img { display: block; width: 150px; height: 50px; }
.badge:hover { transform: translateY(-2px); }
.cta__note { font-size: .92rem; color: var(--cream-3); max-width: 22ch; line-height: 1.45; }
.motto { margin-top: 40px; font: italic 400 1.35rem/1.3 var(--serif); color: var(--gold); display: flex; align-items: center; gap: 14px; }
.motto::before { content: ""; width: 40px; height: 1px; background: currentColor; opacity: .6; }

/* ---------- emotion wheel */
.wheel { position: relative; }
.crumbs { min-height: 36px; margin-bottom: 8px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; justify-content: center; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; color: var(--cream-3); font-size: .85rem; }
.crumbs li + li::before { content: ""; width: 14px; height: 1px; background: var(--line-d); margin-right: 4px; }
.crumbs button {
  font: 500 .85rem/1 var(--sans); color: var(--cream); background: var(--night); border: 1px solid var(--line-d);
  border-radius: 999px; padding: 8px 12px 8px 10px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.crumbs button:hover { border-color: var(--gold); }
.crumbs .dot { width: 9px; height: 9px; }
.wheel__stage { position: relative; width: min(100%, 620px); aspect-ratio: 1; margin: 0 auto; color: var(--gold); }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; stroke-width: 1; vector-effect: non-scaling-stroke; transition: transform 1.2s var(--ease); }
.wheel[data-level="2"] .frame { transform: rotate(22.5deg); }
.wheel[data-level="3"] .frame { transform: rotate(45deg); }
.wheel__center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44%;
  display: grid; justify-items: center; gap: 10px; text-align: center; pointer-events: none;
}
.wheel__center .seal { width: 54px; height: 54px; color: var(--gold); opacity: .9; }
.wheel__q { font: 500 clamp(1.45rem, 2.4vw, 1.95rem)/1.12 var(--serif); color: var(--cream); text-wrap: balance; }
.wheel__step { font-size: .78rem; letter-spacing: .08em; color: var(--cream-3); font-variant-numeric: tabular-nums; }
.ring { position: absolute; inset: 0; }
.ring li { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.chip {
  --c: var(--gold);
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; cursor: pointer;
  font: 500 1.02rem/1 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid rgba(43, 29, 18, .08); border-radius: 999px; padding: 12px 18px 12px 14px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .45s var(--ease), background-color .3s, box-shadow .3s;
}
.chip:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .8), 0 0 0 1px var(--c), inset 0 1px 0 rgba(255,255,255,.7); }
.chip:focus-visible { outline-offset: 4px; }
.dot { display: inline-block; flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(43, 29, 18, .18); }
.ring.is-in li { animation: chipIn .7s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes chipIn { from { opacity: 0; transform: translate(-50%, -50%) translate(var(--fx), var(--fy)) scale(.8); } to { opacity: 1; transform: translate(-50%, -50%); } }
.wheel__note { margin: 14px auto 0; max-width: 46ch; text-align: center; font-size: .86rem; color: var(--cream-3); }

/* reflection card (ReflectionCard.swift: paper, 18px radius, outline button) */
.rcard {
  position: relative; width: min(100%, 420px); margin: 0 auto;
  background: var(--paper); color: var(--ink); border-radius: 18px; padding: 26px 26px 20px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .85), 0 0 0 1px rgba(217, 178, 100, .4), inset 0 1px 0 #fff;
  display: grid; gap: 14px; animation: cardIn .6s var(--ease) both;
}
.rcard[hidden] { display: none; }
.wheel[data-done] .wheel__stage { aspect-ratio: auto; min-height: min(620px, 100vw); display: grid; place-items: center; padding: 32px 0; }
.wheel[data-done] .wheel__center { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.97); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
.rcard__title { font: 500 1.9rem/1.1 var(--serif); color: var(--ink); outline: none; }
.rcard__title em { color: var(--gold-deep); }
.rcard__field { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line-p); }
.rcard__q { font-size: .9rem; font-weight: 600; color: var(--ink); }
.rcard__ph { font: italic 400 1.08rem/1.3 var(--serif); color: var(--ink-2); }
.rcard__safety { background: var(--parch-2); border-radius: 12px; padding: 12px 14px; font-size: .9rem; color: var(--ink); }
.rcard__safety[hidden] { display: none; }
.rcard__st { font-weight: 600; margin-bottom: 2px; }
.rcard__disc { font: italic 400 1rem/1.3 var(--serif); color: var(--ink-2); text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 24px;
  border-radius: 999px; font: 600 .74rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; background: transparent; border: 1.5px solid currentColor;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.btn--ink { color: var(--gold-deep); }
.btn--ink:hover { background: var(--gold-deep); color: var(--paper); }
.btn--quiet { border-color: transparent; color: var(--ink-2); min-height: 36px; }
.btn--quiet:hover { color: var(--ink); }
.btn--gold { color: var(--gold); }
.btn--gold:hover, .btn--gold[aria-pressed="true"] { background: var(--gold); color: var(--night); }

/* ---------- paper field */
.paper {
  position: relative; background: var(--parch); color: var(--ink); color-scheme: light;
  border-radius: 32px 32px 0 0; margin-top: -32px; z-index: 1;
  box-shadow: 0 -20px 50px -30px rgba(0, 0, 0, .9);
}
.paper::before { content: ""; position: absolute; left: var(--gut); right: var(--gut); top: 16px; height: 1px; background: var(--line-p); }
.paper ::selection { background: rgba(138, 97, 29, .24); }
.paper h2 em, .paper h3 em { color: var(--gold-deep); }
.paper :focus-visible { outline-color: var(--gold-deep); }
.sec { max-width: 1440px; margin: 0 auto; padding: clamp(72px, 10vw, 144px) var(--gut); }
.sec h2 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: .98; letter-spacing: -.005em; }
.big { margin-top: 24px; font-size: clamp(1.06rem, 1.4vw, 1.2rem); max-width: 40ch; }
.paper .big { color: var(--ink); }
.fine { margin-top: 20px; font-size: .9rem; max-width: 56ch; color: var(--ink-2); }
.night .fine { color: var(--cream-3); }

.journal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.ticks { margin-top: 32px; display: grid; gap: 16px; max-width: 46ch; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .72em; width: 16px; height: 1px; background: var(--gold-deep); }
.journal__shots { display: flex; justify-content: center; gap: clamp(16px, 3vw, 40px); }
.shot { display: block; width: 300px; border-radius: 26px; background: var(--paper); box-shadow: 0 40px 70px -36px rgba(43, 29, 18, .55), 0 0 0 1px var(--line-p); }
.shot--b { margin-top: 96px; }
.moods { grid-column: 1 / -1; border-top: 1px solid var(--line-p); border-bottom: 1px solid var(--line-p); padding: 26px 0; margin-top: clamp(24px, 4vw, 56px); }
.moods ul { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; }
.moods li { display: inline-flex; align-items: center; gap: 10px; font: italic 400 clamp(1.3rem, 2vw, 1.75rem)/1 var(--serif); color: var(--ink); }

.letter { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 7vw, 120px); align-items: center; padding-top: 0; }
.kinds { margin-top: 32px; border-top: 1px solid var(--line-p); max-width: 520px; }
.kinds li { padding: 14px 0; border-bottom: 1px solid var(--line-p); font: italic 400 1.45rem/1.2 var(--serif); }
.waiting { margin-top: 28px; display: flex; align-items: center; gap: 12px; color: var(--gold-deep); font-weight: 500; }
.waiting .seal { width: 30px; height: 30px; flex: none; animation: turn 24s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

.privacy { padding-top: 0; }
.facts { margin-top: 48px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 48px); }
.facts li { border-top: 1px solid var(--ink); padding-top: 18px; }
.facts h3 { font-size: 1.6rem; line-height: 1.1; }
.facts p { margin-top: 10px; color: var(--ink-2); font-size: .98rem; }

/* ---------- breathe */
.night--bottom { margin-top: -32px; padding-top: 32px; }
.breathe { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.breathe .big { color: var(--cream-2); }
.rhythm { margin-top: 22px; font: italic 400 1.35rem/1.3 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
.breathe .btn { margin-top: 32px; }
.pacer { position: relative; width: min(100%, 520px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
.pacer__rings { position: absolute; inset: 0; }
.pacer__rings span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-d); }
.pacer__rings span:nth-child(2) { inset: 9%; }
.pacer__rings span:nth-child(3) { inset: 18%; border-color: rgba(217, 178, 100, .45); }
.pacer__orb {
  position: absolute; inset: 27%; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(233, 201, 138, .38), rgba(176, 132, 54, .14) 60%, rgba(176, 132, 54, 0) 72%);
  box-shadow: inset 0 0 0 1px rgba(217, 178, 100, .55);
  transform: scale(.72); transition-property: transform; transition-timing-function: cubic-bezier(.45, 0, .55, 1);
}
.pacer[data-phase="inhale"] .pacer__orb { transform: scale(1.18); }
.pacer[data-phase="hold"] .pacer__orb { transform: scale(1.18); }
.pacer[data-phase="exhale"] .pacer__orb { transform: scale(.72); }
.pacer__phase { position: relative; font: 600 .74rem/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold-hi); transform: translateY(-3.4em); }
.pacer__count { position: absolute; font: 400 clamp(4rem, 9vw, 6rem)/1 var(--serif); color: var(--cream); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- matrix / arcana */
.matrix { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding-top: 0; }
.matrix .big { color: var(--cream-2); }
.arcana { position: relative; width: min(100%, 580px); aspect-ratio: 1; margin: 0 auto; color: var(--gold); }
.frame--arc { inset: 9%; width: 82%; height: 82%; opacity: .8; }
.arcana__ring { position: absolute; inset: 0; }
.arcana__ring li { position: absolute; transform: translate(-50%, -50%); }
.arc {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  font: 500 1.15rem/1 var(--serif); color: var(--cream); background: var(--night); border: 1px solid var(--line-d);
  font-variant-numeric: lining-nums tabular-nums; transition: background-color .3s var(--ease), color .3s, border-color .3s;
}
.arc:hover { border-color: var(--gold); }
.arc[aria-pressed="true"] { background: var(--gold); color: var(--night); border-color: var(--gold); }
.arcana__card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52%;
  background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px 22px 24px; text-align: center;
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(217, 178, 100, .45);
}
.arcana__n { font: 500 2.6rem/1 var(--serif); color: var(--gold-deep); font-variant-numeric: lining-nums; }
.arcana__t { margin-top: 6px; font: italic 400 1.5rem/1.1 var(--serif); }
.arcana__i { margin-top: 12px; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.arcana__card.is-new { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: .2; transform: translate(-50%, -47%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------- close + footer */
.close { text-align: center; display: grid; justify-items: center; padding-top: 0; }
.close__icon { border-radius: 27px; box-shadow: 0 0 0 1px var(--line-d), 0 30px 60px -20px rgba(0, 0, 0, .9); margin-bottom: 32px; }
.close .big { color: var(--cream-2); max-width: 56ch; }
.badge--close { margin-top: 36px; }
.close .fine { margin-left: auto; margin-right: auto; }
.foot { border-top: 1px solid var(--line-d); max-width: 1440px; margin: 0 auto; padding: 40px var(--gut) 48px; display: grid; gap: 12px; justify-items: center; text-align: center; color: var(--cream-2); }
.foot__docs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.foot__docs li + li::before { content: "·"; padding: 0 12px; color: var(--cream-3); }
.foot a { color: var(--cream); text-decoration: underline; text-decoration-color: var(--line-d); text-underline-offset: 4px; }
.foot a:hover { text-decoration-color: var(--gold); }
.foot__mail a { font: italic 400 1.4rem/1.2 var(--serif); color: var(--gold-hi); }
.foot__small { font-size: .85rem; color: var(--cream-3); }

/* ---------- documents (Read surfaces: parchment, the app's light theme) */
body.doc { background: var(--parch); color: var(--ink); color-scheme: light; }
body.doc ::selection { background: rgba(138, 97, 29, .24); }
body.doc :focus-visible { outline-color: var(--gold-deep); }
.doc__main { max-width: 1440px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gut) clamp(64px, 8vw, 112px); }
.prose { max-width: 68ch; margin: 0 auto; font-size: 1.04rem; }
.prose h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; margin-bottom: 28px; }
.prose h2 { font-size: 1.85rem; line-height: 1.15; margin: 52px 0 14px; padding-top: 22px; border-top: 1px solid var(--line-p); }
.prose h3 { font: 600 1rem/1.4 var(--sans); margin: 28px 0 8px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 0; }
.prose li { position: relative; padding-left: 26px; margin: 8px 0; }
.prose li::before { content: ""; position: absolute; left: 0; top: .8em; width: 12px; height: 1px; background: var(--gold-deep); }
.prose a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose code { font: inherit; }
.prose .meta { color: var(--ink-2); font-size: .95rem; }
.prose strong { font-weight: 600; }
body.doc .foot { background: var(--night); max-width: none; color: var(--cream-2); }

/* ---------- responsive */
@media (max-width: 1080px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(20px, 3vw, 48px); }
}
@media (max-width: 900px) {
  .hero, .journal, .breathe, .matrix { grid-template-columns: minmax(0, 1fr); }
  .hero h1 em { display: inline; }
  .lede { max-width: 34ch; }
  .letter { grid-template-columns: minmax(0, 1fr); }
  .letter .shot { order: 2; margin: 0 auto; }
  .breathe .pacer { order: 2; }
  .moods ul { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .mast { padding-top: 16px; }
  .mast .pill { display: none; }
  .wordmark { font-size: 1.35rem; }
  .hero { padding-top: 28px; gap: 36px; }
  .cta { gap: 12px 16px; }
  .motto { margin-top: 28px; font-size: 1.2rem; }
  .wheel__stage { aspect-ratio: 1 / 1.12; }
  .wheel__center { width: 54%; }
  .wheel__center .seal { width: 38px; height: 38px; }
  .wheel__q { font-size: 1.28rem; }
  .chip { font-size: .9rem; padding: 10px 13px 10px 11px; gap: 7px; }
  .dot { width: 9px; height: 9px; }
  .rcard { padding: 20px 18px 16px; gap: 11px; }
  .wheel[data-done] .wheel__stage { padding: 20px 0; }
  .rcard__title { font-size: 1.6rem; }
  .journal__shots { gap: 0; justify-content: flex-start; }
  .shot--a { width: 66%; position: relative; z-index: 1; }
  .shot--b { width: 58%; margin: 72px 0 0 -24%; border-radius: 22px; }
  .letter .shot { width: min(300px, 78%); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .arc { width: 34px; height: 34px; font-size: 1rem; }
  .arcana__card { width: 60%; padding: 14px 12px 16px; }
  .arcana__n { font-size: 2rem; }
  .arcana__t { font-size: 1.2rem; }
  .arcana__i { font-size: .82rem; line-height: 1.4; margin-top: 8px; }
  .foot__docs li + li::before { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.breathe { padding-top: clamp(56px, 7vw, 104px); padding-bottom: clamp(48px, 6vw, 88px); }
