/* ==========================================================================
   K Manufacturing — styles
   Brand tokens live in :root. Change them here and the whole site follows.
   ========================================================================== */
:root {
  /* color */
  --black: #000000;   /* page */
  --ink:   #ededed;   /* primary text */
  --steel: #a1a1a1;   /* secondary text */
  --line:  #242424;   /* hairlines + grid */
  --raise: #0b0b0b;   /* hover / selected surfaces */
  --red:   #e1131b;   /* K red: logo + order button only */

  /* type: Geist, scale ~1.333 from 16px */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-sm: 0.875rem;   /* 14 */
  --t-md: 1rem;       /* 16 */
  --t-lg: 1.25rem;    /* 20 */
  --t-xl: 1.75rem;    /* 28 */
  --t-2xl: 2.5rem;    /* 40 */
  --t-3xl: clamp(2.5rem, 7vw, 4.75rem); /* 40 → 76 */

  /* layout */
  --frame: 1200px;
  --pad: clamp(16px, 4vw, 48px);
  --pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font: 400 var(--t-md)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 100; background: var(--ink); color: var(--black); padding: 8px 12px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the frame: vertical rails + horizontal bands with + marks ---------- */
.rail {
  max-width: var(--frame);
  margin: 0 auto;
  border-inline: 1px solid var(--line);
}
.band {
  position: relative;
  border-top: 1px solid var(--line);
  padding: clamp(48px, 8vw, 96px) var(--pad);
}
.band:first-child { border-top: 0; }
/* + marks where band lines cross the rails */
.band::before, .band::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 11px; height: 11px;
  background:
    linear-gradient(var(--steel), var(--steel)) center / 1px 100% no-repeat,
    linear-gradient(var(--steel), var(--steel)) center / 100% 1px no-repeat;
  opacity: .55;
}
.band::before { left: -6px; }
.band::after  { right: -6px; }
.band:first-child::before, .band:first-child::after { display: none; }
.band-flush { padding: 0; }

.band-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 32px;
}
.band-head h2 { font-size: var(--t-2xl); }
.band-head a { color: var(--steel); text-decoration: none; font-size: var(--t-sm); }
.band-head a:hover { color: var(--ink); }
.muted { color: var(--steel); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--pill);
  font: 500 var(--t-md)/1 var(--font);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: var(--black); }
.btn-primary:hover { background: #ffffff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--raise); border-color: #3a3a3a; }
.btn-order { background: var(--red); color: #fff; width: 100%; min-height: 52px; font-size: var(--t-lg); }
.btn-order:hover { background: #f02a31; }
.btn-small { min-height: 34px; padding: 0 14px; font-size: var(--t-sm); }

/* ---------- header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--frame); margin: 0 auto;
  height: 64px; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand img { width: 30px; height: auto; }
#site-nav { flex: 1; }
#site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
#site-nav a { display: block; padding: 6px 12px; border-radius: var(--pill); color: var(--steel); text-decoration: none; font-size: var(--t-sm); }
#site-nav a:hover, #site-nav a[aria-current="page"] { color: var(--ink); background: var(--raise); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: var(--pill); padding: 6px 14px; font: inherit; font-size: var(--t-sm); cursor: pointer; }

@media (max-width: 760px) {
  .header-inner { gap: 12px; }
  .header-cta { display: none; }
  .nav-toggle { display: block; }
  #site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--black); border-bottom: 1px solid var(--line); }
  #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; padding: 8px var(--pad) 16px; }
  #site-nav a { padding: 12px; font-size: var(--t-md); }
}

/* ---------- hero: the one bold moment ---------- */
.hero { text-align: center; padding-top: 0; overflow: hidden; }
.hero-stage {
  position: relative;
  height: clamp(260px, 42vw, 440px);
  margin: 0 calc(var(--pad) * -1) 8px;
  display: grid; place-items: center;
}
/* faint machinist grid, fading out from the center */
.hero-stage::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, #000 30%, transparent 75%);
}
/* red heat glow under the K */
.hero-stage::after {
  content: ""; position: absolute;
  width: min(560px, 90%); aspect-ratio: 1.6;
  left: 50%; top: 58%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(225, 19, 27, .42), rgba(225, 19, 27, .12) 55%, transparent);
  filter: blur(24px);
  animation: heat 1.6s cubic-bezier(.2, .7, .2, 1) .15s both;
}
.hero-mark {
  position: relative; z-index: 1;
  width: clamp(180px, 30vw, 320px); height: auto;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes heat { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .hero-stage::after, .hero-mark { animation: none; }
}

.hero-title {
  font-size: var(--t-3xl);
  letter-spacing: -0.05em;
  line-height: 1.02;
  max-width: 16ch;
  margin: 0 auto;
  text-wrap: balance;
}
.nowrap { white-space: nowrap; }
.hero-lede {
  max-width: 48ch; margin: 24px auto 0;
  color: var(--steel); font-size: var(--t-lg); line-height: 1.5;
}
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- platforms strip ---------- */
/* 1px gaps over a line-colored background draw the dividers at every width */
.platforms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); }
.platform {
  display: block; text-decoration: none;
  padding: 36px clamp(16px, 2.5vw, 32px);
  background: var(--black);
  transition: background-color .15s;
}
.platform:hover { background: var(--raise); }
.platform h3 { font-size: var(--t-xl); }
.platform p { color: var(--steel); font-size: var(--t-sm); margin-top: 6px; }
@media (max-width: 900px) {
  .platforms { grid-template-columns: repeat(2, 1fr); }
  .platform:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .platforms { grid-template-columns: 1fr; } }

