/* Just Mate. landing — styles
   Tokens follow 05_design_system.md (dark mode, primary). No shadows; elevation is surface shift only.
   Motion: fades (≤10px rise), 180–600ms. Nothing bounces. */

@property --room {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

:root {
  --bg: #1A1B17;
  --s1: #232420;
  --s2: #2D2E2A;
  --ink: #0F100E;

  --brand: #4D5D2C;
  --brand-tint: #C8D49C;
  --brand-soft: #7E8F4F;

  --t1: #E8E6DD;
  --t2: #9A988F;
  --t3: #66645C;

  --atticus: #B8B0A2;
  --iris: #D67861;
  --theo: #7B9DD6;
  --hugo: #A8C49A;

  --b1: rgba(255,255,255,.06);
  --b2: rgba(255,255,255,.12);
  --b3: rgba(255,255,255,.22);

  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 22px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --wrap: 1120px;
  --gutter: 16px;
  --room: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain: the "slightly weathered" surface */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
strong { font-weight: 500; }
svg { display: block; }

.wrap {
  width: min(var(--wrap), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip {
  position: absolute; left: 16px; top: -48px;
  padding: 8px 12px; background: var(--s2); border-radius: var(--r-md);
  z-index: 100;
}
.skip:focus { top: 12px; }

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

/* ---------- Type ---------- */
.display, .display-2, .wordmark {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
}
.display { font-size: clamp(2.5rem, 6.2vw, 4.9rem); line-height: 1.02; }
.display-2 { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.06; }
.display em, .display-2 em { color: var(--brand-tint); }

.eyebrow {
  font-size: 13px; color: var(--t2); letter-spacing: .02em;
  margin-bottom: 20px;
}
.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--t2); max-width: 36rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 0%, transparent);
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--b1);
}
.nav-inner { display: flex; align-items: center; gap: 24px; }
.wordmark { font-size: 1.5rem; line-height: 1; }
.wordmark-dot { color: var(--brand-soft); }
.wordmark-sm { font-size: 1.25rem; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; font-size: 15px; color: var(--t2); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--t1); }
.nav .btn { margin-left: auto; }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 500; line-height: 1.2;
  border: 1px solid transparent;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn-primary { background: var(--brand); color: var(--brand-tint); }
.btn-primary:hover { background: #45532a; }
.btn-sm { padding: 9px 14px; font-size: 14px; }

.btn-store {
  background: var(--s1); border-color: var(--b2); color: var(--t1);
  padding: 10px 16px 10px 14px;
}
.btn-store:hover { border-color: var(--b3); background: var(--s2); }
.btn-store span { display: flex; flex-direction: column; font-size: 15px; }
.btn-store small { font-size: 11px; color: var(--t2); font-weight: 400; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cta-center { justify-content: center; }

/* ---------- Reveal (fade only + small rise) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(10px);
  transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 8vh, 96px) 0 clamp(48px, 8vh, 96px); }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.hero-copy h1 { max-width: 13ch; }
.hero-copy .lede { margin-top: 24px; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--t3); }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: none; }
}

/* ---------- Demo (conversation playback) ---------- */
.demo {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 26px;
  overflow: hidden;
  width: min(100%, 400px);
  justify-self: end;
  display: flex; flex-direction: column;
}
@media (max-width: 880px) { .demo { justify-self: start; width: min(100%, 440px); } }

.demo-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--b1);
  background: color-mix(in srgb, var(--atticus) 5%, var(--s1));
}
.demo-who { display: flex; flex-direction: column; line-height: 1.25; }
.demo-name { font-size: 15px; font-weight: 500; }
.demo-tag { font-size: 12px; color: var(--t2); }
.demo-when { margin-left: auto; text-align: right; display: flex; flex-direction: column; line-height: 1.25; }
.demo-day { font-size: 13px; color: var(--t1); transition: opacity .25s; }
.demo-day.swap { opacity: 0; }
.demo-time { font-size: 12px; color: var(--t3); }

.avatar {
  width: 38px; height: 38px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px;
  background: var(--bg); color: var(--ac, var(--atticus));
  box-shadow: inset 0 0 0 1.5px var(--ac, var(--atticus)); /* ring, not elevation */
}
.avatar-xs { width: 22px; height: 22px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 27px; }
.avatar-atticus { --ac: var(--atticus); }
.avatar-iris { --ac: var(--iris); }
.avatar-theo { --ac: var(--theo); }
.avatar-hugo { --ac: var(--hugo); }

