/* ===================================================================
   Overclock'd — Computer & Esports Gaming Club
   Palette: light #eceae3 · dark #1b1c1e · accent1 #ff6a13 · accent2 #6f8ba3
   Fonts: Oswald (display) · IBM Plex Sans (body) · IBM Plex Mono (spec)
   =================================================================== */

:root {
  --light: #eceae3;
  --dark: #1b1c1e;
  --text-on-light: #1b1c1e;
  --text-on-dark: #f1efe9;
  --accent1: #ff6a13;
  --accent2: #6f8ba3;

  --radius: 6px;
  --maxw: 1200px;

  --font-display: "Oswald", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text-on-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 4rem); text-transform: none; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 720px; }

/* ---------- Section theming ---------- */
.section { padding: clamp(64px, 9vw, 118px) 0; position: relative; }
.section--light { background: var(--light); color: var(--text-on-light); }
.section--dark  { background: var(--dark);  color: var(--text-on-dark); }

.section__head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 60px); }
.section__intro { margin-top: 16px; font-size: 1.05rem; opacity: 0.85; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  margin: 0 0 14px;
}

.accent { color: var(--accent1); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn__bolt { display: inline-flex; transition: transform .25s ease; }
.btn:hover .btn__bolt { transform: rotate(60deg); }

.btn--primary { background: var(--accent1); border-color: var(--accent1); color: #1b1c1e; }
.btn--primary:hover { background: transparent; color: var(--accent1); }
.btn--ghost:hover { background: var(--text-on-dark); color: var(--dark); }
.btn--block { width: 100%; justify-content: center; margin-top: 6px; }

/* ===================== NAV ===================== */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 28px);
  max-width: var(--maxw);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 12px 9px 18px;
  border-radius: 999px;
  border: 2px solid rgba(241, 239, 233, 0.22);
  background: rgba(27, 28, 30, 0.55);
  backdrop-filter: blur(12px);
  color: var(--text-on-dark);
  transition: background-color .3s ease, border-color .3s ease;
}
.nav.is-scrolled {
  background: rgba(27, 28, 30, 0.92);
  border-color: rgba(255, 106, 19, 0.35);
}
/* running node on the scrolled nav underline */
.nav::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0;
  transition: opacity .3s ease;
}
.nav.is-scrolled::after { opacity: 0.5; animation: cableRun 3.2s linear infinite; }
@keyframes cableRun { from { background-position: -200px 0; } to { background-position: 200px 0; } }

.nav__logo, .footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav__mark { color: var(--accent1); display: inline-flex; }

.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 0;
  opacity: 0.85;
  transition: opacity .2s ease;
}
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--accent1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav__links a:hover, .nav__links a.is-active { opacity: 1; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }

.nav__cta { padding: 9px 16px; font-size: 0.9rem; }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 0 70px;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; opacity: 0.5; }
.hero__bg .circuit { width: 100%; height: 100%; }

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero__lead { margin-top: 20px; font-size: 1.12rem; max-width: 46ch; opacity: 0.9; }
.hero__actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero__media img {
  width: 100%;
  border-radius: var(--radius);
  border: 2px solid rgba(241, 239, 233, 0.25);
  object-fit: cover;
  aspect-ratio: 1774 / 887;
}

/* ---------- Circuit trace animation ---------- */
.circuit__traces path {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: traceDraw 20s linear infinite;
  filter: drop-shadow(0 0 3px rgba(111, 139, 163, 0.6));
}
.circuit__traces path:nth-child(2) { animation-delay: -4s; }
.circuit__traces path:nth-child(3) { animation-delay: -8s; }
.circuit__traces path:nth-child(4) { animation-delay: -12s; }
.circuit__traces path:nth-child(5) { animation-delay: -6s; stroke-dasharray: 900; stroke-dashoffset: 900; }
@keyframes traceDraw {
  0%   { stroke-dashoffset: 1600; }
  45%  { stroke-dashoffset: 0; }
  75%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1600; }
}
.circuit__nodes circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodeFlash 20s ease-in-out infinite;
}
.circuit__nodes circle:nth-child(odd)  { animation-delay: -3s; }
.circuit__nodes circle:nth-child(3n)   { animation-delay: -7s; }
@keyframes nodeFlash {
  0%, 40%, 100% { opacity: 0.2; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.3); filter: drop-shadow(0 0 5px var(--accent1)); }
  60% { opacity: 0.3; transform: scale(0.9); }
}

