/* GrayMoon website. One stylesheet, no build step. ASCII hyphens only. */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/cinzel-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
}

:root {
  --bg: #111113;
  --bg-raised: #17171a;
  --bg-code: #0c0c0e;
  --line: #2a2a2f;
  --line-strong: #3a3a42;
  --text: #d4d4d8;
  --text-strong: #f2f2f3;
  --text-dim: #9c9ca4;
  --text-muted: #70707a;
  --moon: #e7e7e7;
  --moon-shade: #c0c0c0;
  --green: #89d185;
  --amber: #e2b340;

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-brand: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;

  --wrap: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(5rem, 11vw, 9rem);
  --radius: 10px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: #5a5a5a transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, ol, ul, figure, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-strong);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: clamp(3.1rem, 9vw, 6.5rem); line-height: 0.96; }
h2 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); line-height: 1.05; }
h3 { font-size: 1.125rem; font-weight: 600; color: var(--text-strong); line-height: 1.3; }

p { text-wrap: pretty; }

a { color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; transition: text-decoration-color 0.15s; }
a:hover { color: var(--text-strong); text-decoration-color: var(--moon); }

code { font-family: var(--font-mono); font-size: 0.88em; color: var(--moon); }
p code { padding: 0.1em 0.38em; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-raised); white-space: nowrap; }

:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.6); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--moon); color: var(--bg); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(760px + 2 * var(--gutter)); }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.5rem 0.9rem; background: var(--moon); color: var(--bg); border-radius: 6px; text-decoration: none; }
.skip:focus { top: 1rem; color: var(--bg); }

.eyebrow {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.975rem/1.2 var(--font-body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--moon); color: #111113; }
.btn--primary:hover { background: #ffffff; color: #111113; }
.btn--ghost { border-color: var(--line-strong); color: var(--text-strong); background: rgba(17, 17, 19, 0.5); }
.btn--ghost:hover { border-color: var(--text-dim); color: var(--text-strong); }
.btn--small { padding: 0.5rem 0.95rem; font-size: 0.875rem; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 17, 19, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav__row { display: flex; align-items: center; gap: 2rem; height: 4rem; }
.nav__links { display: flex; gap: 1.9rem; margin-left: auto; }
.nav__links a { font-size: 0.9rem; color: var(--text-dim); text-decoration: none; white-space: nowrap; transition: color 0.15s; }
.nav__links a:hover { color: var(--text-strong); }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--text-strong); }
.brand img { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-brand); font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; }
.brand__name::first-letter, .brand__name span::first-letter { font-size: 1.28em; }
.brand__name span { display: inline-block; }

/* Hero */
.hero { position: relative; padding-top: clamp(4.5rem, 11vw, 8.5rem); padding-bottom: var(--section); overflow: hidden; }
.hero__sky { position: absolute; inset: 0; pointer-events: none; }
.hero__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 62%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 9%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 41%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 69% 14%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 83% 33%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 71%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 83%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 88%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 92%, rgba(255, 255, 255, 0.3) 50%, transparent 51%);
  background-size: 620px 520px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 78%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 78%);
}
.hero__moon {
  position: absolute;
  left: 50%;
  top: clamp(-9rem, -8vw, -3rem);
  width: min(980px, 150vw);
  aspect-ratio: 1;
  margin-left: calc(min(980px, 150vw) / -2);
  border-radius: 50%;
  box-shadow: 0 0 140px 10px rgba(231, 231, 231, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.05);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 82%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 82%);
  overflow: hidden;
}
.hero__moon img { width: 100%; height: 100%; animation: moon-turn 420s linear infinite; }
.hero__moon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 12%, rgba(255, 255, 255, 0.13), transparent 46%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.45), transparent 62%);
}
@keyframes moon-turn { to { transform: rotate(360deg); } }

.hero__copy { position: relative; text-align: center; }
.hero__copy h1 { text-shadow: 0 2px 40px rgba(17, 17, 19, 0.85); }
.lede { max-width: 43rem; margin: 1.9rem auto 0; font-size: clamp(1.075rem, 1.6vw, 1.275rem); line-height: 1.6; color: var(--text); text-shadow: 0 1px 24px rgba(17, 17, 19, 0.9); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem; margin-top: 2.4rem; }
.hero__note { margin-top: 1.4rem; font-size: 0.875rem; color: var(--text-dim); }

