/* Outer Meadow — two skies.
   Light is a heavenly daytime nebula: cream, white, gold.
   Dark is deep space: navy, violet, magenta.
   Both carry the same four-point star, which is the constant in the mark.

   Theme resolution has three states: no attribute (follow the OS),
   data-theme="light", data-theme="dark". Tokens are defined for all three
   so an explicit choice always beats the OS setting, in both directions. */

:root {
  --bg:          #EDE8DE;   /* exactly the light mark's own ground */
  --bg-tint:     #E4DED1;
  --bg-raise:    #F7F4ED;
  --ink:         #1B1A33;
  --ink-soft:    #57536E;
  --ink-faint:   #8A85A0;
  --line:        #E9E1CF;

  --accent:      #A97B22;   /* gold, dark enough to read as text on cream */
  --accent-lift: #E0B455;
  --accent-soft: #F7ECD3;
  --accent-ring: #EBD5A6;

  --ember:       #C4451F;   /* Tayli Move, darkened for contrast on light */
  --ember-lift:  #E4572E;

  --glow-a: rgba(224,180,85,.34);
  --glow-b: rgba(160,170,235,.30);
  --aurora-1: rgba(232,186,96,.42);
  --aurora-2: rgba(158,138,222,.34);
  --aurora-3: rgba(236,152,138,.32);
  --ray: rgba(255,244,214,.75);
  --ray-strength: .55;
  --shadow: 0 30px 60px -34px rgba(60,50,20,.42);

  --radius: 18px; --radius-lg: 28px; --wrap: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --serif: ui-serif, "New York", Iowan Old Style, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

:root:not([data-theme="light"]) { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #050919;   /* exactly the dark mark's own ground */
    --bg-tint:     #0A0F26;
    --bg-raise:    #0F1533;
    --ink:         #EAF2FF;
    --ink-soft:    #A3B4E0;
    --ink-faint:   #7186B8;
    --line:        #1E2A55;
    --accent:      #B49BFF;
    --accent-lift: #D6C7FF;
    --accent-soft: #1A1E4A;
    --accent-ring: #3A2F72;
    --ember:       #FF7A4D;
    --ember-lift:  #FF9A6B;
    --glow-a: rgba(150,90,240,.34);
    --glow-b: rgba(56,150,232,.26);
    --aurora-1: rgba(150,90,240,.38);
    --aurora-2: rgba(56,120,232,.32);
    --aurora-3: rgba(232,92,200,.26);
    --ray: rgba(176,150,255,.35);
    --ray-strength: .30;
    --shadow: 0 30px 70px -34px rgba(0,0,0,.75);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:          #050919;
  --bg-tint:     #0A0F26;
  --bg-raise:    #0F1533;
  --ink:         #EAF2FF;
  --ink-soft:    #A3B4E0;
  --ink-faint:   #7186B8;
  --line:        #1E2A55;
  --accent:      #B49BFF;
  --accent-lift: #D6C7FF;
  --accent-soft: #1A1E4A;
  --accent-ring: #3A2F72;
  --ember:       #FF7A4D;
  --ember-lift:  #FF9A6B;
  --glow-a: rgba(150,90,240,.34);
  --glow-b: rgba(56,150,232,.26);
  --aurora-1: rgba(150,90,240,.38);
  --aurora-2: rgba(56,120,232,.32);
  --aurora-3: rgba(232,92,200,.26);
  --ray: rgba(176,150,255,.35);
  --ray-strength: .30;
  --shadow: 0 30px 70px -34px rgba(0,0,0,.75);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- the mark: one per sky ---------- */

.mark { width: 42px; flex: none; display: block; line-height: 0; }
.mark img { width: 100%; height: auto; display: block; }
/* The swap is global, not scoped to the header — the hero and any showcase
   use the same pair of images. */
.m-dark { display: none; }
.m-light { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .m-light { display: none; }
  :root:not([data-theme="light"]) .m-dark  { display: block; }
}
:root[data-theme="dark"] .m-light { display: none; }
:root[data-theme="dark"] .m-dark  { display: block; }
:root[data-theme="light"] .m-light { display: block; }
:root[data-theme="light"] .m-dark  { display: none; }

/* ---------- header ---------- */

header.site {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 640; letter-spacing: -.012em; color: var(--ink);
  text-decoration: none; font-size: 1.04rem;
}
.navwrap { display: flex; align-items: center; gap: 6px; }
nav.site a {
  color: var(--ink-soft); text-decoration: none; font-size: .93rem;
  margin-left: 24px; font-weight: 500;
}
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  margin-left: 20px; width: 34px; height: 34px; flex: none;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-raise); color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-ring); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}
:root[data-theme="dark"] .theme-toggle .i-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
:root[data-theme="light"] .theme-toggle .i-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

