/* STATUS: REVIEW */

/* ── TOKENS ── spec §2.1 ── */
:root {
  --ink-950: #0B1220;
  --ink-900: #101A2E;
  --ink-800: #182642; /* Fixed tripwire T-01 */
  --line-500: #2A3B5C;
  --draft-300: #8FA7C8;
  --paper-050: #EAF0F8;
  --cyan-400: #4FD1E8;
  --amber-500: #F5A524;

  /* Space Scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 96px;

  /* Type Scale (rem) */
  --ts-1: 0.75rem;
  --ts-2: 0.875rem;
  --ts-3: 1rem;
  --ts-4: 1.25rem;
  --ts-5: 1.563rem;
  --ts-6: 2.441rem;
  --ts-7: 3.815rem;
}

/* ── FONTS ── spec §2.3 ── */
/* Neil must update paths if they differ */
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter/Inter-VariableFont_opsz,wght.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/IBM_Plex_Mono/IBMPlexMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--ink-950);
  color: var(--paper-050);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--ts-3);
  line-height: 1.6;
  max-width: 100%;
  overflow-x: hidden;
}

/* Drafting Grid Background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 16px, rgba(42, 59, 92, 0.08) 16px, rgba(42, 59, 92, 0.08) 17px),
    repeating-linear-gradient(90deg, transparent, transparent 16px, rgba(42, 59, 92, 0.08) 16px, rgba(42, 59, 92, 0.08) 17px),
    repeating-linear-gradient(0deg, transparent, transparent 64px, rgba(42, 59, 92, 0.12) 64px, rgba(42, 59, 92, 0.12) 65px),
    repeating-linear-gradient(90deg, transparent, transparent 64px, rgba(42, 59, 92, 0.12) 64px, rgba(42, 59, 92, 0.12) 65px);
  z-index: -1;
  pointer-events: none;
}

h1, h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--s4) 0; }
h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); }
h2 { font-size: var(--ts-6); }
h3 { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: var(--ts-4); margin: 0 0 var(--s2) 0; }
p { margin: 0 0 var(--s3) 0; max-width: 68ch; }
a { color: var(--cyan-400); text-decoration: none; }

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--amber-500);
  color: var(--ink-950);
  padding: var(--s2);
  z-index: 1000;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--paper-050);
  outline-offset: 2px;
}

/* Highlight words in hero */
.hl {
  color: var(--cyan-400);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--amber-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
/* ── COMPONENT: Header ── spec §2.6 ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(24, 38, 66, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-500);
  z-index: 100;
  display: flex;
  align-items: center;
}
.header__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordmark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--paper-050);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.wordmark__rev {
  font-size: 0.6rem;
  border: 1px solid var(--amber-500);
  color: var(--amber-500);
  padding: 2px 4px;
  border-radius: 2px;
}
.nav__list {
  list-style: none;
  display: flex;
  gap: var(--s5);
  margin: 0; padding: 0;
}
.nav__link {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--ts-2);
  color: var(--draft-300);
  position: relative;
  padding-bottom: 4px;
}
.nav__link.is-active, .nav__link:hover {
  color: var(--paper-050);
}
.nav__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan-400);
}

.nav-toggle { display: none; background: none; border: none; color: var(--paper-050); cursor: pointer; }

/* ── COMPONENT: Section Labels ── spec §2.4 ── */
.section {
  padding: var(--s8) var(--s5);
  position: relative;
}
.section--alt {
  background: var(--ink-900);
  border-top: 1px solid var(--line-500);
  border-bottom: 1px solid var(--line-500);
}
.section--contact {
  padding-bottom: var(--s5); /* Reduced bottom space */
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}
.center-content { text-align: center; display: flex; flex-direction: column; align-items: center; }
.max-width-text { max-width: 800px; }

.section-label { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.section-label__text {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: var(--ts-1);
  letter-spacing: 0.15em;
  color: var(--cyan-400);
}
.section-label__rule {
  width: 32px;
  height: 1px;
  background: var(--line-500);
  position: relative;
}
.section-label__rule::before, .section-label__rule::after {
  content: '';
  position: absolute;
  top: -2px;
  width: 1px;
  height: 5px;
  background: var(--line-500);
}
.section-label__rule::before { left: 0; }
.section-label__rule::after { right: 0; }

/* ── COMPONENT: Buttons ── spec §2.5 ── */
.hero__actions { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--ts-2);
  border-radius: 2px;
  transition: transform 150ms ease, background-color 150ms ease;
  position: relative;
  text-align: center;
}
.btn::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}
.btn--primary {
  background: var(--amber-500);
  color: var(--ink-950);
}
.btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn--secondary {
  background: transparent;
  color: var(--cyan-400);
  border: 1px solid var(--cyan-400);
  padding: 13px 27px;
}
.btn--secondary:hover {
  background: rgba(79, 209, 232, 0.1);
}

