/* ==========================================================================
   SkyWiser — skywiser.app
   Palette and type derived from /tokens.json (aesthetics.editorial + moods.luminous).
   No external requests. No JavaScript. No build step.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   Light values: tokens.json → aesthetics.editorial.light
   Dark values:  tokens.json → aesthetics.editorial.dark
   Gold:         tokens.json → moods.luminous (the app's "Clarity" accent)
   -------------------------------------------------------------------------- */

:root {
  --bg:          #F5F2EC;
  --surface:     #FBF9F4;
  --surface-alt: #EDE9E0;
  --ink:         #1A1815;
  --ink-soft:    #524C42;
  --ink-mute:    #948B7C;
  --line:        rgba(26, 24, 21, 0.09);
  --line-strong: rgba(26, 24, 21, 0.22);

  /* Gold reads at 2.8:1 on cream — decoration only, never text. */
  --gold:        #B8893B;
  /* Darkened for anything that must carry text at AA (5.7:1 on cream). */
  --gold-ink:    #7A5A22;

  --font-display: "Fraunces", "Instrument Serif", ui-serif, "New York",
                  "Iowan Old Style", Palatino, Georgia, serif;
  --font-body:    "Inter Tight", system-ui, -apple-system, "Segoe UI",
                  Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo,
                  Consolas, monospace;

  --measure: 36rem;   /* prose column, ~64 characters */
  --wide:    64rem;   /* full container */
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --step:    clamp(3.5rem, 9vw, 6.5rem); /* vertical rhythm between sections */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #12110F;
    --surface:     #1C1A17;
    --surface-alt: #26241F;
    --ink:         #F2EEE5;
    --ink-soft:    #B8B0A0;
    --ink-mute:    #716A5C;
    --line:        rgba(242, 238, 229, 0.09);
    --line-strong: rgba(242, 238, 229, 0.24);

    /* On near-black, the app's dark gold clears AA comfortably (10.7:1). */
    --gold:     #E5BC73;
    --gold-ink: #E5BC73;
  }
}

/* --------------------------------------------------------------------------
   Reset and base
   -------------------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}

p, ul, ol, dl { margin: 0; }

a {
  color: inherit;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-thickness 120ms ease;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--gold);
  color: #12110F;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

.prose > * + * { margin-top: 1.1em; }

.section {
  padding-block: var(--step);
  border-top: 1px solid var(--line);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  z-index: 10;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Typographic roles
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  display: block;
}

.display {
  font-size: clamp(2.5rem, 7.5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: clamp(1.65rem, 3.6vw, 2.35rem);
  margin-bottom: 1.25rem;
}

.h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.small {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.mono-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Masthead and footer
   -------------------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.4rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark::after {
  content: "✦";
  color: var(--gold-ink);
  font-size: 0.62em;
  vertical-align: 0.35em;
  margin-left: 0.28em;
}

.masthead-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead-nav a { text-decoration: none; color: var(--ink-soft); }
.masthead-nav a:hover { color: var(--ink); }

.colophon {
  border-top: 1px solid var(--line);
  padding-block: 3rem 4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.colophon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem 3.5rem;
  justify-content: space-between;
}

.colophon-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { padding-block: clamp(3.5rem, 10vw, 7rem) var(--step); }

.hero-lead {
  margin-top: 1.75rem;
  max-width: 32rem;
}

/* --------------------------------------------------------------------------
   SIGNATURE — the precision scale.
   Four stacked tracks, each a magnification of the slice marked above it:
   the zodiac narrowed to a sign, a nakshatra, and finally a sub-lord.
   This is the one idea the page is built to carry, so nothing else shouts.
   -------------------------------------------------------------------------- */

.scale {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  border-top: 1px solid var(--line-strong);
  padding-top: 1.75rem;
}

.scale-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scale-step + .scale-step { margin-top: 0.25rem; }

