/* Hedgehog splash page. Token values come from /DESIGN.md (single source). */

@font-face {
  font-family: "DM Serif Display";
  src: url("assets/fonts/dm-serif-display-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* DESIGN.md color tokens */
  --canvas: #101113;
  --surface: #181a1d;
  --surface-raised: #22252a;
  --border-subtle: #373c43;
  --text-primary: #f2f3f5;
  --text-secondary: #a8afb9;
  --accent-silver: #c6cdd6;
  --positive: #79b89c;

  --display: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cycle: 6.4s;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border-subtle) var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 18% 0%, rgba(198, 205, 214, 0.07), transparent 60%),
    radial-gradient(70% 60% at 80% 55%, rgba(198, 205, 214, 0.045), transparent 70%),
    var(--canvas);
  color: var(--text-primary);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-silver);
  color: var(--canvas);
}

a {
  color: inherit;
  text-underline-offset: 0.25em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 16px;
  background: var(--accent-silver);
  color: var(--canvas);
  font-weight: 600;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
  border-bottom: 1px solid rgba(55, 60, 67, 0.7);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
}

.brand-word {
  width: auto;
  height: 26px;
}

.nav ul {
  display: flex;
  gap: clamp(20px, 3.5vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a:not(.brand) {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 200ms var(--ease-out);
}

.nav a:not(.brand):hover {
  color: var(--text-primary);
}

/* ---------- Hero ---------- */

main {
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(32px, 4vw, 72px);
  padding: clamp(48px, 8vh, 104px) var(--gutter) clamp(56px, 9vh, 112px);
  max-width: 1600px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 28px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.75rem, 5.3vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* Brushed-silver face, matching the approved metallic wordmark. */
  background: linear-gradient(176deg, #ffffff 8%, #d9dee5 38%, #9aa2ad 62%, #e9ecf0 84%, #b9c0c9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.lede {
  max-width: 34ch;
  margin: 0 0 40px;
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 1.25vw, 1.25rem);
  line-height: 1.6;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  scroll-margin-top: 120px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px 15px 26px;
  border: 1px solid var(--accent-silver);
  border-radius: 6px;
  background: rgba(198, 205, 214, 0.04);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 240ms var(--ease-out),
    color 240ms var(--ease-out);
}

.cta svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms var(--ease-out);
}

.cta:hover {
  background: var(--accent-silver);
  color: var(--canvas);
}

.cta:hover svg {
  transform: translateX(3px);
}

.cta-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ---------- Workstation ---------- */

.station {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-margin-top: 40px;
}

.monitor {
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(160deg, #5b616a 0%, #24272c 22%, #131518 60%, #3a3f46 100%);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.85),
    0 18px 30px -18px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.screen {
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(90% 70% at 30% 0%, rgba(198, 205, 214, 0.06), transparent 70%),
    var(--canvas);
  border: 1px solid #08090a;
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(55, 60, 67, 0.6);
}

.window-bar img {
  height: 13px;
  width: auto;
  opacity: 0.9;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots i {
  width: 10px;
  height: 1.5px;
  background: var(--text-secondary);
  opacity: 0.6;
}

.window-body {
  display: flex;
  min-height: clamp(200px, 22vw, 320px);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 14px 8px;
  list-style: none;
  border-right: 1px solid rgba(55, 60, 67, 0.6);
}

.rail li {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-secondary);
}

.rail li.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
}

.rail svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow {
  flex: 1;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 36px) clamp(16px, 2.2vw, 32px);
}

.flow-title {
  margin: 0 0 clamp(20px, 3vw, 40px);
  font-size: clamp(1rem, 1.5vw, 1.375rem);
  font-weight: 450;
  color: var(--text-primary);
}

.stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(14px, 1.6vw, 22px) 8px clamp(14px, 1.4vw, 20px);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  text-align: center;
  animation: stage-pulse var(--cycle) var(--ease-out) infinite both;
}

.stage:nth-child(2) { animation-delay: calc(var(--cycle) * 0.25); }
.stage:nth-child(3) { animation-delay: calc(var(--cycle) * 0.5); }
.stage:nth-child(4) { animation-delay: calc(var(--cycle) * 0.75); }

/* Connector chevron between stages. */
.stage + .stage::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(18px, 2vw, 30px) / 2 - 4px);
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid var(--text-secondary);
  border-right: 1.5px solid var(--text-secondary);
  transform: translateY(-50%) rotate(45deg);
}

.stage svg {
  width: clamp(22px, 2.2vw, 30px);
  height: clamp(22px, 2.2vw, 30px);
  margin-bottom: 4px;
  fill: none;
  stroke: var(--accent-silver);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage strong {
  font-size: clamp(0.75rem, 0.95vw, 0.9375rem);
  font-weight: 500;
}

.stage span {
  color: var(--text-secondary);
  font-size: clamp(0.625rem, 0.72vw, 0.75rem);
  line-height: 1.35;
}

/* One authored moment: an order travels the flow, stage by stage. */
@keyframes stage-pulse {
  0%,
  26%,
  100% {
    border-color: var(--border-subtle);
    box-shadow: 0 0 0 0 rgba(198, 205, 214, 0);
  }
  6% {
    border-color: var(--accent-silver);
    box-shadow:
      0 10px 24px -12px rgba(0, 0, 0, 0.9),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
}

.stand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.neck {
  width: 16%;
  height: clamp(28px, 4vw, 56px);
  background: linear-gradient(90deg, #2a2d32, #6b727c 45%, #2a2d32);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}

.foot {
  width: 34%;
  height: 8px;
  border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, #7b828c, #2a2d32);
  box-shadow: 0 18px 30px -8px rgba(0, 0, 0, 0.9);
}

/* ---------- Principles ---------- */

.principles {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 9vh, 96px);
}

.principles ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 36px 0 0;
  list-style: none;
  border-top: 1px solid var(--border-subtle);
}

.principles li {
  display: flex;
  gap: 20px;
  padding: 0 clamp(20px, 3vw, 48px);
}

.principles li:first-child {
  padding-left: 0;
}

.principles li + li {
  border-left: 1px solid var(--border-subtle);
}

.principles svg {
  flex: none;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.principles h2 {
  margin: 2px 0 8px;
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.principles p {
  margin: 0;
  max-width: 40ch;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

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

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 22px var(--gutter);
  border-top: 1px solid rgba(55, 60, 67, 0.6);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.foot-bar p {
  margin: 0;
}

/* ---------- Entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .station {
    animation: rise 900ms var(--ease-out) both;
  }

  .station {
    animation-delay: 120ms;
  }

  @keyframes rise {
    from {
      opacity: 0.001;
      transform: translateY(14px);
      filter: blur(4px);
    }
  }
}

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

  .stage {
    animation: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.75rem, 8.4vw, 5rem);
  }

  .lede {
    max-width: 44ch;
  }

  .station {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
  }

  .principles ul {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .principles li,
  .principles li:first-child {
    padding: 0;
  }

  .principles li + li {
    border-left: 0;
  }
}

@media (max-width: 640px) {
  h1 span {
    white-space: normal;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .nav ul {
    gap: 22px;
  }

  .brand-word {
    height: 20px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

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

  .stage:nth-child(3)::before {
    display: none;
  }

  .stage strong {
    font-size: 0.875rem;
  }

  .stage span {
    font-size: 0.75rem;
  }

  .rail {
    display: none;
  }
}