/* ── COMPONENT: Cards ── spec §2.7 ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s4);
}
.card {
  background: var(--ink-900);
  border: 1px solid var(--line-500);
  border-radius: 2px;
  padding: var(--s5);
  position: relative;
  transition: border-color 150ms ease;
}
.section--alt .card { background: var(--ink-950); }
.card:hover { border-color: rgba(79, 209, 232, 0.6); }

.card__corner {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--cyan-400);
  border-right: 1px solid var(--cyan-400);
}

.card__label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: var(--ts-1);
  color: var(--cyan-400);
  margin-bottom: var(--s2);
}
.card__desc { font-size: var(--ts-2); color: var(--draft-300); }

.metric { margin-top: var(--s3); }
.metric__fig {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: var(--ts-5);
  color: var(--amber-500);
}
.metric__ctx {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--ts-1);
  color: var(--draft-300);
}

/* ── SECTION: Hero ── spec §2.2, §3 ── */
.section--hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 480px 1fr 350px;
  align-items: center;
  gap: var(--s6);
  padding-top: 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero__photo {
  width: 100%;
  height: 600px;
  border: 1px solid var(--line-500);
  background: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--draft-300);
  font-family: 'IBM Plex Mono', monospace;
  overflow: hidden;
}

.hero__content { 
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 100%; 
}

.hero__visual {
  width: 100%;
  max-width: 350px;
  opacity: 0.8;
  align-self: center;
}
.hero__visual svg { width: 100%; height: auto; }

.hero__positioning { font-size: var(--ts-5); font-weight: 600; margin-bottom: var(--s3); }
.hero__subline { color: var(--draft-300); }

/* ── SECTION: Practice / Toolbox ── */
.toolbox { margin-top: var(--s6); }
.toolbox__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--ts-2);
  color: var(--cyan-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--s3);
}
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s2);
}
.toolbox-item {
  border: 1px solid var(--line-500);
  padding: var(--s2) var(--s3);
  text-align: center;
  font-size: var(--ts-2);
  color: var(--draft-300);
  background: var(--ink-950);
}

/* ── COMPONENT: Footer ── spec §4 SHT-05 ── */
.footer {
  border-top: 1px solid var(--line-500);
  background: var(--ink-900);
  padding: var(--s4) 0;
}
.footer__titleblock {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--ts-1);
  color: var(--draft-300);
  text-transform: uppercase;
}

/* ── UTILITIES: Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .section--hero {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: auto;
    text-align: left;
    padding-top: 100px;
  }
  .hero__photo {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 4 / 5; 
  }
  .hero__content {
    width: 100%;
    margin-top: var(--s5);
  }
  .hero__visual {
    margin-top: var(--s5);
  }
}

@media (max-width: 480px) {
  body::before { display: none; }
  .section { padding: var(--s6) var(--s3); }
  .footer__titleblock { flex-direction: column; }
  .toolbox-grid { grid-template-columns: repeat(2, 1fr); }
}

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