.scale-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.scale-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.scale-arc {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* The ruler itself: hairline ticks drawn with a repeating gradient. */
.scale-track {
  position: relative;
  height: 2.5rem;
  border: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to right,
    var(--ink-mute) 0 1px,
    transparent 1px 5%
  );
  background-position: left center;
  background-size: 100% 55%;
  background-repeat: no-repeat;
}

/* The slice the next track magnifies. */
.scale-window {
  position: absolute;
  inset-block: -1px;
  border: 1.5px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
}

.scale-window--zodiac    { left: 8%;  width: 30%; }
.scale-window--sign      { left: 26%; width: 22%; }
.scale-window--nakshatra { left: 54%; width: 9%;  }

/* Trapezoid connectors. preserveAspectRatio="none" lets the lines stretch to
   any width while non-scaling-stroke keeps them hairline-thin. */
.scale-link {
  display: block;
  width: 100%;
  height: 1.6rem;
}

.scale-link line {
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.75;
}

/* The terminal track: no window, because this is where KP stops. */
.scale-track--final {
  background-image: repeating-linear-gradient(
    to right,
    var(--ink-mute) 0 1px,
    transparent 1px 12.5%
  );
}

.scale-final-mark {
  position: absolute;
  inset-block: -1px;
  left: 37.5%;
  width: 12.5%;
  background: var(--gold);
}

.scale-caption {
  margin-top: 1.75rem;
  max-width: var(--measure);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .scale-step {
    animation: rise 620ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .scale-step:nth-child(1) { animation-delay: 120ms; }
  .scale-step:nth-child(2) { animation-delay: 260ms; }
  .scale-step:nth-child(3) { animation-delay: 400ms; }
  .scale-step:nth-child(4) { animation-delay: 540ms; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(0.6rem); }
    to   { opacity: 1; transform: none; }
  }
}

/* --------------------------------------------------------------------------
   The daily loop — a real sequence, so it is numbered.
   -------------------------------------------------------------------------- */

.loop {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  counter-reset: loop;
  display: grid;
  gap: 0;
}

.loop-step {
  counter-increment: loop;
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 1.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  align-items: start;
}

.loop-step:last-child { border-bottom: 1px solid var(--line); }

.loop-step::before {
  content: counter(loop, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--gold-ink);
  padding-top: 0.28em;
}

.loop-body { max-width: 30rem; }
.loop-body p { margin-top: 0.4rem; color: var(--ink-soft); }

@media (max-width: 30rem) {
  .loop-step { grid-template-columns: 2rem 1fr; gap: 0 0.9rem; }
  .scale-head { gap: 0.5rem; }
}

.glyph-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.glyph {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Ledger — used for the privacy inventory and for pricing.
   A table of facts, not a grid of cards.
   -------------------------------------------------------------------------- */

.ledger {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line-strong);
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.35rem 2rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.ledger-term {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.ledger-desc {
  margin: 0;
  max-width: 34rem;
}

@media (max-width: 34rem) {
  .ledger-row { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   The three aesthetics, each drawn in its own palette (values from tokens.json)
   -------------------------------------------------------------------------- */

.aesthetics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  list-style: none;
  padding: 0;
}

.swatch {
  background: var(--sw-bg);
  color: var(--sw-ink);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 12.5rem;
}

.swatch-name {
  font-family: var(--sw-display);
  font-size: 1.35rem;
  font-weight: var(--sw-weight, 500);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--sw-ink);
}

.swatch-sample {
  font-family: var(--sw-display);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--sw-soft);
  margin: 0;
  flex: 1;
}

.swatch-blurb {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sw-soft);
}

.swatch-rule {
  height: 2px;
  width: 2.5rem;
  background: var(--sw-accent);
}