.thread {
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  height: 400px; overflow-y: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px);
          mask-image: linear-gradient(to bottom, transparent, #000 18px);
  transition: opacity .6s var(--ease);
}
.thread::-webkit-scrollbar { display: none; }
.thread.fade { opacity: 0; }

.msg {
  max-width: 82%; padding: 11px 14px; font-size: 15px; line-height: 1.5;
  transition: opacity .18s ease-out;
}
.msg-mate {
  align-self: flex-start;
  background: var(--s2); color: var(--t1);
  border-left: 2px solid var(--atticus);
  border-radius: 0 14px 14px 14px;
}
.msg-user {
  align-self: flex-end;
  background: var(--brand); color: var(--brand-tint);
  border-radius: 14px 14px 0 14px;
}
.msg em { color: var(--t2); }
.msg.past { opacity: .5; }

/* Playback: with JS, steps hide until played. Without JS, everything shows. */
.js .thread [data-step] { display: none; }
.js .thread [data-step].show { display: flex; }
.js .thread .msg[data-step].show { display: block; animation: arrive .18s ease-out; }
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }

.typing {
  display: none; align-items: center; gap: 4px;
  padding: 12px 14px; background: var(--s2); border-radius: 0 14px 14px 14px;
  border-left: 2px solid var(--atticus); align-self: flex-start;
}
.typing.show { display: flex; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--t2); animation: dots .6s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Time passing: a rule drawn from the centre outward */
.timejump {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  font-size: 12px; color: var(--t3); padding: 6px 0;
}
.timejump::before, .timejump::after {
  content: ''; flex: 1; height: 1px; background: var(--b3);
  transform: scaleX(0); transition: transform 1.4s var(--ease);
}
.timejump::before { transform-origin: right; }
.timejump::after { transform-origin: left; }
.timejump.show::before, .timejump.show::after { transform: scaleX(1); }
.timejump span { opacity: 0; transition: opacity .6s .6s; }
.timejump.show span { opacity: 1; }
html:not(.js) .timejump::before, html:not(.js) .timejump::after { transform: none; }
html:not(.js) .timejump span { opacity: 1; }

/* Check-in chip: the visual signature of the mechanic */
.chip {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--r-lg);
  background: var(--s2);
  border: 1px solid color-mix(in srgb, var(--atticus) 22%, transparent);
  color: var(--atticus);
  align-self: stretch;
  transition: opacity .24s ease;
}
.chip-text { display: flex; flex-direction: column; line-height: 1.3; color: var(--t1); }
.chip-text strong { font-size: 15px; }
.chip-text small { font-size: 13px; color: var(--t2); }
.js .thread .chip.show { animation: arrive .24s ease; }

.composer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--b1);
  position: relative;
}
.composer-text, .composer-placeholder {
  flex: 1; min-height: 44px; padding: 11px 16px;
  border: 1px solid var(--b2); border-radius: var(--r-xl); background: var(--bg);
  font-size: 15px; line-height: 1.4; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.composer-placeholder { color: var(--t3); position: absolute; left: 14px; right: 66px; }
.composer-text:not(:empty) + .composer-placeholder { opacity: 0; }
.js .composer-text.typing-on::after {
  content: ''; display: inline-block; width: 1px; height: 1em; background: var(--t2);
  vertical-align: -2px; margin-left: 1px; animation: caret 1s steps(2) infinite;
}
@keyframes caret { to { opacity: 0; } }
.send {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: var(--t1);
  opacity: .5; transition: opacity .18s;
}
.send.on { opacity: 1; }

/* ---------- How it works: the rail is the week ---------- */
.how { padding: clamp(72px, 12vh, 140px) 0; border-top: 1px solid var(--b1); }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 8vw, 120px); align-items: start; }
.how-intro { position: sticky; top: 120px; }
.how-intro p { margin-top: 24px; color: var(--t2); max-width: 32rem; }
.how-hint { font-size: 13px; color: var(--t3) !important; }
@media (max-width: 880px) {
  .how-grid { grid-template-columns: 1fr; }
  .how-intro { position: static; }
}

