/* ==========================================================================
   BEEKUM GARAGE — style.css
   After-hours build. Display: Michroma (Eurostile-Extended DNA — the
   motorsport letterform). Body: Overpass (descends from Highway Gothic,
   the typeface of actual roads). Data: Share Tech Mono (the dash cluster).
   ========================================================================== */

:root {
  --bg0: #06080d;
  --bg1: #0c1018;
  --ink: #0a0c11;
  --panel: rgba(10, 13, 20, 0.60);
  --edge: rgba(255, 255, 255, 0.13);
  --edge-soft: rgba(255, 255, 255, 0.07);
  --text: #e8ebf0;
  --muted: #9aa3b2;
  --red: #e0344a;
  --red-deep: #8f1626;
  --amber: #ffb257;
  --cyan: #57d7e6;
  --crimson: #ff4d66;
  --violet: #b48cff;
  --accent: var(--crimson);
  --accent-ink: #2a060c;
  --focus: #ff9fb2;
  --glow: rgba(255, 77, 102, 0.35);
}
html[data-theme='night'] {
  --accent: var(--violet);
  --accent-ink: #150a2e;
  --focus: #d5c2ff;
  --glow: rgba(180, 140, 255, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--text);
  font-family: 'Overpass', system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.62;
  overflow-x: hidden;
  background:
    radial-gradient(90rem 60rem at 78% -12%, #182238 0%, transparent 55%),
    radial-gradient(70rem 50rem at 8% 108%, #241019 0%, transparent 55%),
    var(--bg0);
}

canvas#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
}
html.live canvas#world { opacity: 1; }
@media (prefers-reduced-motion: reduce) { canvas#world { transition: none; } }

/* film grain + vignette over the render */
.grain {
  position: fixed; inset: -2%; z-index: 1; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 22vmin rgba(0, 0, 0, 0.55);
}

/* ------------------------------- layout --------------------------------- */

main { position: relative; z-index: 2; }

section { min-height: 165vh; position: relative; }
section#hero { min-height: 130vh; }
section#contact { min-height: 135vh; }

.panel {
  position: sticky;
  top: 10vh;
  width: min(620px, calc(100vw - 32px));
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  padding: 26px 30px 30px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.panel.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; transform: none; }
}

@media (min-width: 1100px) {
  section:nth-of-type(even) .panel { margin-left: 6vw; }
  section:nth-of-type(odd) .panel { margin-right: 6vw; margin-left: auto; }
  section#hero .panel, section#contact .panel { margin-left: auto; margin-right: auto; }
}

/* service-tag eyebrow */
.tag {
  display: inline-block;
  font-family: 'Michroma', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  border-radius: 4px;
  padding: 7px 11px 6px 13px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(224, 52, 74, 0.35);
}

h1, h2 {
  font-family: 'Michroma', sans-serif;
  font-weight: 400;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
h1 {
  font-size: clamp(26px, 5.2vw, 46px);
  line-height: 1.16;
  letter-spacing: 0.045em;
}
h2 { font-size: clamp(17px, 2.4vw, 22px); letter-spacing: 0.09em; }
h3 {
  font-family: 'Overpass', sans-serif;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 10px;
}

p { margin: 10px 0; }
.muted { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* spec sheet rows */
.spec { margin: 14px 0 4px; border-top: 1px solid var(--edge-soft); }
.spec-row {
  display: flex; gap: 16px; padding: 9px 2px;
  border-bottom: 1px solid var(--edge-soft);
}
.spec-row dt {
  flex: 0 0 122px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 4px;
}
.spec-row dd { margin: 0; }

/* chips — anodised part tags */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 3px 13px 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
a.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  box-shadow: 0 0 14px var(--glow);
}

/* experience list */
ul.log { list-style: none; padding: 0; margin: 10px 0; }
ul.log li { padding: 6px 0 6px 24px; position: relative; }
ul.log li::before {
  content: '';
  position: absolute; left: 2px; top: 15px;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--red);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(224, 52, 74, 0.6);
}

/* project cards */
.card {
  border: 1px solid var(--edge-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 18px 20px;
  margin: 16px 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { border-color: var(--edge); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
.card h3 { margin-top: 0; }
.card .links { margin-top: 10px; }
.card .links a { margin-right: 16px; font-weight: 700; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .mini { grid-template-columns: 1fr; } }

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn {
  display: inline-block;
  font-family: 'Michroma', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  padding: 14px 20px 12px;
  border-radius: 9px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn.alt {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 6px 24px rgba(224, 52, 74, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--edge);
  box-shadow: none;
}
.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* trophies */
.awards { list-style: none; margin: 14px 0 0; padding: 0; }
.awards li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--edge-soft);
}
.medal {
  flex: 0 0 18px; height: 18px; margin-top: 5px;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.5);
}
.medal.gold {
  background: radial-gradient(circle at 32% 28%, #ffe9a8, #d8a93c 58%, #8a621a);
  box-shadow: 0 0 16px rgba(216, 169, 60, 0.55);
}
.medal.flag {
  border-radius: 4px;
  background: conic-gradient(#fff 0 25%, #14121f 0 50%, #fff 0 75%, #14121f 0);
}
.medal.git {
  background: radial-gradient(circle at 32% 28%, #eaffb0, #a4d813 58%, #5c7d0a);
  box-shadow: 0 0 16px rgba(164, 216, 19, 0.45);
}

/* --------------------------------- HUD ----------------------------------- */

.hud {
  position: fixed; z-index: 3; pointer-events: none;
  font-family: 'Share Tech Mono', monospace;
}
.hud-floor {
  top: 16px; left: 16px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #fff;
  background: rgba(8, 11, 17, 0.6);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 9px 16px 7px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hud-gear {
  bottom: 16px; left: 16px;
  background: rgba(8, 11, 17, 0.6);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hud-gear .g { font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.hud-gear #gearNum {
  font-size: 20px; color: var(--accent);
  min-width: 20px; text-align: center;
  text-shadow: 0 0 12px var(--glow);
}
.rpm {
  width: 100px; height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--edge-soft);
  overflow: hidden;
}
.rpm i {
  display: block; height: 100%; width: 6%;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent), var(--red));
  box-shadow: 0 0 10px var(--glow);
}

#themeToggle {
  position: fixed; z-index: 3; top: 16px; right: 16px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(8, 11, 17, 0.6);
  border: 1px solid var(--edge);
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
#themeToggle::after {
  content: '';
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #ffd28f;
  box-shadow: 0 0 14px rgba(255, 210, 143, 0.8);
}
#themeToggle[data-mode='night']::after {
  background: #cfe0ff;
  clip-path: polygon(38% 0, 100% 0, 100% 100%, 38% 100%, 74% 50%);
  box-shadow: 0 0 14px rgba(160, 190, 255, 0.7);
}
#themeToggle:hover { border-color: var(--accent); box-shadow: 0 0 18px var(--glow); }

/* nav rail */
.floor-nav {
  position: fixed; z-index: 3; right: 18px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-end;
}
.nav-dot {
  width: 9px; height: 9px; padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  border: 0;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.nav-dot.on {
  width: 26px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
}
.nav-dot:hover { background: #fff; }
@media (prefers-reduced-motion: reduce) { .nav-dot { transition: none; } }
@media (max-width: 760px) { .floor-nav { display: none; } }

/* hero specifics */
#hero .panel { text-align: center; margin-top: 8vh; }
.scroll-hint {
  margin-top: 22px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.scroll-hint .arrow {
  display: block; margin: 12px auto 0;
  width: 10px; height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  animation: bob 1.6s infinite ease-in-out;
  filter: drop-shadow(0 0 6px var(--glow));
}
@keyframes bob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(4px, 4px); }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint .arrow { animation: none; } }

footer {
  position: relative; z-index: 2;
  text-align: center;
  padding: 30px 16px 40px;
  font-size: 14px;
  color: var(--muted);
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.6));
}
footer a { color: var(--accent); }

/* --------------------------- no-WebGL fallback ---------------------------- */

html.no3d body {
  background:
    radial-gradient(80rem 55rem at 72% -10%, #1c2a45 0%, transparent 55%),
    radial-gradient(60rem 45rem at 6% 110%, #33141f 0%, transparent 55%),
    linear-gradient(180deg, #090c13, #05060a);
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .panel { padding: 20px 18px 22px; top: 8vh; }
  .hud-floor { font-size: 10px; max-width: 62vw; letter-spacing: 0.12em; }
  .spec-row dt { flex-basis: 96px; }
}
