/* ============================================================
   RacKore — Design System
   Space Grotesk (display) · Archivo (body) · JetBrains Mono (tech)
   ============================================================ */

:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* light theme (default) */
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --bg-sunken: #eceef1;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e5e8ec;
  --border-strong: #d3d8df;
  --text: #14171c;
  --text-soft: #586172;
  --text-faint: #8b93a1;

  --accent: #e5322b;
  --accent-ink: #c81d16;
  --accent-soft: #fdeceb;
  --accent-contrast: #ffffff;

  --ok: #15a04a;
  --ok-soft: #e7f6ec;
  --info: #2563eb;

  /* server chassis (brushed metal) */
  --metal-top: #f3f4f6;
  --metal-bot: #d7dbe0;
  --metal-edge: #b9bfc7;
  --metal-bay: #e9ebee;
  --metal-bay-edge: #c4cad1;
  --metal-vent: #c9ced5;
  --metal-ink: #6b7280;

  --shadow-sm: 0 1px 2px rgba(20,23,28,.06), 0 1px 3px rgba(20,23,28,.04);
  --shadow-md: 0 4px 16px rgba(20,23,28,.07), 0 1px 4px rgba(20,23,28,.04);
  --shadow-lg: 0 18px 50px rgba(20,23,28,.13), 0 4px 14px rgba(20,23,28,.07);
  --shadow-pop: 0 24px 70px rgba(15,18,24,.22);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 132px;
}

html[data-theme='dark'] {
  --bg: #0b0d10;
  --bg-soft: #111418;
  --bg-sunken: #07090b;
  --surface: #14171c;
  --surface-2: #181c22;
  --border: #242a32;
  --border-strong: #313842;
  --text: #f1f3f6;
  --text-soft: #9aa4b2;
  --text-faint: #69727f;

  --accent: #ff453a;
  --accent-ink: #ff7a72;
  --accent-soft: #2a1413;
  --accent-contrast: #0b0d10;

  --ok: #34c768;
  --ok-soft: #122318;
  --info: #5b8cff;

  --metal-top: #2a2f37;
  --metal-bot: #181c22;
  --metal-edge: #0c0e11;
  --metal-bay: #1d2128;
  --metal-bay-edge: #0e1013;
  --metal-vent: #353b44;
  --metal-ink: #8a93a0;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 6px 22px rgba(0,0,0,.5);
  --shadow-lg: 0 22px 60px rgba(0,0,0,.6);
  --shadow-pop: 0 28px 80px rgba(0,0,0,.7);
}