@media (max-width: 620px) {
  header.site .wrap { flex-direction: column; gap: 8px; padding-block: 12px; }
  nav.site a { margin-left: 16px; font-size: .88rem; }
  nav.site a:first-child { margin-left: 0; }
  .theme-toggle { margin-left: 14px; }
}

/* ---------- type ---------- */

h1, h2, h3 { line-height: 1.14; letter-spacing: -.026em; margin: 0 0 .4em; font-weight: 700; text-wrap: balance; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.12rem; font-weight: 640; }
p { margin: 0 0 1.1em; }
a { color: var(--accent); }

.lede { font-size: clamp(1.06rem, 2.1vw, 1.3rem); color: var(--ink-soft); max-width: 48ch; }
.eyebrow {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em;
  font-size: .72rem; font-weight: 600; color: var(--accent); margin-bottom: 14px;
}

/* ---------- sections ---------- */

section { padding: 86px 0; }
section.tint { background: var(--bg-tint); border-block: 1px solid var(--line); }

.hero { padding: 100px 0 86px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(50% 46% at 22% 24%, var(--glow-b), transparent 70%),
    radial-gradient(46% 44% at 78% 18%, var(--glow-a), transparent 72%);
  pointer-events: none; z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 56px; align-items: center; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  section { padding: 62px 0; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 620; font-size: .97rem;
  text-decoration: none; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-lift), var(--accent));
  color: #17130A; box-shadow: 0 10px 26px -12px var(--accent);
}
:root[data-theme="dark"] .btn-primary { color: #0B0A22; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #0B0A22; }
}
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--bg-raise); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- cards ---------- */

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.card .ico {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.card .ico svg { width: 19px; height: 19px; }

.app-card {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 22px; align-items: center;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.app-card:hover { border-color: var(--ember); transform: translateY(-2px); }
.app-card h3 { font-size: 1.35rem; margin-bottom: 3px; }
.app-card p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.app-card .chev { color: var(--ink-faint); }
@media (max-width: 620px) {
  .app-card { grid-template-columns: 64px 1fr; }
  .app-card .chev { display: none; }
}

/* ---------- phone mock: Tayli Move's own colour, on either sky ---------- */

.phone {
  width: 260px; aspect-ratio: 9/19.5; margin: 0 auto; border-radius: 40px;
  background: linear-gradient(160deg, var(--ember-lift), #8C2A12);
  border: 8px solid #16130F;
  box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 24px; text-align: center;
  color: #fff; position: relative; overflow: hidden;
}
.phone .route { position: absolute; inset: 0; opacity: .5; }
.phone .readout { position: relative; }
.phone .readout .big { font-size: 3rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.phone .readout .unit { font-size: .9rem; opacity: .78; margin-top: 4px; }
.phone .readout .row { display: flex; gap: 15px; justify-content: center; margin-top: 26px; font-size: .8rem; opacity: .88; white-space: nowrap; }
.phone .readout .row b { display: block; font-size: 1.06rem; font-weight: 680; }

/* ---------- prose ---------- */

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.2em; font-size: 1.42rem; }
.prose h2:first-of-type { margin-top: 1.4em; }
.prose h3 { margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; color: var(--ink-soft); }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); }

.callout {
  border: 1px solid var(--accent-ring); background: var(--accent-soft);
  border-radius: var(--radius); padding: 20px 24px; margin: 0 0 2em;
}
.callout p { margin: 0; color: var(--ink); }
.updated { font-size: .86rem; color: var(--ink-faint); margin-bottom: 2.4em; }

/* ---------- footer ---------- */

footer.site { border-top: 1px solid var(--line); padding: 44px 0; background: var(--bg-tint); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
footer.site p { margin: 0; color: var(--ink-faint); font-size: .88rem; }
footer.site nav a { color: var(--ink-soft); text-decoration: none; font-size: .88rem; margin-left: 22px; }
footer.site nav a:first-child { margin-left: 0; }
footer.site nav a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}


/* ---------- the sky ----------
   A drifting, twinkling field behind everything. Sections that set their own
   background hide it; the hero and plain sections let it through. */

#om-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}
/* The header keeps position:sticky from its own rule — only give it a layer.
   Setting position:relative here would silently un-stick it. */
section, footer.site { position: relative; z-index: 1; }
section:not(.tint) { background: transparent; }

/* ---------- hero: the mark gets to be the first thing you see ---------- */

.hero-centred { text-align: center; padding: 84px 0 78px; }
.hero-centred .lede { margin-inline: auto; }
.hero-centred .btn-row { justify-content: center; }

.hero-mark {
  width: clamp(170px, 26vw, 250px);
  margin: 0 auto 26px;
  display: block;
  position: relative;
}
.hero-mark img { width: 100%; height: auto; position: relative; z-index: 1; }
.hero-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 150%; height: 150%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow-a), transparent 62%);
  pointer-events: none; opacity: .85;
}

