/* ============================================================
   TMC ELECTRONICS — DESIGN TOKENS
   Circuit Green  #366D46  — primary brand (from logo)
   Deep Ink       #10201A  — dark sections
   Paper          #F2F5F1  — light background (cool sage-white)
   Solder Silver  #8FA79A  — trace lines / borders on dark
   Signal Amber   #E8A33D  — CTA / indicator accent
   Text Charcoal  #142019  — body copy on light
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --green: #366D46;
  --green-dark: #244B32;
  --ink: #10201A;
  --paper: #F2F5F1;
  --paper-dim: #E7EDE7;
  --solder: #8FA79A;
  --amber: #E8A33D;
  --charcoal: #142019;
  --white: #FFFFFF;

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

  --radius: 3px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,163,61,0.18);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(242,245,241,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(20,32,25,0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { height: 34px; width: auto; }

.brand-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--charcoal);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}

.nav-links a.active { color: var(--green); }

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--amber);
  transition: right 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--charcoal);
    border-radius: var(--radius);
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--paper);
    padding: 20px 24px;
    gap: 18px;
    border-bottom: 1px solid rgba(20,32,25,0.08);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--charcoal);
  color: var(--charcoal);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.btn-on-dark {
  background: var(--amber);
  color: var(--ink);
}
.btn-on-dark:hover { background: #f0b559; transform: translateY(-1px); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 88px 0 110px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 18px 0 20px;
}

.hero h1 .accent { color: var(--green); }

.hero p.lede {
  font-size: 1.1rem;
  max-width: 46ch;
  color: #3b4a41;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.trace-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.trace-note .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}

/* Circuit trace SVG scene in hero */
.hero-scene {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  margin-left: auto;
}

.hero-scene svg { width: 100%; height: 100%; }

.trace-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 420;
  stroke-dashoffset: 0;
  animation: trace-draw 3.2s ease-in-out infinite;
}

@keyframes trace-draw {
  0% { stroke-dashoffset: 420; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -20; }
}

.solder-node {
  fill: var(--amber);
}

.solder-node.pulse {
  animation: pulse-node 2.4s ease-in-out infinite;
}

@keyframes pulse-node {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- Section spine (signature element) ---------- */

.section-spine {
  position: relative;
}

.section-spine::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--solder) 0px,
    var(--solder) 6px,
    transparent 6px,
    transparent 14px
  );
  opacity: 0.35;
  transform: translateX(-0.5px);
  z-index: 0;
}

@media (max-width: 900px) {
  .section-spine::before { display: none; }
}

.node-marker {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  margin: 0 auto 20px;
}

/* ---------- Generic sections ---------- */

section { padding: 84px 0; }

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  margin-top: 14px;
}

.section-head p {
  color: #48584d;
  margin-top: 12px;
  font-size: 1.02rem;
}

/* ---------- Category rail ---------- */

.category-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.category-chip {
  border: 1px solid rgba(20,32,25,0.12);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  background: var(--white);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.category-chip:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.category-chip .count {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  margin-top: 6px;
}

.category-chip .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
}

/* ---------- Product grid & cards ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--white);
  border: 1px solid rgba(20,32,25,0.10);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 14px 28px rgba(16,32,26,0.10);
  transform: translateY(-3px);
}

.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.discount-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 500;
}

.product-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-cat {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 6px;
}

.product-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.product-desc {
  font-size: 0.83rem;
  color: #55645a;
  margin-bottom: 12px;
  flex: 1;
}

.product-features {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #6a776d;
  margin-bottom: 12px;
  line-height: 1.6;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--charcoal);
}

.price-original {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #9aa79e;
  text-decoration: line-through;
}

.stock-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #7d8a80;
  margin-top: 6px;
}

.stock-note.low { color: var(--amber); }

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(20,32,25,0.16);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ---------- Dark / trust section ---------- */

.dark-section {
  background: var(--ink);
  color: var(--paper);
}

.dark-section .eyebrow { color: var(--amber); }
.dark-section .eyebrow::before { background: var(--green); box-shadow: 0 0 0 3px rgba(54,109,70,0.3); }

.dark-section h2 { color: var(--white); }
.dark-section .section-head p { color: rgba(242,245,241,0.72); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.trust-card {
  border: 1px solid rgba(242,245,241,0.14);
  border-radius: var(--radius);
  padding: 26px;
}

.trust-card .glyph {
  width: 38px; height: 38px;
  margin-bottom: 16px;
}

.trust-card h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 8px;
}

.trust-card p {
  font-size: 0.88rem;
  color: rgba(242,245,241,0.65);
  margin: 0;
}

.payment-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.payment-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid rgba(242,245,241,0.22);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
}

.payment-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(242,245,241,0.75);
  padding: 56px 0 28px;
  border-top: 1px solid rgba(242,245,241,0.08);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-scene { margin: 40px auto 0; }
}

.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { height: 28px; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; font-size: 0.88rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--amber); }

.footer-bottom {
  border-top: 1px solid rgba(242,245,241,0.08);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(242,245,241,0.45);
}

/* ---------- Legal / content pages ---------- */

.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 100px;
}

.legal-wrap h1 { font-size: 2rem; margin-bottom: 6px; }
.legal-wrap .eff-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
  margin-bottom: 40px;
  display: block;
}

.legal-wrap h2 {
  font-size: 1.2rem;
  margin-top: 40px;
  margin-bottom: 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(20,32,25,0.08);
}

.legal-wrap h2:first-of-type { border-top: none; padding-top: 0; }

.legal-wrap p, .legal-wrap li { color: #3b4a41; font-size: 0.96rem; }
.legal-wrap ul { padding-left: 20px; }
.legal-wrap li { margin-bottom: 6px; }

/* ---------- Contact / support page ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

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

.contact-card {
  background: var(--white);
  border: 1px solid rgba(20,32,25,0.1);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 18px;
}

.contact-card .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 8px;
  display: block;
}

.contact-card .value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.faq-item {
  border-bottom: 1px solid rgba(20,32,25,0.1);
  padding: 20px 0;
}

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 1.2rem;
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  margin-top: 12px;
  color: #48584d;
  font-size: 0.92rem;
}