/* accent presets (set via data-accent on html) */
html[data-accent='crimson'] { --accent:#d61f4e; --accent-ink:#b3163f; --accent-soft:#fcebf0; }
html[data-accent='crimson'][data-theme='dark'] { --accent:#ff476f; --accent-ink:#ff7d9b; --accent-soft:#2a1219; }
html[data-accent='ember'] { --accent:#f04e23; --accent-ink:#cc3c16; --accent-soft:#fdeee8; }
html[data-accent='ember'][data-theme='dark'] { --accent:#ff6a3d; --accent-ink:#ff8d68; --accent-soft:#2a160f; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* the header is injected into a bare wrapper div — let it participate in body
   layout so position:sticky on .site-header resolves against the page, not the
   ~114px wrapper (which made the header, and the offset filters key off, scroll away) */
[data-site-header] { display: contents; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
}
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-contrast); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600;
}
.muted { color: var(--text-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
  letter-spacing: -.01em;
  padding: 13px 22px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--bg-sunken); color: var(--text);
  transition: transform .12s ease, background .2s ease, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--accent { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 6px 18px -6px var(--accent); }
.btn--accent:hover { box-shadow: 0 10px 26px -8px var(--accent); }
.btn--dark { background: var(--text); color: var(--bg); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn--ok { background: var(--ok); color: #fff; }
.btn--lg { padding: 16px 28px; font-size: 16px; }
.btn--sm { padding: 9px 15px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 100px;
  background: var(--bg-sunken); color: var(--text-soft);
}
.pill--accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill--ok { background: var(--ok-soft); color: var(--ok); }

.tag-u { /* 1U / 2U badge */
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  padding: 3px 8px; border-radius: 5px; letter-spacing: .02em;
  background: var(--text); color: var(--bg);
}

/* ============================================================
   HEADER (injected by app.js)
   ============================================================ */
.topbar {
  background: var(--bg-sunken); border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-soft);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 38px; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar a:hover { color: var(--text); }
.topbar .call b { color: var(--text); font-family: var(--font-mono); letter-spacing: -.02em; }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 26px; height: 76px; }
.logo { display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: -.03em; }
.logo .dot { color: var(--accent); }
.logo .core { color: var(--text-soft); font-weight: 500; }

.searchbox {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; color: var(--text-faint); transition: border-color .2s, box-shadow .2s;
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox input { border: 0; background: transparent; outline: none; flex: 1; font-family: var(--font-body); font-size: 14px; color: var(--text); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav > a {
  position: relative; font-family: var(--font-display); font-weight: 500; font-size: 14px;
  letter-spacing: -.01em; color: var(--text-soft); padding: 8px 13px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px; transition: color .18s, background .18s;
}
.nav > a:hover, .nav > a.is-open { color: var(--text); background: var(--bg-soft); }
.nav > a .chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-1px,-1px); opacity: .6; }

.iconbtn {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); display: inline-grid; place-items: center;
  transition: border-color .2s, color .2s, transform .12s;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 100px; background: var(--accent); color: var(--accent-contrast);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* mega menu */
.megawrap { position: relative; }
.mega {
  position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%) translateY(8px);
  width: min(960px, 94vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 22px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease; z-index: 70;
}
.mega.is-open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr) .9fr; gap: 12px; }
.mega-card {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 15px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 9px; transition: border-color .18s, transform .18s, box-shadow .18s;
}
.mega-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mega-card .code { font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: var(--accent-contrast); background: var(--accent); padding: 2px 7px; border-radius: 4px; align-self: flex-start; }
.mega-card h5 { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; margin: 0; }
.mega-card p { font-size: 12.5px; color: var(--text-soft); line-height: 1.4; }
.mega-aside { grid-row: 1 / span 2; border-left: 1px solid var(--border); padding-left: 18px; display: flex; flex-direction: column; gap: 12px; }
.mega-aside .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.brandgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brandchip { border: 1px solid var(--border); border-radius: 8px; height: 46px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--text-soft); letter-spacing: -.01em; }

/* ============================================================
   SERVER UNIT (CSS-drawn chassis)
   ============================================================ */
.unit { width: 100%; display: flex; flex-direction: column; gap: 4px; --bays: 12; }
.unit-face {
  position: relative; display: flex; align-items: stretch; gap: 6px;
  background: linear-gradient(180deg, var(--metal-top), var(--metal-bot));
  border: 1px solid var(--metal-edge); border-radius: 5px;
  padding: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), var(--shadow-sm);
}
.unit--1u .unit-face { height: 54px; }
.unit--2u .unit-face { height: 92px; }
.unit--tower .unit-face { height: 150px; width: 96px; margin: 0 auto; flex-direction: column; }
.unit-ear {
  width: 16px; flex: none; border-radius: 3px;
  background: linear-gradient(180deg, var(--metal-bay), var(--metal-bot));
  border: 1px solid var(--metal-bay-edge);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 5px 0;
}
.unit-ear i { width: 5px; height: 5px; border-radius: 50%; background: var(--metal-edge); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.unit-bays { flex: 1; display: grid; grid-template-columns: repeat(var(--bays), 1fr); gap: 4px; }
.unit--2u .unit-bays { grid-template-rows: 1fr 1fr; grid-auto-flow: column; }
.bay {
  border-radius: 2.5px; background: linear-gradient(180deg, var(--metal-bay), color-mix(in srgb, var(--metal-bay) 80%, #000 6%));
  border: 1px solid var(--metal-bay-edge);
  position: relative; overflow: hidden;
}
.bay::after { content: ''; position: absolute; inset: 2px auto 2px 3px; width: 2px; border-radius: 2px; background: var(--metal-vent); }
.bay.led-on::before { content: ''; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 3px; height: 3px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 5px var(--ok); }
.bay.led-acc::before { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.unit-side {
  width: 78px; flex: none; border-radius: 3px; background: linear-gradient(180deg, var(--metal-bay), var(--metal-bot));
  border: 1px solid var(--metal-bay-edge); display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 8px;
}
.unit-vent { height: 0; border-top: 2px solid var(--metal-vent); opacity: .8; }
.unit-side .row { display: flex; gap: 4px; align-items: center; }
.unit-side .row i { width: 4px; height: 4px; border-radius: 50%; background: var(--metal-edge); }
.unit-side .row i.g { background: var(--ok); box-shadow: 0 0 4px var(--ok); }
.unit-side .row i.r { background: var(--accent); box-shadow: 0 0 4px var(--accent); }
.unit-cap { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: .02em; display: flex; justify-content: space-between; }

/* tower internals */
.unit--tower .unit-bays { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 14px; gap: 5px; }

/* ============================================================
   GENERIC SECTIONS / CARDS
   ============================================================ */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--soft { background: var(--bg-soft); }
.section--sunken { background: var(--bg-sunken); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--text-soft); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .25s, transform .2s;
}
.card--hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* spec list */
.specs { display: grid; gap: 9px; }
.spec { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-soft); }
.spec .k { width: 16px; height: 16px; flex: none; color: var(--text-faint); }
.spec b { color: var(--text); font-weight: 600; }
.spec .hl { color: var(--accent-ink); font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; }

/* footer */
.site-footer { background: var(--bg-sunken); border-top: 1px solid var(--border); padding-block: 56px 30px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 32px; }
.footer-grid h6 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 16px; font-weight: 600; }
.footer-grid a { display: block; color: var(--text-soft); font-size: 14px; padding: 5px 0; transition: color .15s; }
.footer-grid a:hover { color: var(--accent-ink); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 13px; }

/* utility */
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flow > * + * { margin-top: var(--fl, 16px); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .mega { width: 92vw; }
  .mega-grid { grid-template-columns: 1fr 1fr; }
  .mega-aside { grid-row: auto; grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 14px; }
}
@media (max-width: 760px) {
  .nav, .searchbox, .topbar .desk { display: none; }
  .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-row { height: 64px; }
}

/* reveal on load */
[data-rise] { opacity: 0; transform: translateY(18px); }
.rise-in { animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ============================================================
   HARDWARE — shared product tile
   ============================================================ */
.hw-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  aspect-ratio: 4 / 3; border-radius: var(--r-md);
  background: radial-gradient(120% 120% at 50% 0%, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); overflow: hidden; }
.hw-tile::before { content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .35; -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000, transparent 75%); mask-image: radial-gradient(70% 70% at 50% 45%, #000, transparent 75%); }
.hw-tile-ic { position: relative; width: 44%; max-width: 92px; color: var(--text-soft); }
.hw-tile-ic svg { width: 100%; height: auto; }
.hw-tile-mfg { position: relative; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.hw-tile--lg .hw-tile-ic { max-width: 150px; }
.mfg-logo { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--text-soft); }