/* Light-mode renderings straight from tokens.json */
.swatch--editorial {
  --sw-bg: #F5F2EC; --sw-ink: #1A1815; --sw-soft: #524C42;
  --sw-accent: #B8893B; --sw-display: var(--font-display); --sw-weight: 500;
}
.swatch--cosmic {
  --sw-bg: #0B0B12; --sw-ink: #ECEBF2; --sw-soft: #A8A6B8;
  --sw-accent: #C597C9;
  --sw-display: "Instrument Serif", ui-serif, "New York", Georgia, serif;
  --sw-weight: 400;
}
.swatch--analog {
  --sw-bg: #E8E1D6; --sw-ink: #2B2419; --sw-soft: #5C5140;
  --sw-accent: #6B4F2E; --sw-display: var(--font-body); --sw-weight: 600;
}

/* Cosmic ships dark by default; in dark mode the other two follow the app. */
@media (prefers-color-scheme: dark) {
  .swatch--editorial {
    --sw-bg: #12110F; --sw-ink: #F2EEE5; --sw-soft: #B8B0A0;
    --sw-accent: #E5BC73;
  }
  .swatch--analog {
    --sw-bg: #1A1510; --sw-ink: #EFE7D8; --sw-soft: #B5A991;
    --sw-accent: #D9B97B;
  }
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.plans {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  padding: 0;
}

.plan {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 2rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.plan-name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-note {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Call to action — a "coming soon" plate, sized like a real App Store badge
   so it can be swapped without reflowing the page.
   -------------------------------------------------------------------------- */

.cta { text-align: left; }

.badge-slot {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 15rem;
  min-height: 3.5rem;
  padding: 0.7rem 1.5rem;
  margin-top: 2rem;
  border: 1.5px dashed var(--line-strong);
  background: var(--surface);
}

.badge-slot-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.badge-slot-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Legal documents (privacy, terms)
   -------------------------------------------------------------------------- */

.doc { padding-block: clamp(2.5rem, 6vw, 4rem) var(--step); }

.doc-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 1.25rem;
}

.doc-body { max-width: var(--measure); }

.doc-body h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  margin-top: 3rem;
  margin-bottom: 0.85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.doc-body h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}

.doc-body p,
.doc-body ul,
.doc-body ol { margin-top: 0.9rem; }

.doc-body ul,
.doc-body ol { padding-left: 1.2rem; }

.doc-body li { margin-top: 0.45rem; }

.doc-body li::marker { color: var(--gold-ink); }

.toc {
  margin-top: 2.5rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
}

.toc li { margin-top: 0.3rem; }
.toc li::marker { color: var(--ink-mute); font-family: var(--font-mono); font-size: 0.8em; }

/* A pull-out for the claims that matter most, and for placeholders. */
.callout {
  margin-top: 1.5rem;
  padding: 1.1rem 1.35rem;
  border-left: 2px solid var(--gold);
  background: var(--surface);
}

.callout p { margin-top: 0; }
.callout p + p { margin-top: 0.75rem; }

.placeholder {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  padding: 0.08em 0.35em;
  border-radius: 2px;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Support / feedback
   -------------------------------------------------------------------------- */

.faq { margin-top: 2.5rem; border-top: 1px solid var(--line-strong); }

.faq-item {
  border-bottom: 1px solid var(--line);
  padding-block: 1.35rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--gold-ink);
  flex: none;
}

.faq-item[open] summary::after { content: "–"; }

.faq-answer { margin-top: 0.85rem; max-width: 34rem; color: var(--ink-soft); }
.faq-answer p + p { margin-top: 0.75rem; }

.contact-card {
  margin-top: 2.5rem;
  padding: 1.75rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  max-width: 34rem;
}

.contact-address {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-style: normal;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
  display: block;
  word-break: break-word;
}

.checklist {
  list-style: none;
  padding: 0;
  margin-top: 1.25rem;
}

.checklist li {
  padding-left: 1.4rem;
  position: relative;
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.checklist li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--gold-ink);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* --------------------------------------------------------------------------
   Print — legal pages get printed and filed.
   -------------------------------------------------------------------------- */

@media print {
  .masthead-nav, .toc, .skip-link { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .doc-body { max-width: none; }
  a { text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
