/* ============ Design tokens ============ */
:root {
  --black:      #0b0b0d;
  --black-2:    #111114;
  --carbon:     #15161a;
  --carbon-2:   #1d1e23;
  --line:       #2b2c33;
  --line-soft:  #3a3b43;

  --red:        #e01e1e;
  --red-bright: #ff2a22;
  --red-deep:   #9f110e;

  --chrome:     #f4f5f7;
  --silver:     #c3c7cf;
  --silver-2:   #8d929c;

  --text:       #e9eaee;
  --text-soft:  #a4a8b2;
  --text-dim:   #767b86;

  --maxw: 1180px;
  --nav-h: 72px;
  --radius: 14px;
  --glow-red: 0 0 0 1px rgba(224,30,30,.55), 0 14px 40px rgba(224,30,30,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--nav-h);
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--black);
  /* carbon-fiber weave */
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.022) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.022) 50%, rgba(255,255,255,.022) 75%, transparent 75%),
    linear-gradient(45deg, rgba(0,0,0,.40) 25%, transparent 25%, transparent 50%, rgba(0,0,0,.40) 50%, rgba(0,0,0,.40) 75%, transparent 75%);
  background-size: 6px 6px;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }
.muted { color: var(--text-soft); }
.num { color: var(--red-bright); font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Chrome / silver heading treatment */
.chrome-text {
  background: linear-gradient(180deg, #ffffff 0%, #d7dae0 46%, #a7acb6 54%, #eef0f3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ Fixed numbered nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: linear-gradient(180deg, rgba(8,8,10,.92), rgba(8,8,10,.55) 70%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 26px; display: flex; align-items: center; gap: 20px;
}
.nav-logo { flex: 0 0 auto; display: inline-flex; align-items: center; }
.nav-logo img { height: 44px; width: auto; }
.nav-links { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 14px; }
.nav-item {
  display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none;
  color: var(--text-dim); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 6px 2px; position: relative; transition: color .15s ease;
}
.nav-item .num { font-size: .7rem; opacity: .8; }
.nav-item:hover { color: var(--silver); }
.nav-item.is-active { color: var(--chrome); }
.nav-item.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--red-bright); box-shadow: 0 0 10px rgba(224,30,30,.7);
}
.nav-sep { color: var(--line-soft); font-weight: 400; }
.nav-tag {
  flex: 0 0 auto; color: var(--red-bright); font-weight: 800;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-style: italic;
}

/* ============ Snap sections ============ */
.snap { scroll-snap-align: start; min-height: 100vh; position: relative; }
.section { padding: calc(var(--nav-h) + 64px) 0 80px; display: flex; align-items: center; }

.section-head { max-width: 640px; margin-bottom: 42px; }
.section-label {
  display: inline-block; color: var(--text-dim); font-weight: 800;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--text-soft); font-size: 1.08rem; }

/* ============ 01 — Identity (splash) ============ */
.identity {
  display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(224,30,30,.16), transparent 55%),
    linear-gradient(135deg, #0e0e11 0%, #0a0a0c 40%, #0e0e11 100%);
}
/* brushed-metal diagonal sheen panels */
.identity::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 38%, rgba(255,255,255,.05) 42%, rgba(255,255,255,.10) 44%, rgba(255,255,255,.02) 47%, transparent 50%),
    linear-gradient(118deg, transparent 60%, rgba(255,255,255,.04) 63%, rgba(255,255,255,.01) 66%, transparent 69%);
}
/* red diagonal edge-light streaks */
.edge {
  position: absolute; top: -25%; height: 150%; width: 2px; z-index: 0;
  background: linear-gradient(180deg, transparent, var(--red-bright) 45%, var(--red-bright) 55%, transparent);
  box-shadow: 0 0 26px 5px rgba(224,30,30,.45);
  opacity: .8;
}
.edge-left  { left: 20%;  transform: rotate(26deg); }
.edge-right { right: 20%; transform: rotate(-26deg); }

.identity-inner { position: relative; z-index: 1; text-align: center; padding: 0 24px; }
.hero-logo {
  width: min(520px, 82vw); margin: 0 auto 32px;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,.6));
}
.tagline {
  font-size: clamp(.95rem, 2.4vw, 1.35rem); font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--silver);
}
.subtag { margin-top: 16px; color: var(--text-soft); font-size: clamp(.95rem, 1.8vw, 1.08rem); max-width: 600px; margin-left: auto; margin-right: auto; }

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 1;
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text-dim);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 700;
}
.scroll-cue svg { color: var(--red-bright); animation: bob 1.8s ease-in-out infinite; }
.scroll-cue:hover { color: var(--silver); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ============ 02 — Projects ============ */
.card-grid {
  display: grid; gap: 20px; width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--carbon-2), var(--carbon));
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--glow-red); border-color: var(--red); }
.card-num {
  position: absolute; top: 14px; right: 16px;
  font-size: .9rem; font-weight: 800; color: var(--red-bright); opacity: .65;
  font-variant-numeric: tabular-nums;
}
.card-body { padding: 24px 24px 16px; flex: 1; }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-top h3 { font-size: 1.3rem; color: var(--chrome); }
.card-tags { font-size: .76rem; font-weight: 700; color: var(--red-bright); letter-spacing: .03em; text-transform: uppercase; margin-bottom: 12px; }
.card-desc { color: var(--text-soft); font-size: .96rem; }
.card-foot {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 24px; border-top: 1px solid var(--line);
  font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--silver); text-decoration: none; transition: color .15s ease, gap .15s ease;
}
.card-foot:hover { color: var(--red-bright); gap: 12px; }

