/* StudioOS landing page
 *
 * Minimal and technical: a near-black canvas, hairline borders, monochrome
 * controls. Colour appears only where the product itself uses it, on card
 * categories in the demo board. Drafts are dashed and dim; anything the user
 * has locked is solid and bright.
 */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Surfaces */
  --canvas: #0a0a0a;
  --surface: #111111;
  --surface-raised: #171717;
  --line: #262626;
  --line-strong: #3a3a3a;

  /* Text */
  --text: #fafafa;
  --text-body: #d4d4d4;
  --text-muted: #a1a1a1;
  --text-faint: #8a8a8a;

  /* Controls */
  --control: #e5e5e5;
  --control-hover: #ffffff;
  --control-text: #0a0a0a;

  /* Card categories, from the StudioOS app */
  --character: #9b87ff;
  --mechanic: #5b9bff;
  --place: #3ecf8e;

  /* Feedback */
  --success: #3ecf8e;
  --error: #ff6b6b;
  --focus: #fafafa;

  /* Type */
  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-h3: 1.1875rem;
  --text-h2: clamp(1.875rem, 1.4rem + 1.8vw, 2.5rem);
  --text-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);

  /* Space */
  --gutter: clamp(1rem, 4vw, 2rem);
  --max-width: 72rem;
  --section: clamp(6rem, 4rem + 8vw, 11rem);
  --radius-button: 8px;
  --radius-card: 10px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-body);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #fafafa;
  color: #0a0a0a;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure,
pre {
  margin: 0;
}

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

a:hover {
  text-decoration-color: currentColor;
}

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

/* Cursor dots: the same dot grid as the demo board, revealed only around the
   pointer and trailing slightly behind it. Positions are set from app.js; it
   only appears on devices with a fine pointer and without reduced motion. */