.hero__shot { position: relative; margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.caption { max-width: 40rem; margin: 1.25rem auto 0; text-align: center; font-size: 0.9rem; color: var(--text-muted); }

/* Screenshots */
.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #1e1e1e;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s, transform 0.3s ease;
}
.shot:hover { border-color: #5a5a62; }
.shot img { width: 100%; }
.shot--hero { border-radius: 12px; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 0 90px -20px rgba(231, 231, 231, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.6); }

/* Sections */
.section-head { max-width: 46rem; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.section-head__sub { margin-top: 1.25rem; color: var(--text-dim); font-size: 1.1rem; }

.statement { padding-block: clamp(2rem, 5vw, 4rem) var(--section); text-align: center; }
.statement h2 { margin-bottom: 2rem; }
.statement p:not(.eyebrow) { font-size: clamp(1.075rem, 1.5vw, 1.2rem); color: var(--text-dim); }
.statement p + p { margin-top: 1.25rem; }
.statement p:last-child { color: var(--text-strong); }

/* Flow: moon phases */
.flow { padding-block: var(--section) clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); background: linear-gradient(to bottom, var(--bg-raised), var(--bg) 70%); }
.phases { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem; counter-reset: phase; }
.phase:not(:last-child)::before { content: ''; position: absolute; left: 44px; right: -2rem; top: 22px; height: 1px; background: var(--line-strong); }
.phase { position: relative; counter-increment: phase; }
.phase__moon { position: relative; display: block; width: 44px; height: 44px; margin-bottom: 1.6rem; border-radius: 50%; background: var(--bg); }
.phase__moon .dark { fill: #1c1c20; stroke: var(--line-strong); stroke-width: 1; }
.phase__moon .lit { fill: var(--moon); }
.phase:last-child .phase__moon { filter: drop-shadow(0 0 14px rgba(231, 231, 231, 0.35)); }
.phase h3 { margin-bottom: 0.55rem; }
.phase h3::before { content: '0' counter(phase); display: block; margin-bottom: 0.5rem; font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.12em; color: var(--text-muted); }
.phase p { font-size: 0.95rem; line-height: 1.55; color: var(--text-dim); }

/* Look inside */
.look { padding-block: var(--section); }
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.feature + .feature { margin-top: clamp(4.5rem, 9vw, 7.5rem); }
.feature--flip .feature__text { order: 2; }
.feature--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); }
.feature__text h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 2.8vw, 2.25rem); line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1.1rem; text-wrap: balance; }
.feature__text p { color: var(--text-dim); }
.ticks { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.ticks li { position: relative; padding-left: 1.5rem; font-size: 0.95rem; color: var(--text); }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 9px; height: 9px; border-radius: 50%; background: var(--moon); box-shadow: inset -3px 0 0 var(--moon-shade); }

/* Workspace */
.workspace { padding-block: var(--section); border-block: 1px solid var(--line); background: var(--bg-raised); }
.workspace__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: clamp(2.5rem, 6vw, 5rem); }
.workspace h2 { margin-bottom: 1.75rem; }
.workspace p:not(.eyebrow) { color: var(--text-dim); }
.workspace p + p { margin-top: 1.1rem; }

.code { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-code); overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9); }
.code figcaption { padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); font: 0.8rem/1.2 var(--font-mono); color: var(--text-dim); }
.code pre { padding: 1.2rem 1.25rem 1.35rem; overflow-x: auto; }
.code code { display: block; font-size: 0.78rem; line-height: 1.7; color: var(--text-dim); white-space: pre; }
.code .k { color: var(--text-strong); }
.code .s { color: var(--green); }

/* Run */
.run { padding-block: var(--section); }
.run__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised); }
.card h3 { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; line-height: 1; }
.card p { color: var(--text-dim); font-size: 0.98rem; }
.card > .btn, .card > .cmd { margin-top: auto; }
.tag { padding: 0.28rem 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; font: 500 0.68rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }

.cmd { position: relative; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-code); }
.cmd pre { padding: 0.95rem 4.6rem 0.95rem 1rem; overflow-x: auto; scrollbar-width: thin; }
.cmd code { font-size: 0.8rem; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.cmd code span { white-space: nowrap; }
.cmd code::before { content: '$ '; color: var(--text-muted); }
.cmd__copy { position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.38rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg-raised); color: var(--text); font: 500 0.75rem/1.2 var(--font-body); white-space: nowrap; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.cmd__copy:hover { border-color: var(--text-dim); color: var(--text-strong); }
.cmd__copy.is-done { color: var(--green); border-color: var(--green); }

.run__next { margin-top: 2.25rem; color: var(--text-dim); }

/* Footer */
.footer { padding-block: 3.5rem 2.5rem; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--text-dim); }
.footer__row { display: flex; justify-content: space-between; gap: 3rem; flex-wrap: wrap; }
.footer__brand { max-width: 26rem; }
.footer__brand p { margin-top: 1rem; }
.footer__links { display: grid; grid-template-columns: repeat(2, auto); gap: 0.65rem 3rem; align-content: start; }
.footer__links a { color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.footer__links a:hover { color: var(--text-strong); }
.footer__legal { margin-top: 3rem; font-size: 0.8rem; color: var(--text-muted); }

/* Zoom dialog */
.zoom { width: min(96vw, 1800px); max-width: none; max-height: 94vh; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #1e1e1e; overflow: auto; }
.zoom::backdrop { background: rgba(5, 5, 6, 0.88); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.zoom img { width: 100%; cursor: zoom-out; }
.zoom__close { position: fixed; top: 1rem; right: 1rem; z-index: 1; padding: 0.5rem 0.95rem; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(17, 17, 19, 0.9); color: var(--text-strong); font: 500 0.85rem/1.2 var(--font-body); cursor: pointer; }
.zoom__close:hover { border-color: var(--text-dim); }

/* Reveal on scroll (only when JavaScript is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Narrower screens */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__row { justify-content: space-between; }
  .phases { grid-template-columns: 1fr; gap: 0; }
  .phase:not(:last-child)::before { left: 22px; right: auto; top: 44px; bottom: 0; width: 1px; height: auto; }
  .phase { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 1.4rem; padding-bottom: 2.25rem; }
  .phase:last-child { padding-bottom: 0; }
  .phase__moon { grid-row: 1 / span 2; margin-bottom: 0; }
  .phase h3, .phase p { grid-column: 2; }
  .feature, .feature--flip, .workspace__grid, .run__grid { grid-template-columns: minmax(0, 1fr); }
  .feature--flip .feature__text { order: 0; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .hero__actions .btn { flex: 1 1 100%; }
  .footer__links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__moon img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .shot { transition: none; }
}