.how-steps { position: relative; padding-left: 40px; }
.rail {
  position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px;
  background: var(--b2);
}
.rail-fill {
  position: absolute; inset: 0;
  background: var(--brand-tint);
  transform-origin: top; transform: scaleY(0);
  will-change: transform;
}
.step { padding: 12px 0 clamp(80px, 16vh, 180px); position: relative; }
.step-last { padding-bottom: 12px; }
.step-day { font-size: 13px; color: var(--t2); display: flex; align-items: center; gap: 14px; position: relative; }
.marker {
  position: absolute; left: -40px; top: 50%;
  width: 15px; height: 15px; border-radius: 50%; margin-top: -7.5px;
  background: var(--bg); border: 1px solid var(--b3);
  transition: border-color .4s, background .4s;
}
.marker::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--brand-tint); opacity: 0; transition: opacity .4s;
}
.step.lit .marker { border-color: var(--brand-tint); }
.step.lit .marker::after { opacity: 1; }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.1; margin-top: 14px; }
.step p + p, .step h3 + p { margin-top: 12px; color: var(--t2); max-width: 30rem; }
.chip-static { max-width: 360px; margin-top: 22px; }
.js [data-rail-chip] { opacity: 0; transition: opacity .6s var(--ease) .2s; }
.js .step.lit [data-rail-chip] { opacity: 1; }
html:not(.js) .rail-fill { transform: none; }
html:not(.js) .marker::after { opacity: 1; }

/* ---------- Memory: the ledger ---------- */
.memory { padding: clamp(72px, 12vh, 140px) 0; border-top: 1px solid var(--b1); }
.memory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 8vw, 120px); align-items: center; }
.memory-copy p { margin-top: 24px; color: var(--t2); max-width: 32rem; }
.memory-copy p + p { margin-top: 16px; }
@media (max-width: 880px) { .memory-grid { grid-template-columns: 1fr; } }

.ledger {
  background: var(--s1); border: 1px solid var(--b2); border-radius: 20px;
  padding: 18px 18px 20px;
  max-width: 460px; justify-self: end; width: 100%;
}
@media (max-width: 880px) { .ledger { justify-self: start; } }
.ledger-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--t2); padding-bottom: 12px; border-bottom: 1px solid var(--b1); }
.ledger-list li {
  padding: 12px 0; border-bottom: 1px solid var(--b1);
  font-size: 15px; display: flex; gap: 12px; align-items: baseline;
}
.ledger-list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-soft); flex: none; position: relative; top: -2px; }
.ledger-checkin { padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.ledger-checkin .chip-static { margin-top: 0; max-width: none; }
.msg-static { max-width: 90%; }
mark {
  background: none; color: inherit;
  background-image: linear-gradient(var(--brand-tint), var(--brand-tint));
  background-repeat: no-repeat; background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size .7s var(--ease) 1.1s;
  padding-bottom: 1px;
}
[data-reveal].in mark, html:not(.js) mark { background-size: 100% 1.5px; }

/* ---------- The mates: the room ---------- */
.mates { padding: clamp(72px, 12vh, 140px) 0; border-top: 1px solid var(--b1); position: relative; }
.mates::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--room);
  opacity: .07;
  transition: background .7s var(--ease);
}
.mates .wrap { position: relative; }
.mates-intro { max-width: 40rem; }
.mates-intro p { margin-top: 24px; color: var(--t2); }
.mate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 48px; }
@media (max-width: 1000px) { .mate-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mate-grid { grid-template-columns: 1fr; } }

