/* cohdl.org — the precision-instrument visual system shared with the registry. */

:root {
  color-scheme: dark;
  --canvas: #070b11;
  --surface-1: #0e151f;
  --surface-2: #131d2a;
  --border-subtle: #1d2a3a;
  --border: #2a3b50;
  --border-strong: #405772;
  --text: #f5f7fb;
  --text-secondary: #a7b3c4;
  --text-tertiary: #8190a3;
  --accent: #62b5ff;
  --accent-hover: #8bc9ff;
  --accent-ink: #04111f;
  --cyan: #5de0d0;
  --violet: #a99aff;
  --positive: #6ee7ae;
  --negative: #ff8894;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 16% -8%, rgb(41 117 181 / 14%), transparent 34rem),
    radial-gradient(circle at 90% 12%, rgb(115 81 178 / 9%), transparent 30rem),
    var(--canvas);
  color: var(--text);
  font: 16px/1.62 var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* The faint horizontal rule grid of the registry, fading out down the page. */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgb(255 255 255 / 1.3%) 1px, transparent 1px);
  background-size: 100% 64px;
  mask-image: linear-gradient(to bottom, black, transparent 60%);
  pointer-events: none;
  content: "";
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.shell {
  width: min(100% - 2.5rem, 960px);
  margin-inline: auto;
  padding-block: 2rem 4rem;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(3rem, 9vw, 6rem);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
}

.brand-mark {
  flex: none;
  display: block;
  width: 25px;
  height: 25px;
  background: var(--accent);
  -webkit-mask: url("/logo.svg") center / contain no-repeat;
  mask: url("/logo.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgb(98 181 255 / 18%));
}

.brand-word {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(19 29 42 / 70%);
  color: var(--text-secondary);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px rgb(110 231 174 / 15%);
}

/* -------------------------------------------------------------------- hero */

.hero-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-title em {
  color: var(--accent);
  font-style: normal;
}

.hero-lede {
  max-width: 60ch;
  margin: 0 0 2.5rem;
  color: var(--text-secondary);
  font-size: clamp(1.02rem, 2.2vw, 1.15rem);
}

/* ---------------------------------------------------------- code specimen */

.code-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-1), rgb(10 16 24 / 92%));
  box-shadow: 0 18px 52px rgb(0 0 0 / 25%);
}

.code-caption {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(19 29 42 / 55%);
  font-size: 0.8rem;
}

.code-file {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.code-hint {
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code {
  margin: 0;
  padding: 1.2rem;
  overflow-x: auto;
  color: var(--text-secondary);
  font: 0.85rem/1.7 var(--font-mono);
  tab-size: 4;
}

.c-kw {
  color: var(--violet);
}

.c-ty {
  color: var(--text);
}

.c-at {
  color: var(--cyan);
}

.c-unit {
  color: var(--positive);
}

/* ------------------------------------------------------------------- proof */

.proof {
  margin-block: clamp(3.5rem, 10vw, 6rem);
}

.proof-list {
  display: grid;
  gap: 1.6rem 2.4rem;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none;
}

.proof-item {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.proof-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.proof-body {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* ------------------------------------------------------ closing CTA panel */

.cta-panel {
  padding: clamp(1.6rem, 5vw, 2.6rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 12% 0%, rgb(98 181 255 / 8%), transparent 22rem),
    var(--surface-1);
}

.cta-panel-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cta-panel-lede {
  max-width: 54ch;
  margin: 0 0 1.75rem;
  color: var(--text-secondary);
}

.cta-panel-lede code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* The signup form left the landing page with the v0.3.0 release; these rules
   (and js/main.js + the Worker endpoint) are kept until the waitlist's
   promised announcement email has been sent — see site/README.md. */
.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.signup-input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--canvas);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

.signup-input::placeholder {
  color: var(--text-tertiary);
}

.signup-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgb(98 181 255 / 18%);
}

.signup-button {
  flex: 0 0 auto;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    transform 0.15s var(--ease);
}

.signup-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.signup-button:active:not(:disabled) {
  transform: translateY(1px);
}

.signup-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Off-screen rather than display:none — some bots skip hidden inputs. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.install-line {
  margin: 0 0 1.4rem;
  padding: 0.8rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--canvas);
}

.install-line code {
  color: var(--text);
  font: 0.88rem/1.5 var(--font-mono);
  white-space: nowrap;
}

.signup-status {
  min-height: 1.4em;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
}

.signup-status[data-state="ok"] {
  color: var(--positive);
}

.signup-status[data-state="error"] {
  color: var(--negative);
}

.privacy {
  max-width: 52ch;
  margin: 1.5rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

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

.footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.87rem;
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.4rem;
}

.footer-brand {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.footer-sep {
  color: var(--border-strong);
}

.footer-fine {
  margin: 0;
}

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

.brand {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  align-items: center;
}

.site-nav-link {
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-nav-link:hover {
  color: var(--text);
  background: rgb(19 29 42 / 70%);
}

.site-nav-link[aria-current="page"] {
  color: var(--text);
  background: rgb(19 29 42 / 70%);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

/* ---------------------------------------------------- landing: hero CTAs */

.status-line {
  margin: 0 0 1.4rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 2.5rem;
}

.button-primary,
.button-ghost {
  display: inline-block;
  padding: 0.72rem 1.3rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}

.button-primary {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.button-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.button-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* --------------------------------------------------- landing: sections */

.pipeline {
  margin-block: clamp(3.5rem, 10vw, 6rem);
}

.section-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-lede {
  max-width: 60ch;
  margin: 0 0 2rem;
  color: var(--text-secondary);
}

.steps {
  display: grid;
  gap: 1.6rem 2.4rem;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
  counter-reset: step;
}

.step {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.step-no {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}

.step-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-body {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.step-body code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* --------------------------------------------------- landing: showcase */

.showcase {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.8rem);
  align-items: center;
  margin-block: clamp(3.5rem, 10vw, 6rem);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.showcase-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: 0 18px 52px rgb(0 0 0 / 25%);
}

.showcase-media img {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.showcase-copy .section-title {
  margin-bottom: 0.8rem;
}

.showcase-copy p {
  max-width: 54ch;
  margin: 0 0 1.4rem;
  color: var(--text-secondary);
}

.text-link {
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Comments and strings in code specimens. */
.c-cm {
  color: var(--text-tertiary);
  font-style: italic;
}

.c-str {
  color: var(--cyan);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
