/* ==========================================================================
   theme.css — "Flat Blueprint / Technical Drawing"
   Extracted from the routre landing page (docs/index.html).
   Standalone. No @import, no external CSS, no dependency on routre files.

   FONTS (link these in your <head>; this file loads nothing):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap">

   Navy void, 1px hairline borders, uppercase mono labels, orange accent,
   blocky pixel headings, hover lift + accent border.
   ========================================================================== */

/* ===== TOKENS (verbatim from routre :root) ===== */
:root {
  --paper: #12101f;
  --paper-2: #1b1830;
  --paper-3: #0c0a18;
  --ink: #f0e6d2;
  --steel: #c9b896;
  --steel-dim: #7d7466;
  --hairline: #4a3f5c;
  --hairline-soft: rgba(202, 138, 4, 0.3);
  --accent: #ca8a04;
  --accent-soft: rgba(202, 138, 4, 0.12);
  --torch: #ff7a3d;
  --ok: #7bc96f;
  --px: "Press Start 2P", monospace;
  --mono: "VT323", ui-monospace, monospace;
  --sans: "VT323", ui-monospace, monospace;
  --ease: 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  /* z-layers: bg 0 · content 1 · fx 2 · nav 40 · menu 50 */
  --z-content: 1;
  --z-fx: 2;
  --z-nav: 40;
  --nav-h: 62px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--paper); scroll-padding-top: 76px; }

body {
  font-family: var(--sans);
  font-size: 20px;
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== BACKGROUND LAYERS (z 0 / z 2, pointer-events none) ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(202, 138, 4, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(202, 138, 4, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 92%);
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 92%);
}
.scanlines {
  position: fixed;
  inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
}

/* ===== PAGE SHELL ===== */
.page { position: relative; z-index: var(--z-content); }
.container { position: relative; z-index: var(--z-content); max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(52px, 6vw, 76px) 0 clamp(60px, 7vw, 88px); }
.hairline { height: 1px; border: 0; background: var(--hairline-soft); }

/* ===== TOP NAV ===== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(18, 16, 31, 0.94);
  border-bottom: 1px solid transparent;
}
.topnav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-logo { font-family: var(--mono); font-size: 0.98rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.logo-dot { color: var(--accent); }
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--hairline-soft);
  padding: 5px 10px;
}
.nav-links { list-style: none; display: flex; gap: 2px; }
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--steel);
  transition: color var(--ease), background-color var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.led { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; }
.led-green { background: var(--ok); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .led-green { animation: led-pulse 2.2s var(--ease) infinite; }
  @keyframes led-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    60% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  }
}

/* ===== HERO ===== */
.hero { min-height: 100dvh; display: flex; align-items: center; position: relative; }
.hero-inner { width: 100%; max-width: 600px; padding-top: 56px; }
.hero-name {
  font-family: var(--px);
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  line-height: 1.55;
  margin-bottom: 18px;
  text-wrap: balance;
}
.hero-title { font-size: clamp(1.05rem, 1.7vw, 1.25rem); font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.hero-sub { font-size: 1.05rem; color: var(--steel); max-width: 500px; margin-bottom: 22px; text-wrap: balance; }

/* ===== KICKERS & SECTION HEADINGS ===== */
.kicker {
  display: inline-block;
  font-family: var(--px);
  font-size: 0.58rem;
  line-height: 1.9;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--hairline-soft);
  padding: 6px 12px;
  margin-bottom: 16px;
}
.kicker b { color: var(--accent); font-weight: inherit; }
.section-title { font-family: var(--px); font-size: clamp(0.95rem, 2.6vw, 1.4rem); line-height: 1.7; margin-bottom: 18px; text-wrap: balance; }
.section-rule { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(20px, 3vw, 30px); }
.section-rule::before, .section-rule::after { content: ""; flex: 1; height: 1px; background: var(--hairline-soft); }

/* ===== CARD GRID ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }

/* ===== CORNER-BRACKET ACCENT (add to any bordered box) ===== */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid var(--accent);
  transition: width 0.5s var(--ease), height 0.5s var(--ease);
  pointer-events: none;
}
.bracket::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.bracket::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.bracket:hover::before, .bracket:hover::after { width: 22px; height: 22px; }

