/* Skrich — skrich.app. One stylesheet, no build step, nothing third-party.
   Colours come from the app (Skrich/Design/SkrichPalette.swift, SkrichTokens.swift). */

:root {
  color-scheme: dark;

  /* Nebula (SkrichPalette) */
  --space-black: #0A0208;
  --deep-crimson: #200B14;
  --mars-plum: #2B1220;
  --mauve-void: #7B3F6A;
  --nebula-magenta: #D94F8C;
  --orchid-pulse: #E76EB0;
  --solar-amber: #F4A236;
  --star-gold: #FFD866;
  --supernova-blue: #2EC4B6;
  --nova-flare: #45D9CB;
  --nova-violet: #6B7FC4;

  /* Roles (SkrichTokens.nebula) */
  --canvas: var(--space-black);
  --border: rgba(255, 255, 255, 0.12);
  --divider: rgba(255, 255, 255, 0.08);
  --card: rgba(16, 4, 12, 0.78);
  --text-heading: #FFFFFF;
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.72);
  --accent: var(--supernova-blue);
  --accent-light: var(--nova-flare);
  --on-accent: #06231F;
  --mystery: var(--orchid-pulse);
  --reward: var(--star-gold);

  /* Corners and spacing (SkrichRadius, SkrichSpace) */
  --r-small: 12px;
  --r-medium: 20px;
  --r-large: 28px;
  --gutter: 16px;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--canvas);
  /* The nebula: the app's gradient, softened so text always sits on dark. */
  background-image:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(217, 79, 140, 0.30), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(244, 162, 54, 0.14), transparent 70%),
    linear-gradient(160deg, var(--space-black) 0%, var(--deep-crimson) 45%, rgba(123, 63, 106, 0.55) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* A still starfield, drawn once. Decorative only. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 72%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 46% 34%, var(--star-gold), transparent),
    radial-gradient(1px 1px at 63% 12%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 78% 58%, #fff, transparent),
    radial-gradient(1px 1px at 88% 84%, var(--star-gold), transparent),
    radial-gradient(1px 1px at 8% 90%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 55% 88%, #fff, transparent),
    radial-gradient(1px 1px at 36% 8%, #fff, transparent),
    radial-gradient(1px 1px at 94% 30%, #fff, transparent);
}

@media (prefers-reduced-transparency: reduce) {
  body { background-image: none; }
  body::before { display: none; }
  :root { --card: var(--mars-plum); }
}

a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: #fff; }

:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-small);
  font-weight: 700;
  text-decoration: none;
  z-index: 10;
}
.skip-link:focus { top: var(--gutter); }

.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header { padding: 20px 0 8px; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-heading);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 0;
  display: inline-block;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-heading); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

main { padding: 24px 0 48px; }

h1, h2, h3 { color: var(--text-heading); line-height: 1.2; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 750; margin: 2em 0 0.5em; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong { color: var(--text-heading); }

/* Home */
.hero { text-align: center; padding: 24px 0 8px; }
.hero-icon {
  width: 128px;
  height: 128px;
  border-radius: 29px;
  box-shadow: 0 0 32px rgba(107, 127, 196, 0.45);
  margin-bottom: 20px;
}
.eyebrow {
  color: var(--accent-light);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.pitch {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 36rem;
  margin: 0 auto 28px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-heading);
  font-weight: 700;
}
.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.stores .badge { margin: 0; }
.badge-link {
  text-decoration: none;
  border-color: var(--accent);
}
.badge-link:hover, .badge-link:focus-visible {
  background: var(--border);
}
.badge-soon {
  color: var(--text-secondary);
  font-weight: 600;
}
.badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(46, 196, 182, 0.6);
}