/* Showcase panel further down the page */
.mark-stage {
  display: grid; place-items: center; gap: 26px;
  padding: 62px 26px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--bg-raise);
  text-align: center;
}
.mark-stage .m { width: clamp(150px, 22vw, 210px); }
.mark-stage .m img { width: 100%; height: auto; display: block; }
.mark-stage p { max-width: 46ch; margin: 0; color: var(--ink-soft); }

/* ---------- reveal ---------- */

[data-reveal] { opacity: 0; transform: translateY(16px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .62s cubic-bezier(.22,.8,.24,1), transform .62s cubic-bezier(.22,.8,.24,1);
}
[data-reveal="1"].is-in { transition-delay: .07s; }
[data-reveal="2"].is-in { transition-delay: .14s; }
[data-reveal="3"].is-in { transition-delay: .21s; }

.card { transition: transform .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent-ring); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  #om-sky { opacity: .7; }
}


/* ---------- app showcase: card and phone side by side ---------- */

.app-showcase {
  display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center;
}
.app-showcase .phone { margin: 0; width: 216px; }
.app-copy .app-card { grid-template-columns: 72px 1fr auto; padding: 22px; }
@media (max-width: 860px) {
  .app-showcase { grid-template-columns: 1fr; gap: 34px; }
  .app-showcase .phone { width: 196px; margin: 0 auto; }
}


/* ---------- aurora ----------
   A slow colour field behind the star sky. In the dark it reads as nebula; in
   daylight as sunlit haze, which is what the light theme was missing — it had
   colour but no atmosphere. Three layers on different periods so the motion
   never visibly loops. */