/* ===== PROJECT CARD ===== */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  background: rgba(27, 24, 48, 0.45);
  border: 1px solid var(--hairline-soft);
  padding: 24px 24px 20px;
  text-decoration: none;
  transition: border-color var(--ease), background-color var(--ease), transform var(--ease);
}
.card:hover { border-color: var(--accent); background: rgba(27, 24, 48, 0.9); transform: translateY(-2px); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-index { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.18em; color: var(--steel-dim); }
.card-name { font-family: var(--px); font-size: 0.9rem; line-height: 1.7; text-wrap: balance; }
.card-desc { font-size: 1.05rem; line-height: 1.6; color: var(--steel); text-wrap: pretty; }

/* ===== META / MONO LABEL ROWS ===== */
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; }
.meta-row { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline-soft); }
.meta-label {
  flex: 0 0 34%;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
}
.meta-value { font-size: 0.96rem; color: var(--ink); overflow-wrap: anywhere; }
.mono-tag { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--steel-dim); }

/* ===== TAG CHIPS (skills) ===== */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--hairline-soft);
  padding: 2px 8px;
  transition: color var(--ease), border-color var(--ease);
}
.card:hover .tag { color: var(--accent); border-color: rgba(255, 122, 61, 0.5); }

/* ===== DELIVERABLE LIST ===== */
.deliverables { list-style: none; }
.deliverables li { position: relative; padding-left: 16px; margin-bottom: 6px; font-size: 1rem; color: var(--steel); }
.deliverables li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}
.deliverables strong { color: var(--ink); font-weight: 600; }

/* ===== BUTTONS ===== */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 12px 22px;
  cursor: pointer;
  transition:
    border-color var(--ease), color var(--ease), background-color var(--ease),
    padding-left var(--ease), transform var(--ease);
}
.btn::before {
  content: "▸";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); padding-left: 26px; }
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 600; }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost { border-style: dashed; color: var(--steel); }
.btn-ghost:hover { border-style: solid; color: var(--accent); }

/* ===== FOOTER ===== */
.footer {
  position: relative;
  z-index: var(--z-content);
  border-top: 1px solid var(--hairline-soft);
  background: rgba(12, 10, 24, 0.96);
  padding: clamp(44px, 6vw, 68px) 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  padding: 24px 0;
}
.footer a { text-decoration: none; transition: color var(--ease); }
.footer a:hover { color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  /* no hamburger in this build: the links stay reachable as a scrollable row */
  .nav-status { display: none; }
  .nav-links {
    margin-left: auto;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 8px 9px; }
}
@media (max-width: 760px) {
  .container, .topnav-inner { padding: 0 20px; }
  .nav-logo { font-size: 0.8rem; }
  .section { padding: 44px 0 52px; }
  .nav-status { display: none; }
  .card-grid, .footer-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .meta-row { flex-direction: column; gap: 2px; }
  .meta-label { flex: none; }
}

/* ===== REDUCED MOTION (verbatim from routre) ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .btn:hover { transform: none; }
}

/* ==========================================================================
   PAGE BLOCKS - shared by /work/ and every /<project>/ landing page
   ========================================================================== */
.card h3 { margin: 0; }

/* thumbnail */
.thumb {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline-soft);
  background: var(--paper-3);
  transition: border-color var(--ease);
}
.card:hover .thumb { border-color: rgba(255, 122, 61, 0.5); }

.card-role {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.85rem;
}

.block-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
  margin-bottom: 8px;
}

.card-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* hero stat strip */
.stat-row { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; }
.stat b {
  display: block;
  font-family: var(--px);
  font-size: 0.72rem;
  color: var(--accent);
  line-height: 1.8;
}
.stat span {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-dim);
}

/* install / run command block */
.cmd {
  position: relative;
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  padding: 12px 14px 12px 34px;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.cmd::before {
  content: "$";
  position: absolute;
  left: 13px;
  color: var(--accent);
}
.cmd-wrap { margin-top: 20px; max-width: 640px; }

/* prose + step lists on project pages */
.prose { font-size: 1.05rem; line-height: 1.65; color: var(--steel); text-wrap: pretty; }
.prose + .prose { margin-top: 12px; }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }

/* two-column section: prose left, list right */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }

/* wide hub card on /work/ */
.span-all { grid-column: 1 / -1; }

.footer-col h3 {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
  margin-bottom: 8px;
}
.footer-col a,
.footer-col span { font-size: 0.95rem; color: var(--steel); }

/* back link above a project hero */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-dim);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color var(--ease);
}
.crumb:hover { color: var(--accent); }

/* hero variant for project pages: no forced full-height */
.hero-compact { min-height: auto; padding: calc(var(--nav-h) + 34px) 0 8px; }

/* section anchor offset for the fixed nav */
.anchor { position: relative; top: calc(var(--nav-h) * -1); display: block; height: 0; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; gap: 22px; }
}