/* The fog, clearing where you go. Decorative. */
.fog-demo {
  position: relative;
  height: 180px;
  margin: 36px auto 8px;
  max-width: 36rem;
  border-radius: var(--r-large);
  border: 1px solid var(--border);
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(255, 255, 255, 0.07) 26px 27px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(255, 255, 255, 0.07) 34px 35px),
    linear-gradient(135deg, #1d3b45, #2a2440 60%, #3a2236);
}
.fog-demo::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at var(--x, 30%) 50%, transparent 0 46px, rgba(43, 18, 32, 0.92) 70px, var(--deep-crimson) 100%);
  animation: wander 14s ease-in-out infinite alternate;
}
.fog-demo .you {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  z-index: 1;
  animation: walk 14s ease-in-out infinite alternate;
}
@keyframes wander { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
@keyframes walk { from { transform: translateX(-6.6rem); } to { transform: translateX(6.6rem); } }

.features {
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li {
  margin: 0;
  padding: 16px;
  border-radius: var(--r-medium);
  border: 1px solid var(--border);
  background: var(--card);
}
.features h2 { font-size: 1.05rem; margin: 0 0 6px; }
.features p { margin: 0; color: var(--text-secondary); font-size: 0.97rem; }
.features .mystery { color: var(--mystery); }
.features .reward { color: var(--reward); }
.features .accent { color: var(--accent-light); }

.made-by { text-align: center; color: var(--text-secondary); margin-top: 36px; }

/* Documents */
.doc {
  padding: 24px 20px;
  border-radius: var(--r-large);
  border: 1px solid var(--border);
  background: var(--card);
}
@media (min-width: 640px) { .doc { padding: 36px 40px; } }
.doc h2 { padding-top: 1.2em; border-top: 1px solid var(--divider); }
.doc h1 + .meta + h2, .doc .summary + h2 { border-top: 0; padding-top: 0; }
.meta { color: var(--text-secondary); font-size: 0.95rem; }
.summary {
  padding: 14px 16px;
  border-radius: var(--r-small);
  border-left: 3px solid var(--accent);
  background: rgba(46, 196, 182, 0.08);
  margin: 1.5em 0;
}
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }
.toc { font-size: 0.97rem; }
.toc ol { padding-left: 1.3em; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 8px;
  border-bottom: 1px solid var(--divider);
}
th { color: var(--text-heading); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* Beta NDA form (beta-nda.html) */
.sign-form { margin-top: 1em; }
.field { margin: 0 0 18px; }
fieldset.field { border: 0; padding: 0; }
.field > label:not(.choice), .field legend { display: block; color: var(--text-heading); font-weight: 700; margin-bottom: 6px; padding: 0; }
.field input[type="text"], .field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-small);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-heading);
  font: inherit;
}
.field input::placeholder { color: var(--text-secondary); }
.field input.signature { font-style: italic; font-size: 1.25rem; }
.choice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; font-weight: 400; color: var(--text); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.hint { display: block; color: var(--text-secondary); font-size: 0.92rem; margin-top: 6px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  padding: 12px 14px;
  border-radius: var(--r-small);
  border-left: 3px solid var(--nebula-magenta);
  background: rgba(217, 79, 140, 0.12);
  color: var(--text-heading);
}
.button {
  display: inline-block;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
a.button { text-decoration: none; }
.button:hover { background: var(--accent-light); color: var(--on-accent); }
.button:disabled { opacity: 0.6; cursor: progress; }
.signed {
  padding: 16px 18px;
  border-radius: var(--r-medium);
  border: 1px solid var(--border);
  background: rgba(46, 196, 182, 0.08);
}
.signed h3 { margin-top: 0; }
.signed dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 1em; }
.signed dt { color: var(--text-secondary); }
.signed dd { margin: 0; color: var(--text-heading); overflow-wrap: anywhere; }
.install { margin: 0 0 1em; padding-top: 1em; border-top: 1px solid var(--divider); }
.install h3 { margin-top: 0; }

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  body::before, .skip-link, .site-header, .site-footer, .sign-form, .install, #print { display: none !important; }
  .doc, .signed, .summary { border: 0; background: none; padding: 0; }
  h1, h2, h3, strong, .signed dd { color: #000; }
  .meta, .signed dt { color: #333; }
  a { color: #000; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 24px 0 40px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0; }

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