.dots {
  --x: 50vw;
  --y: 30vh;

  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(255 255 255 / 30%) 1px, transparent 1.3px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(15rem circle at var(--x) var(--y), #000 0%, rgb(0 0 0 / 45%) 40%, transparent 100%);
  mask-image: radial-gradient(15rem circle at var(--x) var(--y), #000 0%, rgb(0 0 0 / 45%) 40%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms var(--ease);
}

.dots.is-on {
  opacity: 1;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
}

.label {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-button);
  background: var(--control);
  color: var(--control-text);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

main:focus {
  outline: none;
}

/* Type */

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h3 {
  font-size: var(--text-h3);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

/* Controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--control);
  border-radius: var(--radius-button);
  background: var(--control);
  color: var(--control-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease);
}

.button:hover {
  border-color: var(--control-hover);
  background: var(--control-hover);
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.button--ghost:hover {
  border-color: var(--text-muted);
  background: var(--surface-raised);
}

.button[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

.text-button:hover {
  text-decoration-color: currentColor;
}

/* Navigation */

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

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark__mark {
  width: 1.25rem;
  height: 1.25rem;
}

.nav__end {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav__status {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hero */

.hero {
  padding-top: clamp(4rem, 2rem + 7vw, 8rem);
}

.hero__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.lede {
  max-width: 34em;
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.hero__aside {
  display: grid;
  gap: 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.hero__note {
  color: var(--text-faint);
  font-size: var(--text-sm);
}

/* Demo */

.demo {
  margin-top: clamp(3.5rem, 2rem + 5vw, 6rem);
}

.demo__window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 90%);
}

.demo__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.75rem;
}

.demo__frame {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr) minmax(15rem, 17rem);
  min-height: 28rem;
}

.demo__chat {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1.25rem;
  border-right: 1px solid var(--line);
}

.chat {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

.msg--you {
  margin-left: 1.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  color: var(--text);
}

.msg--agent {
  color: var(--text-muted);
}

.changes {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.65rem;
  padding: 0.6rem 0 0;
  border-top: 1px dashed var(--line-strong);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  list-style: none;
}

.changes li::before {
  content: "+ ";
  color: var(--text);
}

.demo__board {
  position: relative;
  min-height: 24rem;
  background-color: var(--canvas);
  background-image: radial-gradient(#242424 1px, transparent 1.2px);
  background-size: 20px 20px;
}

.links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.link {
  fill: none;
  stroke: #4a4a4a;
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
}

.node {
  --node-width: 12rem;

  position: absolute;
  top: var(--y);
  /* Keep every card inside the board, whatever its width. */
  left: clamp(0.5rem, var(--x), calc(100% - var(--node-width) - 0.5rem));
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: var(--node-width);
  padding: 0.5rem 0.65rem 0.5rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.node[data-node="concept"] { --x: 6%; --y: 8%; }
.node[data-node="aria"] { --x: 55%; --y: 13%; }
.node[data-node="bounce"] { --x: 27%; --y: 45%; }
.node[data-node="arena"] { --x: 57%; --y: 73%; }

.node--concept { --tone: var(--text); }
.node--character { --tone: var(--character); }
.node--place { --tone: var(--place); }
.node--mechanic { --tone: var(--mechanic); }

.node__icon {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
}

.node__body {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.node__name {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.node__meta {
  color: var(--text-faint);
  font-size: 0.75rem;
}

.node__count {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: auto;
  padding-inline: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.node.is-draft {
  border-style: dashed;
  background: var(--canvas);
}

.node.is-draft .node__name {
  color: var(--text-muted);
}

.node.is-focused {
  outline: 1px solid var(--text-muted);
  outline-offset: 3px;
}

/* Drawer */

.demo__drawer {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem;
  border-left: 1px solid var(--line);
}

.drawer__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 500;
}

.node__icon--mechanic {
  --tone: var(--mechanic);
  width: 1.7rem;
  height: 1.7rem;
  padding: 0.3rem;
}

.drawer__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.8125rem;
}

.drawer__tabs span {
  padding-bottom: 0.5rem;
}

.drawer__tabs .is-current {
  margin-bottom: -1px;
  border-bottom: 1px solid var(--text);
  color: var(--text);
}

/* A decision: dashed and dim while suggested, solid and bright once locked. */

.decision {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  transition: background-color 400ms var(--ease);
}

.decision::before,
.decision::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: opacity 400ms var(--ease);
}

.decision::before {
  border: 1px dashed var(--line-strong);
  opacity: 0;
}

.decision::after {
  border: 1px solid var(--text-muted);
  opacity: 1;
}

.decision__state {
  display: grid;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision__draft,
.decision__locked {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity 300ms var(--ease);
}

.decision__draft {
  color: var(--text-faint);
  opacity: 0;
}

.decision__locked {
  color: var(--text);
}

.decision__locked svg {
  width: 0.85rem;
  height: 0.85rem;
}

.decision__text {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  transition: color 400ms var(--ease);
}

.decision__why {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.decision:not(.is-locked) {
  background: var(--canvas);
}

.decision:not(.is-locked)::before { opacity: 1; }
.decision:not(.is-locked)::after { opacity: 0; }
.decision:not(.is-locked) .decision__text { color: var(--text-muted); }
.decision:not(.is-locked) .decision__draft { opacity: 1; }
.decision:not(.is-locked) .decision__locked { opacity: 0; }

.demo__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: var(--text-sm);
}

/* Demo sequence. Without JavaScript, or with reduced motion, the final state
   is shown as is. */

.demo.is-ready [data-step],
.demo.is-ready .link {
  opacity: 0;
}

.demo.is-playing [data-step] {
  animation: appear 480ms var(--ease) var(--at, 0ms) both;
}

.demo.is-playing .link {
  animation: appear 480ms var(--ease) 3500ms both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */

.section {
  padding-top: var(--section);
}

.section__head {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}

.section__close {
  max-width: 36em;
  margin-top: 2.5rem;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.5;
}

/* Hairline grids: cells share their borders, like one panel cut into parts. */

.grid {
  display: grid;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  list-style: none;
}

.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cell {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  /* Each cell draws its right and bottom rule; the outer ones fall under the
     grid's own border and are clipped. */
  margin: 0 -1px -1px 0;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
}

.cell__label {
  color: var(--text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.act h3 {
  margin-top: 0.25rem;
}

.files {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.65;
}

/* Status */

.status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.status__intro {
  max-width: 30em;
  color: var(--text-muted);
}

.spec {
  border-top: 1px solid var(--line);
}

.spec div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  padding-top: 0.15rem;
  color: var(--text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spec dd {
  color: var(--text);
  font-size: 0.9375rem;
}

/* Waitlist */

.waitlist {
  padding-bottom: var(--section);
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  padding: clamp(1.5rem, 1rem + 3vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.panel__intro {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.panel__intro p:not(.label) {
  max-width: 28em;
  color: var(--text-muted);
}

.form {
  display: grid;
  gap: 1.1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
}

.field input {
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-button);
  background: var(--canvas);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  transition: border-color 160ms var(--ease);
}

.field input::placeholder {
  color: #5e5e5e;
}

.field input:hover {
  border-color: #4a4a4a;
}

.field input:focus-visible {
  border-color: var(--text-muted);
  outline-offset: 1px;
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.consent input {
  width: 1rem;
  height: 1rem;
  margin: 0.2rem 0 0;
  accent-color: var(--control);
}

.turnstile:empty {
  display: none;
}

.form .button {
  justify-self: start;
}

.form__message {
  min-height: 1.5em;
  font-size: var(--text-sm);
}

.form__message.is-error {
  color: var(--error);
}

.form__message.is-success {
  color: var(--success);
}

.form.is-done .field,
.form.is-done .consent,
.form.is-done .turnstile,
.form.is-done .button {
  display: none;
}

.form.is-done .form__message {
  color: var(--text);
  font-size: var(--text-lg);
}

/* Footer */

.footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.footer__maker {
  color: var(--text-muted);
}

.footer__address {
  font-style: normal;
}

/* 404 */

.missing {
  display: grid;
  gap: 1.5rem;
  align-content: center;
  min-height: 80vh;
}

/* Laptop and tablet */

@media (max-width: 1080px) {
  .node {
    --node-width: 11rem;
  }

  .demo__frame {
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
  }

  .demo__drawer {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.9rem 1.5rem;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .drawer__tabs {
    align-self: end;
  }

  .decision {
    grid-column: 1 / -1;
    max-width: 30rem;
  }

  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero__intro,
  .status,
  .panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--3,
  .grid--2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone */

@media (max-width: 680px) {
  .nav__status {
    display: none;
  }

  .demo {
    padding-inline: 0;
  }

  .demo__window {
    border-inline: 0;
    border-radius: 0;
  }

  .demo__frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo__caption {
    padding-inline: var(--gutter);
  }

  .demo__chat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .demo__board {
    min-height: 21rem;
  }

  .node {
    --node-width: 10.5rem;
  }

  .node[data-node="concept"] { --x: 4%; --y: 5%; }
  .node[data-node="aria"] { --x: 50%; --y: 28%; }
  .node[data-node="bounce"] { --x: 5%; --y: 52%; }
  .node[data-node="arena"] { --x: 48%; --y: 77%; }

  .node__count {
    display: none;
  }

  .demo__drawer {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .spec div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