.mate {
  background: var(--s1); border: 1px solid var(--b1); border-radius: 20px;
  padding: 22px 20px 24px;
  transition: border-color .35s var(--ease), background .35s var(--ease);
  cursor: default;
}
.mate:hover, .mate:focus-visible, .mate.active { border-color: color-mix(in srgb, var(--ac) 45%, transparent); }
.mate[data-accent="atticus"] { --ac: var(--atticus); }
.mate[data-accent="iris"] { --ac: var(--iris); }
.mate[data-accent="theo"] { --ac: var(--theo); }
.mate[data-accent="hugo"] { --ac: var(--hugo); }
.mate-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status { font-size: 12px; color: var(--t3); padding: 4px 9px; border: 1px solid var(--b1); border-radius: 999px; }
.status-live { color: var(--brand-tint); border-color: color-mix(in srgb, var(--brand-tint) 35%, transparent); }
.mate h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.1; margin-top: 22px; }
.mate-tag { margin-top: 8px; font-size: 14px; color: var(--ac); }
.mate-problems { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.mate-problems li { font-size: 14px; color: var(--t2); line-height: 1.45; padding-left: 14px; position: relative; }
.mate-problems li::before { content: ''; position: absolute; left: 0; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: var(--t3); }

/* ---------- Openly AI ---------- */
.openly { padding: clamp(72px, 12vh, 140px) 0; border-top: 1px solid var(--b1); }
.openly-inner { max-width: 44rem; }
.openly p:not(.eyebrow) { margin-top: 24px; color: var(--t2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.openly p + p:not(.eyebrow) { margin-top: 16px; }

/* ---------- Pricing ---------- */
.pricing { padding: clamp(72px, 12vh, 140px) 0; border-top: 1px solid var(--b1); }
.pricing-intro { max-width: 40rem; }
.pricing-intro p { margin-top: 24px; color: var(--t2); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan {
  background: var(--s1); border: 1px solid var(--b1); border-radius: 20px;
  padding: 24px 22px 26px; position: relative;
}
.plan-best { border: 1.5px solid var(--brand-tint); }
.plan-badge {
  position: absolute; top: -11px; right: 18px;
  font-size: 12px; font-weight: 500; color: var(--bg);
  background: var(--brand-tint); border-radius: 999px; padding: 3px 10px;
}
.plan-name { font-size: 14px; color: var(--t2); }
.plan-price { font-family: var(--serif); font-size: 2.6rem; line-height: 1; margin-top: 14px; }
.plan-price span { font-family: var(--sans); font-size: 14px; color: var(--t2); margin-left: 6px; }
.plan-note { margin-top: 12px; font-size: 14px; color: var(--t3); }
.plan-features { margin-top: 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; max-width: 46rem; }
@media (max-width: 720px) { .plan-features { grid-template-columns: 1fr; } }
.plan-features li { font-size: 15px; color: var(--t2); padding-left: 16px; position: relative; }
.plan-features li::before { content: ''; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-soft); }

/* ---------- Final CTA ---------- */
.get { padding: clamp(96px, 16vh, 180px) 0; border-top: 1px solid var(--b1); text-align: center; }
.get-inner { max-width: 44rem; margin-inline: auto; }
.get .lede { margin: 22px auto 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--b1); padding: 36px 0 44px; }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-made { font-size: 13px; color: var(--t3); max-width: 34rem; }
.footer-made a { color: var(--t2); border-bottom: 1px solid var(--b2); }
.footer-links { margin-left: auto; display: flex; gap: 18px; font-size: 13px; color: var(--t2); }
.footer-links a:hover { color: var(--t1); }
@media (max-width: 640px) { .footer-links { margin-left: 0; } }

/* ---------- Reduced motion: final states, no playback ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .thread [data-step] { display: block; animation: none; }
  .js .thread .chip[data-step], .js .thread .timejump[data-step] { display: flex; }
  .timejump::before, .timejump::after { transform: none; transition: none; }
  .timejump span { opacity: 1; transition: none; }
  .rail-fill { transform: none !important; }
  .marker::after { opacity: 1; }
  .js [data-rail-chip] { opacity: 1; }
  mark { background-size: 100% 1.5px; transition: none; }
  .typing { display: none !important; }
  .mates::before, .mate, .nav, .btn, .msg { transition: none; }
}

/* ---------- Legal pages ---------- */
.legal { padding: clamp(40px, 8vh, 80px) 0 clamp(64px, 10vh, 120px); }
.legal-inner { max-width: 42rem; }
.legal-meta { margin-top: 14px; font-size: 13px; color: var(--t3); }
.legal-lede { margin-top: 28px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--t2); }
.legal h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.15; margin-top: 44px; }
.legal h2 + p, .legal h2 + ul, .legal p + p, .legal p + ul, .legal ul + p { margin-top: 14px; }
.legal p, .legal li { color: var(--t2); font-size: 16px; }
.legal p strong { color: var(--t1); }
.legal ul { display: flex; flex-direction: column; gap: 10px; }
.legal li { padding-left: 16px; position: relative; }
.legal li::before { content: ''; position: absolute; left: 0; top: .66em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-soft); }
.legal a { color: var(--t1); border-bottom: 1px solid var(--b3); }
.legal a:hover { border-bottom-color: var(--brand-tint); }
.legal-fill { color: #D6A961; background: rgba(214,169,97,.08); border-radius: 4px; padding: 0 4px; }
.nav-links a[aria-current="page"] { color: var(--t1); }