/* ---------- parts grid (shared hairlines, no floating cards) ---------- */
.parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.part {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .15s;
}
.part:hover { background: var(--raise); }
.part-media { aspect-ratio: 1; overflow: hidden; background: #1a1a1a; }
.part-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.part-info { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 24px 24px; }
.part-info h3 { font-size: var(--t-lg); letter-spacing: -0.02em; }
.part-info p { color: var(--steel); font-size: var(--t-sm); margin-top: 2px; }
.price { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-tbd { color: var(--steel); font-weight: 400; font-size: var(--t-sm); }
.price small { color: var(--steel); font-weight: 400; font-size: var(--t-sm); }
@media (min-width: 1000px) { .parts-4 { grid-template-columns: repeat(4, 1fr); } .parts-4 .part-info { padding: 16px 18px 20px; } .parts-4 .part-info h3 { font-size: var(--t-md); } }
@media (max-width: 900px) { .parts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .parts { grid-template-columns: 1fr; } }

/* stand-in for parts without photos yet: the hero's machinist grid */
.no-photo {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background-color: #0d0d0d;
  background-image:
    linear-gradient(#1c1c1c 1px, transparent 1px),
    linear-gradient(90deg, #1c1c1c 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
}
.no-photo span { color: var(--steel); font-size: var(--t-sm); background: #0d0d0d; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--pill); }

/* partner band: big group photo beside the pitch, products underneath */
.partner-feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line); border-bottom: 0;
}
.partner-feature img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 45%; border-right: 1px solid var(--line); }
.partner-copy { padding: clamp(24px, 4vw, 48px); align-self: end; }
.partner-copy h2 { font-size: var(--t-2xl); max-width: 14ch; }
.partner-copy p { color: var(--steel); margin: 16px 0 28px; max-width: 44ch; }
@media (max-width: 760px) {
  .partner-feature { grid-template-columns: 1fr; }
  .partner-feature img { border-right: 0; border-bottom: 1px solid var(--line); }
}
.empty { padding: 48px 24px; color: var(--steel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.empty a { color: var(--ink); }

/* filter pills */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  font: 500 var(--t-sm)/1 var(--font); color: var(--steel);
  background: none; border: 1px solid var(--line); border-radius: var(--pill);
  padding: 9px 16px; cursor: pointer;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--black); background: var(--ink); border-color: var(--ink); }

/* ---------- ordering steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 0 32px 0 0; }
.steps li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.steps li::before { content: counter(step); display: block; font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.04em; color: #3a3a3a; margin-bottom: 16px; }
.steps h3 { font-size: var(--t-lg); letter-spacing: -0.02em; margin-bottom: 8px; }
.steps p { color: var(--steel); max-width: 34ch; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps li, .steps li + li { padding: 0; border-left: 0; }
}

/* ---------- law notice ---------- */
.law { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.law h2 { font-size: var(--t-xl); margin-bottom: 8px; }
.law p { color: var(--steel); max-width: 62ch; }
@media (max-width: 760px) { .law { grid-template-columns: 1fr; } }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.pdp-gallery { border-right: 1px solid var(--line); }
.pdp-main { aspect-ratio: 3 / 4; background: #1a1a1a; overflow: hidden; }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); border-top: 1px solid var(--line); }
.thumb { padding: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #1a1a1a; cursor: pointer; aspect-ratio: 1; opacity: .55; transition: opacity .15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb[aria-current="true"] { opacity: 1; }
.pdp-info { padding: clamp(32px, 5vw, 56px) var(--pad); position: sticky; top: 64px; align-self: start; }
.crumb { color: var(--steel); text-decoration: none; font-size: var(--t-sm); }
.crumb:hover { color: var(--ink); }
.pdp-info h1 { font-size: var(--t-2xl); margin-top: 12px; text-wrap: balance; }
.pdp-price { font-size: var(--t-xl); font-weight: 500; margin-top: 12px; letter-spacing: -0.02em; }
.pdp-desc { color: var(--steel); margin-top: 20px; max-width: 52ch; }
.options { border: 0; padding: 0; margin: 32px 0 0; }
.options legend { font-size: var(--t-sm); color: var(--steel); margin-bottom: 12px; padding: 0; }
.options-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--pill);
  font-size: var(--t-sm); color: var(--steel); transition: border-color .15s, color .15s;
}
.opt input:checked + span { border-color: var(--ink); color: var(--ink); background: var(--raise); }
.opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.pdp-order { margin-top: 32px; }
.pdp-note { color: var(--steel); font-size: var(--t-sm); margin-top: 12px; text-align: center; }
.pdp-note a, .field-hint a { color: var(--ink); }
.field-hint { color: var(--steel); font-size: var(--t-sm); margin: -8px 0 20px; max-width: 60ch; }
.field-note { color: var(--ink); margin-top: -12px; }
.state-list { list-style: none; padding: 0; margin: 16px 0 0; columns: 3 12ch; column-gap: 24px; }
.state-list li { padding: 4px 0; break-inside: avoid; }
@media (max-width: 480px) { .state-list { columns: 2; } }
.specs { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.specs li span:first-child { color: var(--steel); }
@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; }
  .pdp-gallery { border-right: 0; border-bottom: 1px solid var(--line); }
  .pdp-info { position: static; }
}

/* ---------- page heading (inner pages) ---------- */
.page-head h1 { font-size: var(--t-3xl); letter-spacing: -0.05em; }
.page-head p { color: var(--steel); font-size: var(--t-lg); margin-top: 16px; max-width: 52ch; }

/* ---------- about ---------- */
.about-art {
  margin: 0 calc(var(--pad) * -1);
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 50%, #000 45%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 75% at 50% 50%, #000 45%, transparent 80%);
}
.about-art img { width: 100%; max-width: 900px; margin: 0 auto; }
.prose { max-width: 64ch; }
.prose p + p { margin-top: 1em; }
.prose h2 { font-size: var(--t-xl); margin: 2em 0 .5em; }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--steel); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--ink); }

/* ---------- forms ---------- */
.form { max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: var(--t-sm); color: var(--steel); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--black); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%), linear-gradient(135deg, var(--steel) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--steel); font-size: var(--t-sm); margin: 8px 0 28px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--red); }
.form-status { margin-top: 16px; font-size: var(--t-sm); color: var(--ink); min-height: 1.6em; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; }
.contact-side h2 { font-size: var(--t-lg); letter-spacing: -0.02em; margin: 32px 0 8px; }
.contact-side > h2:first-child { margin-top: 0; }
.contact-side p { color: var(--steel); font-size: var(--t-sm); }
.contact-side a { color: var(--ink); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- footer ---------- */
#site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--frame); margin: 0 auto;
  padding: 48px var(--pad) 32px;
  border-inline: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 48px;
}
.footer-mark { width: 132px; height: auto; }
.footer-col h2 { font-size: var(--t-sm); font-weight: 500; letter-spacing: 0; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--steel); text-decoration: none; font-size: var(--t-sm); }
.footer-col a:hover { color: var(--ink); }
.footer-legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); color: var(--steel); font-size: var(--t-sm); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
