/* ============================================================
   wckd — the art of perspective
   Plain CSS. Desktop-first, stacks below 768px.
   ============================================================ */

/* ---------- Design tokens ---------- */

:root {
  /* Canvas & washes */
  --canvas: #08090b;
  --surface-lowest: #0d0e10;
  --surface-low: #1b1c1e;
  --surface: #1f2022;
  --surface-high: #292a2c;
  --surface-highest: #343537;

  /* Ink & linework */
  --outline: #97917a;
  --outline-variant: #4b4734;
  --on-surface: #e3e2e5;
  --on-surface-variant: #cec6ad;

  /* Trust progression */
  --stranger: #475569;
  --noticed: #94a3b8;
  --warming: #e2e8f0;
  --familiar: #fed7aa;
  --aligned: #fde047;
  --on-aligned: #08090b;

  /* Typography */
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --margin-sm: 1rem;
  --margin: 1.5rem;
  --margin-lg: 3rem;

  /* Breakpoints */
  --bp-tablet: 1024px;
  --bp-mobile: 768px;
}

/* ---------- Base ---------- */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--canvas);
}

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
  font-weight: 400;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

::-webkit-scrollbar {
  display: none;
}

/* ---------- Stage ---------- */

.stage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--surface-lowest);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 3.5rem;
  background: color-mix(in srgb, var(--surface-lowest) 95%, transparent);
  border-bottom: 1px solid var(--surface);
}

.header-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margin);
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--on-surface);
}

.brand-room {
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px dashed var(--outline-variant);
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.meta-chip-accent {
  color: var(--aligned);
}

.meta-hz {
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.meta-sep {
  color: var(--outline-variant);
}

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

.layout {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Atmospheric drafting grid */
.drafting-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
  background-image: radial-gradient(var(--outline) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- Terminal pane ---------- */

.terminal-pane {
  width: 420px;
  max-width: 35%;
  display: flex;
  flex-direction: column;
  padding: var(--margin);
  z-index: 20;
  position: relative;
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  border-right: 1px solid var(--surface);
}

/* Vertically centered group: dialogue + reflection. Only the
   unlocked-nav sits at the bottom of the pane. */
.dialectic {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-lg);
}

.dialogue {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.dialogue-heading {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.icon-cyclone {
  font-size: 14px;
  color: var(--aligned);
}

.dialogue-body {
  min-height: 110px;
}

.typewriter {
  font-size: 15px;
  line-height: 24px;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--on-surface);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--aligned);
  margin-bottom: -2px;
  animation: cursor-blink 1.1s steps(2, end) infinite;
}

@keyframes cursor-blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ---------- Reflection input ---------- */

.reflection {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.reflection-input-wrap {
  position: relative;
  background: var(--surface-low);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
}

.reflection-input-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: 13px;
  line-height: 20px;
}

.prompt-mark {
  color: var(--aligned);
}

.reflection-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  color: var(--on-surface);
  caret-color: var(--aligned);
}

.reflection-input::placeholder {
  color: var(--stranger);
}

.reflection-input:focus {
  border-color: var(--aligned);
}

.return-hint {
  position: absolute;
  right: var(--space-sm);
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.icon-return {
  font-size: 12px;
}

/* ---------- Triggers ---------- */

.triggers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
}

.trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: var(--space-sm) var(--space-xs);
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 0;
  color: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.trigger:hover {
  background: var(--surface-high);
}

.trigger-confess:hover {
  color: var(--aligned);
}

.trigger-deflect {
  color: var(--outline);
}

.trigger-deflect:hover {
  color: var(--on-surface);
}

.trigger-mark {
  color: var(--aligned);
}

/* ---------- Unlocked nav ---------- */

.unlocked-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: color-mix(in srgb, var(--surface-low) 50%, transparent);
  border: 1px solid var(--outline-variant);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.unlocked-nav[hidden] {
  display: none;
}

.unlocked-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.unlocked-heading {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aligned);
}

.unlocked-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aligned);
  animation: dot-ping 1.4s ease-in-out infinite;
}

@keyframes dot-ping {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.unlocked-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.link-back {
  color: var(--outline);
  text-decoration: none;
  transition: color 150ms ease;
}

.link-back:hover {
  color: var(--on-surface);
}

.link-sep {
  color: var(--outline-variant);
}

.link-forward {
  color: var(--aligned);
  font-weight: 700;
  text-decoration: none;
  transition: text-decoration 150ms ease;
}

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

/* ---------- Art pane ---------- */

.art-pane {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-lowest);
}

.art-placeholder {
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--outline);
}

/* ---------- Footer ---------- */

.site-footer {
  z-index: 50;
  height: 3rem;
  background: color-mix(in srgb, var(--surface-lowest) 95%, transparent);
  border-top: 1px solid var(--surface);
  box-sizing: border-box;
}

.footer-inner {
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margin);
  font-size: 9px;
  line-height: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-link {
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-link:hover {
  color: var(--on-surface);
}

.footer-link-active {
  color: var(--aligned);
  font-weight: 700;
}

.footer-sep {
  color: var(--outline-variant);
}

.footer-tagline {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--outline);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tagline-what {
  color: var(--on-surface);
}

.tagline-sep {
  color: var(--outline-variant);
}

.tagline-jp {
  color: var(--on-surface);
}

/* ============================================================
   Responsive — desktop-first
   ============================================================ */

/* Tablet: 768px – 1023px — consolidate, keep side-by-side */
@media (min-width: 768px) and (max-width: 1023px) {
  .terminal-pane {
    width: 340px;
    max-width: 40%;
  }
}

/* Mobile: < 768px — stack vertically, terminal on top */
@media (max-width: 767px) {
  .layout {
    flex-direction: column;
  }

  .terminal-pane {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--surface);
    padding: var(--margin-sm);
  }

  .art-pane {
    min-height: 320px;
  }

  .header-inner {
    padding: 0 var(--margin-sm);
  }

  .header-meta {
    display: none;
  }

  .triggers {
    grid-template-columns: 1fr 1fr;
  }

  .trigger {
    min-height: 44px;
  }

  .reflection-input {
    min-height: 44px;
  }

  .footer-inner {
    padding: 0 var(--margin-sm);
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    min-height: 3rem;
    height: auto;
  }

  .footer-tagline {
    white-space: nowrap;
  }
}