.om-aurora {
  position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  filter: blur(72px) saturate(118%);
  background: radial-gradient(38% 34% at 22% 26%, var(--aurora-2), transparent 70%);
  animation: om-a1 44s ease-in-out infinite alternate;
  will-change: transform;
}
.om-aurora::before, .om-aurora::after { content: ""; position: absolute; inset: 0; }
.om-aurora::before {
  background: radial-gradient(34% 30% at 78% 20%, var(--aurora-1), transparent 72%);
  animation: om-a2 57s ease-in-out infinite alternate;
}
.om-aurora::after {
  background: radial-gradient(40% 34% at 62% 80%, var(--aurora-3), transparent 74%);
  animation: om-a3 65s ease-in-out infinite alternate;
}
@keyframes om-a1 { from { transform: translate3d(0,0,0) scale(1);    } to { transform: translate3d(6%,4%,0) scale(1.14); } }
@keyframes om-a2 { from { transform: translate3d(0,0,0) scale(1.06); } to { transform: translate3d(-7%,5%,0) scale(1);   } }
@keyframes om-a3 { from { transform: translate3d(0,0,0) scale(1);    } to { transform: translate3d(4%,-6%,0) scale(1.12);} }

/* Light theme needs its surfaces to lift off the cream, or cards read as flat
   patches. Dark theme gets separation from luminance instead. */
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .app-card,
:root:not([data-theme="dark"]) .mark-stage {
  box-shadow: 0 14px 30px -22px rgba(90,70,30,.55), 0 2px 6px -3px rgba(90,70,30,.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card,
  :root:not([data-theme="light"]) .app-card,
  :root:not([data-theme="light"]) .mark-stage { box-shadow: none; }
}
:root[data-theme="light"] .card,
:root[data-theme="light"] .app-card,
:root[data-theme="light"] .mark-stage {
  box-shadow: 0 14px 30px -22px rgba(90,70,30,.55), 0 2px 6px -3px rgba(90,70,30,.14);
}

@media (prefers-reduced-motion: reduce) {
  .om-aurora, .om-aurora::before, .om-aurora::after { animation: none; }
}


/* ---------- light rays ----------
   Soft diagonal beams drifting across the page. In daylight they read as sun
   through haze, which is what makes the light theme feel like weather rather
   than a background colour; in the dark they are faint nebula streaks. */

.om-rays {
  position: fixed; inset: -40% -20%; z-index: 0; pointer-events: none;
  opacity: var(--ray-strength);
  background: repeating-linear-gradient(
    104deg,
    transparent 0 70px,
    var(--ray) 70px 104px,
    transparent 104px 210px);
  filter: blur(34px);
  animation: om-rays 46s linear infinite;
  will-change: transform;
}
@keyframes om-rays {
  from { transform: translate3d(-210px, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* The hero mark floats, so the logo is never completely still. */
.hero-mark { animation: om-float 8.5s ease-in-out infinite; }
@keyframes om-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-11px); }
}
.hero-mark::after { animation: om-glow 8.5s ease-in-out infinite; }
@keyframes om-glow {
  0%, 100% { opacity: .7;  transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

/* A light catches the primary button as it passes. */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  animation: om-sheen 6.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes om-sheen {
  0%, 62% { left: -60%; }
  92%, 100% { left: 115%; }
}

@media (prefers-reduced-motion: reduce) {
  .om-rays, .hero-mark, .hero-mark::after, .btn-primary::after { animation: none; }
  .btn-primary::after { display: none; }
}


/* ---------- status pills ----------
   The dot pulses only where something is actually in motion; an idea on the
   drawing board gets a still dot, because a blinking light implies progress. */

.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .07em;
  text-transform: uppercase; font-weight: 600;
  padding: 5px 11px 5px 9px; border-radius: 999px; margin-bottom: 13px;
  border: 1px solid var(--line); color: var(--ink-soft);
}
.status i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.status-soon { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 34%, transparent); }
.status-dev  { color: var(--accent); border-color: var(--accent-ring); }
.status-idea { color: var(--ink-faint); }
.status-soon i, .status-dev i { animation: om-blip 2.4s ease-in-out infinite; }
@keyframes om-blip {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: .55; box-shadow: 0 0 0 4px transparent; }
}

/* Nav has five items now; let it wrap rather than overflow on a small phone. */
nav.site { display: flex; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .status-soon i, .status-dev i { animation: none; }
}
