/* Sunloom — the website. The sky is the instrument; everything else is night ink and Allo. */

@font-face {
  font-family: 'Allo';
  src: url('/assets/fonts/allo.woff2') format('woff2-variations'), url('/assets/fonts/allo.woff2') format('woff2');
  font-weight: 350 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Night ink: the app's ground, never pure black. */
  --ink: #06070b;
  --ink-raised: #0d0f17;
  --ink-high: #151826;
  --line: rgb(244 241 234 / 0.09);
  --line-strong: rgb(244 241 234 / 0.18);
  --text: #f4f1ea;
  --text-2: #bdb8ae;
  --text-3: #8f8a81;
  /* Light-event hues, tuned for dark surfaces (DESIGN.md). */
  --violet: #b79cff;
  --golden: #ffd25e;
  --sunrise: #ffa24c;
  --noon: #6fe3f0;
  --sunset: #ff9340;
  --blue: #7fb2ff;
  --night: #ff6fa8;
  /* The live sky (set by sky.js). */
  --sky-zenith: #04051a;
  --sky-mid: #090b26;
  --sky-horizon: #12163a;
  --sky-on: #f2f3ff;
  --sky-variant: #9aa1cc;
  --rond: 100;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --measure: 34rem;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-high) var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Allo', ui-sans-serif, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  font-variation-settings: 'ROND' 40;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--golden); color: #2b1d00; }

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }

:focus-visible {
  outline: 2px solid var(--golden);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

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

.glyph {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

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

.btn {
  --btn-bg: var(--text);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 240ms ease, color 240ms ease, box-shadow 240ms ease;
}
.btn:active { transform: scale(0.97); }
.btn .glyph { width: 1.2rem; height: 1.2rem; }
.btn-quiet {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
@media (hover: hover) {
  .btn:hover { box-shadow: 0 6px 20px -8px rgb(0 0 0 / 0.5); }
  .btn-quiet:hover { box-shadow: inset 0 0 0 1px var(--text-2); }
}

/* ------------------------------------------------------------------ nav */

.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  padding-block: 1.1rem;
  color: var(--sky-on);
  transition: color 600ms ease;
}
.page .nav { position: relative; color: var(--text); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { width: 2rem; height: 2rem; border-radius: 0.6rem; }
.nav-links { display: flex; align-items: center; gap: clamp(0.75rem, 3vw, 1.75rem); font-size: 0.95rem; }
.nav-links a:not(.btn) { text-decoration: none; opacity: 0.82; transition: opacity 200ms ease; padding-block: 0.6rem; }
.nav-links a:not(.btn):hover { opacity: 1; }
.nav .btn {
  --btn-bg: var(--sky-on);
  --btn-fg: var(--sky-zenith);
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}
.page .nav .btn { --btn-bg: var(--text); --btn-fg: var(--ink); }
@media (max-width: 40rem) { .nav-links .hide-sm { display: none; } }

/* ------------------------------------------------------------------ hero: the living sky */

.hero {
  position: relative;
  min-height: max(40rem, 100svh);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  color: var(--sky-on);
  background: linear-gradient(var(--sky-zenith), var(--sky-mid) 45%, var(--sky-horizon) 76%, var(--ink));
  isolation: isolate;
}
.sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-copy {
  align-self: center;
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 7rem var(--gutter) 2rem;
}
.count-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 560;
  letter-spacing: -0.015em;
}
.count-label .emblem {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 38% 62% 55% 45% / 48% 40% 60% 52%;
  background: var(--event-hue, var(--golden));
  color: #1d1300;
  transition: background-color 400ms ease;
}
.count-label .emblem .glyph { width: 1.35rem; height: 1.35rem; }
.count {
  margin-top: 0.35rem;
  font-size: clamp(4.5rem, 15vw, 9.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'ROND' var(--rond);
  white-space: nowrap;
}
.count small {
  font-size: 0.34em;
  font-weight: 450;
  letter-spacing: 0;
  margin-inline: 0.06em 0.22em;
  opacity: 0.85;
}
.count small:last-child { margin-right: 0; }
.count-at {
  margin-top: 0.85rem;
  color: var(--sky-variant);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.hero h1 {
  margin-top: clamp(2rem, 5vh, 3.25rem);
  max-width: 22ch;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 560;
}
.cta-row {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}
.hero .btn { --btn-bg: var(--sky-on); --btn-fg: var(--sky-zenith); }
.cta-note { color: var(--sky-variant); font-size: 0.95rem; }

/* The day ruler: drag it to travel through time, like the app's scrubber. */
.ruler {
  position: relative;
  height: 6.5rem;
  margin-inline: auto;
  width: 100%;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.ruler:active { cursor: grabbing; }
.ruler canvas { width: 100%; height: 3.25rem; margin-top: 1.25rem; }
.ruler::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.9rem;
  width: 3px;
  height: 4rem;
  border-radius: 3px;
  background: var(--sky-on);
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px rgb(0 0 0 / 0.12);
}
.ruler:focus-visible::after { box-shadow: 0 0 0 4px var(--golden); }
.ruler-time {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--sky-variant);
  white-space: nowrap;
}
.ruler-hint {
  position: absolute;
  right: var(--gutter);
  bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--sky-variant);
}
.now-pill {
  position: absolute;
  left: 50%;
  top: 5.25rem;
  z-index: 5;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--sky-on);
  color: var(--sky-zenith);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.now-pill[hidden] { display: block; opacity: 0; pointer-events: none; transform: translate(-50%, -6px) scale(0.96); }
@media (max-width: 40rem) {
  .ruler-hint { display: none; }
  .now-pill { top: 4.6rem; }
}

/* Dawn: the one authored moment. The headline rises while the sky comes up from night. */
.js .hero-copy > * { opacity: 0; transform: translateY(14px); filter: blur(6px); }
.js.ready .hero-copy > * {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out), filter 900ms var(--ease-out);
}
.js.ready .hero-copy > :nth-child(2) { transition-delay: 90ms; }
.js.ready .hero-copy > :nth-child(3) { transition-delay: 160ms; }
.js.ready .hero-copy > :nth-child(4) { transition-delay: 320ms; }
.js.ready .hero-copy > :nth-child(5) { transition-delay: 420ms; }

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

.section { padding-block: clamp(5rem, 12vw, 9rem); }
.section + .section { padding-top: 0; }
.section h2 {
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variation-settings: 'ROND' 55;
}
.lede {
  margin-top: 1.1rem;
  max-width: var(--measure);
  color: var(--text-2);
  font-size: clamp(1.06rem, 1.5vw, 1.2rem);
}

/* Modes: the phone answers the toggle. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
}
@media (max-width: 52rem) {
  .split { grid-template-columns: 1fr; }
  .split .device { justify-self: center; }
}
.modes {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.mode {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.6rem 1.15rem 0.6rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink-high);
  color: var(--text-2);
  font: inherit;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 240ms ease, color 240ms ease, border-radius 320ms var(--ease-out), transform 160ms var(--ease-out);
}
.mode:active { transform: scale(0.97); }
.mode .glyph { width: 1.2rem; height: 1.2rem; }
.mode[aria-pressed='true'] { background: var(--mode-hue); color: #1b1300; border-radius: 1rem; }
.mode-note {
  margin-top: 1.25rem;
  max-width: var(--measure);
  min-height: 3.2em;
  color: var(--text);
  font-size: 1.1rem;
}
.mode-more { margin-top: 0.9rem; color: var(--text-3); font-size: 0.95rem; max-width: var(--measure); }

/* A phone: thin bezel, punch-hole camera, the app's own screen. */
.device {
  --w: clamp(15rem, 26vw, 19rem);
  position: relative;
  width: var(--w);
  aspect-ratio: 1080 / 2424;
  padding: 0.55rem;
  border-radius: 2.6rem;
  background: linear-gradient(145deg, #2a2d36, #0b0c11 40%, #1c1e26);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 40px 80px -30px rgb(0 0 0 / 0.8), 0 18px 40px -20px rgb(0 0 0 / 0.6);
}
.device::before {
  content: '';
  position: absolute;
  top: 1.35rem;
  left: 50%;
  z-index: 3;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #050507;
  box-shadow: inset 0 0 0 2px #15171e;
  transform: translateX(-50%);
}
.screen {
  position: relative;
  height: 100%;
  border-radius: 2.1rem;
  overflow: hidden;
  background: #000;
}
.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(4px);
  transform: scale(1.015);
  transition: opacity 420ms var(--ease-out), filter 420ms var(--ease-out), transform 520ms var(--ease-out);
}
.screen img.on { opacity: 1; filter: none; transform: none; }

/* Features: a quiet list, not a card grid. */
.features {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.75rem clamp(2rem, 5vw, 4rem);
}
.feature { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; align-items: start; }
.feature .glyph { grid-row: span 2; width: 1.6rem; height: 1.6rem; margin-top: 0.15rem; color: var(--f-hue, var(--golden)); }
.feature h3 { font-size: 1.15rem; letter-spacing: -0.01em; font-weight: 600; }
.feature p { color: var(--text-2); font-size: 1rem; }

/* Moon */
.moon-split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
}
@media (max-width: 52rem) {
  .moon-split { grid-template-columns: 1fr; }
  .moon-split .moon-wrap { justify-self: center; }
}
.moon-wrap { position: relative; width: clamp(15rem, 34vw, 24rem); aspect-ratio: 1; }
.moon-wrap canvas { width: 100%; height: 100%; }
.moon-wrap::before {
  content: '';
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(157 177 255 / 0.1), transparent);
  z-index: -1;
}
.moon-facts {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
}
.moon-facts div { display: grid; gap: 0.15rem; }
.moon-facts dt { color: var(--text-3); font-size: 0.9rem; }
.moon-facts dd { margin: 0; font-size: 1.5rem; font-weight: 560; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fine { margin-top: 1.25rem; color: var(--text-3); font-size: 0.92rem; max-width: var(--measure); }

/* Wear OS: a round watch with a domed face. */
.watch-stage { display: grid; justify-items: center; }
.watch {
  --d: clamp(15rem, 34vw, 21rem);
  position: relative;
  width: var(--d);
  height: calc(var(--d) * 1.9);
  display: grid;
  place-items: center;
}
.watch .band {
  position: absolute;
  left: 50%;
  width: 62%;
  height: 32%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #1b1d24, #2b2e37 30%, #2b2e37 70%, #1b1d24);
}
.watch .band.top { top: 0; border-radius: 1.4rem 1.4rem 0.5rem 0.5rem; mask-image: linear-gradient(transparent, #000 45%); }
.watch .band.bottom { bottom: 0; border-radius: 0.5rem 0.5rem 1.4rem 1.4rem; mask-image: linear-gradient(#000 55%, transparent); }
.watch .case {
  position: relative;
  z-index: 1;
  width: var(--d);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 3.5%;
  background: radial-gradient(circle at 32% 25%, #5b5f6b, #24262d 45%, #121318 75%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 50px 80px -30px rgb(0 0 0 / 0.85), inset 0 -6px 12px rgb(0 0 0 / 0.5);
}
.watch .crown {
  position: absolute;
  right: -3.2%;
  top: 34%;
  width: 6%;
  height: 15%;
  border-radius: 40%;
  background: linear-gradient(90deg, #30333c, #5b5f6b, #2a2c33);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}
.watch .face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
}
.watch .face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04) rotate(-2deg);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out);
}
.watch .face img.on { opacity: 1; transform: none; }
.watch .face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 18%, rgb(255 255 255 / 0.13), transparent 38%);
  pointer-events: none;
}
.faces { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.faces .mode[aria-pressed='true'] { --mode-hue: var(--golden); }
.watch-caption { margin-top: 1.25rem; color: var(--text); font-size: 1.1rem; min-height: 3.2em; max-width: var(--measure); }

/* Comparison */
.compare {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.compare th, .compare td {
  padding: 1rem 1rem 1rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare thead th { font-size: 1.15rem; font-weight: 600; border-bottom-color: var(--line-strong); }
.compare tbody th { color: var(--text-2); font-weight: 450; width: 26%; }
.compare td { width: 37%; }
.compare .yes { display: inline-flex; gap: 0.5rem; align-items: flex-start; }
.compare .yes .glyph { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; color: var(--golden); }
.table-scroll { overflow-x: auto; }
@media (max-width: 40rem) {
  .compare { font-size: 0.95rem; }
  .compare tbody th { width: 30%; }
}

/* FAQ */
.faq-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem clamp(2rem, 6vw, 5rem); align-items: start; }
.faq-split h2 { position: sticky; top: 2rem; }
@media (max-width: 52rem) { .faq-split { grid-template-columns: 1fr; } .faq-split h2 { position: static; } }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  font-size: 1.15rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .glyph { width: 1.25rem; height: 1.25rem; color: var(--text-3); transition: transform 260ms var(--ease-out); }
.faq details[open] summary .glyph { transform: rotate(180deg); }
.faq .answer { padding-bottom: 1.35rem; color: var(--text-2); max-width: 40rem; }
.faq .answer p + p { margin-top: 0.75rem; }
@supports (interpolate-size: allow-keywords) {
  .faq { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height 320ms var(--ease-out), content-visibility 320ms allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

/* Closing call */
.closing { text-align: center; display: grid; justify-items: center; }
.closing img { width: 4.5rem; height: 4.5rem; border-radius: 1.2rem; margin-bottom: 1.75rem; box-shadow: 0 20px 40px -20px rgb(183 156 255 / 0.5); }
.closing .cta-row .btn { --btn-bg: var(--golden); --btn-fg: #2b1d00; }
.closing .cta-note { color: var(--text-3); }

/* Footer */
.footer {
  padding-block: 3rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.92rem;
}
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 2rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer p { max-width: 36rem; }

/* ------------------------------------------------------------------ text pages */

.page main { padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 7rem); }
.doc { max-width: 42rem; }
.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variation-settings: 'ROND' 55;
}
.doc .updated { margin-top: 0.9rem; color: var(--text-3); }
.doc h2 { margin-top: 2.75rem; font-size: 1.4rem; letter-spacing: -0.015em; }
.doc p, .doc ul { margin-top: 0.85rem; color: var(--text-2); }
.doc ul { padding-left: 1.2rem; }
.doc li + li { margin-top: 0.45rem; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--text); }
.doc .summary {
  margin-top: 2rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1rem;
  background: var(--ink-raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
}

/* Route changes: a short crossfade between pages. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .js .hero-copy > * { transform: none; filter: none; }
}