/* ===================== DIVIDER ===================== */
.divider {
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
  height: 0;
}
.divider--dark { background: var(--dark); }
.divider__bolt {
  position: relative;
  width: 22px; height: 24px;
  margin-top: -12px;
  background: var(--accent1);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
/* place the bolt on the seam between two sections */
.divider { height: 24px; margin: 0; }
.section + .divider, .hero + .divider { margin-top: 0; }

/* ===================== FEATURED BUILDS ===================== */
.builds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.build {
  border: 2px solid currentColor;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .35s ease;
}
.build:hover { border-color: var(--accent1); }
.build__media { position: relative; overflow: hidden; aspect-ratio: 1 / 1; }
.build__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.build:hover .build__media img { transform: scale(1.04); }

.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border: 2px solid var(--light);
  border-radius: var(--radius);
  background: transparent;
  color: var(--light);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.build:hover .badge { background: var(--accent1); border-color: var(--accent1); color: #1b1c1e; }

.build__body { padding: 20px 20px 24px; }
.build__body h3 { margin-bottom: 14px; }

/* spec list — board-marking style */
.spec { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.86rem; }
.spec li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(27, 28, 30, 0.14);
}
.spec li:last-child { border-bottom: 0; }
.spec__k { color: var(--accent2); text-transform: uppercase; letter-spacing: 0.06em; }
.spec__v { text-align: right; }

/* build spec reveal animation (per-line) */
.build.in-view .spec li { animation: specLine .4s ease both; }
.build.in-view .spec li:nth-child(1) { animation-delay: .05s; }
.build.in-view .spec li:nth-child(2) { animation-delay: .10s; }
.build.in-view .spec li:nth-child(3) { animation-delay: .15s; }
.build.in-view .spec li:nth-child(4) { animation-delay: .20s; }
.build.in-view .spec li:nth-child(5) { animation-delay: .25s; }
@keyframes specLine { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ===================== SERVICES ===================== */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.service {
  border: 2px solid rgba(241, 239, 233, 0.2);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: border-color .3s ease;
}
.service:hover { border-color: var(--accent1); }
.service__icon {
  display: inline-flex; color: var(--accent1);
  margin-bottom: 16px;
}
.service h3 { margin-bottom: 10px; }
.service p { font-size: 0.96rem; opacity: 0.85; }

/* ===================== PROCESS TIMELINE ===================== */
.timeline {
  position: relative;
  list-style: none; margin: 0; padding: 30px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.timeline__cable {
  position: absolute; top: 6px; left: 0; width: 100%; height: 60px;
  z-index: 0; pointer-events: none;
}
.timeline__cable path {
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  filter: drop-shadow(0 0 2px rgba(111, 139, 163, 0.5));
}
.timeline.in-view .timeline__cable path { animation: cableDraw 1200ms ease-out forwards; }
@keyframes cableDraw { to { stroke-dashoffset: 0; } }

.timeline__step { position: relative; z-index: 1; text-align: left; }
.timeline__step h3 { margin: 16px 0 8px; }
.timeline__step p { font-size: 0.94rem; opacity: 0.82; }

.hex {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 70px;
  background: var(--dark);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.section--light .hex { background: var(--dark); }
.hex::before {
  content: ""; position: absolute; inset: 3px;
  background: var(--light);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.hex__num {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem;
  color: var(--accent1);
}

/* ===================== WHY US ===================== */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.metric {
  border-top: 2px solid rgba(255, 106, 19, 0.5);
  padding-top: 20px;
}
.metric__hex { display: inline-flex; color: var(--accent2); margin-bottom: 10px; }
.metric__num {
  display: block;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1; color: var(--accent1);
}
.metric__label { display: block; margin-top: 10px; font-size: 0.95rem; opacity: 0.85; }

/* ===================== GALLERY ===================== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.gallery__item {
  margin: 0; overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid currentColor;
  aspect-ratio: 16 / 10;
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.gallery__item:hover { border-color: var(--accent1); }
.gallery__item:hover img { transform: scale(1.04); }

/* ===================== QUOTE FORM ===================== */
.qform { display: flex; flex-direction: column; gap: 18px; }
.qform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label {
  font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent2);
}
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem;
  color: var(--text-on-dark);
  background: rgba(241, 239, 233, 0.05);
  border: 2px solid rgba(241, 239, 233, 0.22);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .2s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; cursor: pointer; }
.field input::placeholder, .field textarea::placeholder { color: rgba(241, 239, 233, 0.45); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--accent1);
}
.field option { color: #1b1c1e; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.qform__status { font-size: 0.98rem; min-height: 1.2em; }
.qform__status.success {
  position: relative;
  color: var(--accent1);
  font-family: var(--font-display); letter-spacing: 0.02em;
  animation: statusIn .5s ease both;
  padding-bottom: 14px;
}
.qform__status.success::after {
  content: ""; position: absolute; left: 0; bottom: 4px;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  animation: traceLine 700ms ease-out .2s forwards;
}
.qform__status.error { color: #ff8f5e; }
@keyframes statusIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes traceLine { to { width: 120px; } }

/* ===================== FOOTER ===================== */
.footer { padding: clamp(52px, 7vw, 80px) 0; text-align: center; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.footer__logo .nav__mark { color: var(--accent1); }
.footer__line { max-width: 46ch; opacity: 0.8; font-size: 0.98rem; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.footer__nav a {
  font-family: var(--font-display); font-size: 0.9rem;
  letter-spacing: 0.03em; text-transform: uppercase; opacity: 0.85;
  transition: color .2s ease;
}
.footer__nav a:hover { color: var(--accent1); }
.footer__copy { font-size: 0.85rem; opacity: 0.6; font-family: var(--font-mono); }

/* ===================== SCROLL REVEAL ===================== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.in-view { opacity: 1; transform: none; }
/* stagger inside grids */
.builds .build:nth-child(2), .services .service:nth-child(2) { transition-delay: .08s; }
.builds .build:nth-child(3), .services .service:nth-child(3) { transition-delay: .16s; }
.services .service:nth-child(4) { transition-delay: .24s; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .builds { grid-template-columns: repeat(2, 1fr); }
  .services, .why { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: 34px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .timeline__cable { display: none; }
}
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav { gap: 10px; padding: 9px 10px 9px 16px; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero { min-height: auto; }
}
@media (max-width: 560px) {
  .builds, .services, .why, .gallery, .qform__row, .timeline { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .circuit__traces path { stroke-dashoffset: 0; }
  .timeline__cable path { stroke-dashoffset: 0; }
}