.badge {
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-soft); background: var(--black-2); border: 1px solid var(--line-soft);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-dev { color: #fff; border-color: var(--red); background: linear-gradient(180deg, var(--red), var(--red-deep)); }

/* ============ 03 — Garage ============ */
.garage-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; width: 100%; align-items: stretch; }
.flagship {
  position: relative; overflow: hidden;
  border: 1px solid var(--red); border-radius: var(--radius);
  padding: 30px 30px 26px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(224,30,30,.16), transparent 55%),
    linear-gradient(180deg, var(--carbon-2), var(--carbon));
  box-shadow: 0 0 0 1px rgba(224,30,30,.2);
}
.flagship-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.flagship-top h3 { font-size: 1.9rem; color: var(--chrome); }
.flagship-desc { color: var(--text-soft); font-size: 1.02rem; margin-top: 14px; max-width: 52ch; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  font-size: .74rem; font-weight: 700; color: var(--silver);
  background: var(--black-2); border: 1px solid var(--line-soft);
  padding: 5px 11px; border-radius: 8px;
}
.principles {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 28px 22px; background: var(--carbon); position: relative; overflow: hidden;
}
.principles::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background-image:
    linear-gradient(45deg, #0b0b0d 25%, transparent 25%, transparent 75%, #0b0b0d 75%),
    linear-gradient(45deg, #0b0b0d 25%, #f4f5f7 25%, #f4f5f7 75%, #0b0b0d 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px; background-color: #f4f5f7;
}
.principles h3 { font-size: 1.05rem; color: var(--chrome); margin-bottom: 14px; }
.principles li { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .96rem; color: var(--text-soft); }
.principles li:last-child { border-bottom: 0; }
.principles strong { color: var(--text); }

/* ============ 04 — Field Notes ============ */
.notes-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); width: 100%; }
.note {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; background: linear-gradient(180deg, var(--carbon-2), var(--carbon));
  transition: border-color .16s ease, transform .16s ease;
}
.note:hover { border-color: var(--line-soft); transform: translateY(-3px); }
.note-meta {
  display: inline-block; font-size: .66rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--red-bright); border: 1px solid var(--red);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 14px;
}
.note h3 { font-size: 1.2rem; color: var(--chrome); margin-bottom: 10px; }
.note p { color: var(--text-soft); font-size: .95rem; }
.notes-follow { margin-top: 28px; color: var(--text-soft); font-size: 1rem; }
.notes-follow a { color: var(--silver); font-weight: 700; text-decoration: none; }
.notes-follow a:hover { color: var(--red-bright); }

/* ============ 05 — Contact ============ */
.contact { flex-direction: column; justify-content: space-between; }
.contact-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: calc(var(--nav-h) + 40px); padding-bottom: 40px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: .9rem; text-decoration: none;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 14px 24px; border-radius: 10px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--red-bright), var(--red-deep)); color: #fff; box-shadow: 0 6px 18px rgba(224,30,30,.35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(224,30,30,.5); }
.btn-ghost { color: var(--chrome); border-color: rgba(244,245,247,.26); }
.btn-ghost:hover { border-color: var(--red-bright); color: var(--red-bright); }

/* ============ Footer ============ */
.site-footer { width: 100%; }
.checker-strip {
  display: block; height: 12px; width: 100%;
  background-image:
    linear-gradient(45deg, #0b0b0d 25%, transparent 25%, transparent 75%, #0b0b0d 75%),
    linear-gradient(45deg, #0b0b0d 25%, #f4f5f7 25%, #f4f5f7 75%, #0b0b0d 75%);
  background-size: 12px 12px; background-position: 0 0, 6px 6px; background-color: #f4f5f7;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 26px;
}
.footer-tag { color: var(--silver); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; }
.footer-inner .muted { font-size: .82rem; color: var(--text-dim); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .garage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-tag { display: none; }
  .nav-links { gap: 9px; }
  .nav-item .lbl { display: none; }
  .nav-item .num { font-size: .8rem; }
  .nav-sep { display: none; }
  .section { padding: calc(var(--nav-h) + 40px) 0 60px; align-items: flex-start; }
  .identity { min-height: 100vh; }
}
@media (max-width: 480px) {
  .nav-logo img { height: 36px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .scroll-cue svg { animation: none; }
  .card:hover, .note:hover { transform: none; }
}
