/* ============================================================
   TECH HAVEN — design tokens
   Display: Space Grotesk | Body: Inter | Utility: JetBrains Mono
   ============================================================ */

:root {
  --bg: #0a0e12;
  --surface: #12181f;
  --surface-2: #1a222b;
  --border: #232b35;
  --text: #e7ecf1;
  --text-muted: #8a96a3;
  --accent-cyan: #3adcc4;
  --accent-amber: #ffb238;
  --danger: #ff5c5c;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 4px;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* ---------- circuit trace divider (signature element) ---------- */
.trace {
  position: relative;
  height: 40px;
  margin: 0 auto;
  max-width: var(--container);
}
.trace svg { width: 100%; height: 100%; display: block; }
.trace path {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
}
.trace circle {
  fill: var(--bg);
  stroke: var(--accent-cyan);
  stroke-width: 2;
}

/* ---------- header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: var(--container);
  margin: 0 auto;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.logo .cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: var(--accent-amber);
  margin-left: 6px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-link:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-cyan); color: #08110f; }
.btn-primary:hover { background: #4fe9d2; }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- hero ---------- */
.hero {
  padding: 90px 0 70px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  margin: 18px 0 22px;
}
.hero h1 span { color: var(--accent-cyan); }
.hero p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 460px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; }

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  position: relative;
}
.hero-panel::before {
  content: attr(data-tag);
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--bg);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--text-muted); }

/* ---------- section headings ---------- */
.section { padding: 64px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 34px;
  gap: 20px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--text-muted); margin: 6px 0 0; max-width: 480px; }

/* ---------- category chips ---------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--text-muted); }
.chip.active { background: var(--accent-cyan); color: #08110f; border-color: var(--accent-cyan); }

/* ---------- product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--accent-cyan); transform: translateY(-3px); }
.card-media {
  aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
}
.card-media .tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--accent-amber);
  color: #1a1300;
  padding: 3px 8px;
  border-radius: 3px;
}
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-cat { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin: 6px 0 10px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.price { font-family: var(--font-mono); font-size: 16px; color: var(--accent-cyan); }
.price .old { color: var(--text-muted); text-decoration: line-through; font-size: 12px; margin-right: 6px; }
.add-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.15s ease;
}
.add-btn:hover { background: var(--accent-cyan); color: #08110f; border-color: var(--accent-cyan); }

/* ---------- feature strip ---------- */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.feature-item { background: var(--surface); padding: 26px; }
.feature-item .num { font-family: var(--font-mono); color: var(--accent-amber); font-size: 12px; }
.feature-item h4 { margin: 10px 0 8px; font-size: 17px; }
.feature-item p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-grid p { color: var(--text-muted); font-size: 13px; margin: 0; font-family: var(--font-mono); }

/* ---------- page header (shop/product/cart) ---------- */
.page-head { padding: 48px 0 30px; border-bottom: 1px solid var(--border); }
.breadcrumb { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--accent-cyan); }

/* ---------- product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 50px 0;
}
.product-media {
  aspect-ratio: 1/1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
}
.product-info .cat { font-family: var(--font-mono); font-size: 12px; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: 0.08em; }
.product-info h1 { font-size: 32px; margin: 10px 0 14px; }
.product-info .price { font-size: 26px; margin-bottom: 18px; display: block; }
.product-info .desc { color: var(--text-muted); margin-bottom: 24px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qty-box { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); }
.qty-box button { background: none; border: none; color: var(--text); width: 36px; height: 40px; cursor: pointer; font-size: 16px; }
.qty-box span { width: 34px; text-align: center; font-family: var(--font-mono); }
.spec-table { margin-top: 30px; border-top: 1px solid var(--border); }
.spec-table .spec-row { padding: 13px 0; }

/* ---------- cart page ---------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding: 44px 0 80px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cart-item .thumb { width: 70px; height: 70px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.cart-item h4 { font-size: 15px; margin-bottom: 4px; }
.cart-item .cat { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; font-family: var(--font-mono); }
.remove-btn:hover { color: var(--danger); }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 26px; position: sticky; top: 100px; }
.summary h3 { margin-bottom: 18px; }
.summary .row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 14px; padding: 8px 0; color: var(--text-muted); }
.summary .row.total { color: var(--text); font-size: 17px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; }
.empty-state { text-align: center; padding: 90px 0; color: var(--text-muted); }
.empty-state .glyph { font-size: 46px; margin-bottom: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .product-detail, .cart-layout { grid-template-columns: 1fr; }
  .feature-strip { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .wrap { padding: 0 20px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
