/* =========================================================
   site.css: shared by every page
   Tokens, base, header, mobile menu, contact footer, helpers.
   Page styles: home.css, project.css, about.css.
   ========================================================= */

:root {
  --bg: #0c0d0f;
  --surface: #15171a;
  --line: #26292e;
  --text: #eceef1;
  --muted: #8b9098;
  --accent: #ff8a1f;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1480px;
  --panel: #14171b;
  --bar: 46px;                       /* height of the editor-style top bar */
  --display: "Chakra Petch", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 400 16px/1.6 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header: editor-style tab bar ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--bar);
  display: flex; align-items: stretch; justify-content: space-between;
  padding: 0 0 0 var(--gutter);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; align-self: center; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; }
.brand small { font: 400 11px var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; align-items: stretch; font: 400 12px var(--mono); letter-spacing: .06em; }
.nav > a { display: grid; place-items: center; padding: 0 22px; border-left: 1px solid var(--line); color: var(--muted); transition: color .2s, background .2s; }
.nav > a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav > a.on { color: var(--text); background: var(--bg); box-shadow: inset 0 2px 0 var(--accent); }
.nav .social { display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter) 0 22px; border-left: 1px solid var(--line); color: var(--muted); }
.nav .social a:hover { color: var(--accent); }
.nav .social svg { width: 16px; height: 16px; fill: currentColor; display: block; }

.menu-btn { display: none; position: relative; z-index: 2; align-self: center; margin-right: 8px; background: none; border: 0; color: var(--text); width: 40px; height: 40px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: currentColor; margin: 6px 6px; transition: transform .3s, opacity .3s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 25; background: rgba(12,13,15,.97);
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 0 var(--gutter);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.menu-open .mobile-menu { opacity: 1; pointer-events: auto; }
.mobile-menu a { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 40px; line-height: 1.25; }
.mobile-menu a.on { color: var(--accent); }
.mobile-menu .small { display: flex; gap: 22px; margin-top: 28px; font: 400 13px var(--mono); text-transform: none; color: var(--muted); }
.mobile-menu .small a { font: inherit; }

/* ---------- Contact footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 72px var(--gutter) 40px; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px;
}
.site-footer h5 { font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.05; }
.site-footer h5 a { color: var(--accent); }
.site-footer .links { display: grid; gap: 10px; align-content: start; justify-items: end; font: 400 13px var(--mono); color: #c9ccd1; }
.site-footer .links a:hover { color: var(--accent); }
.site-footer small { grid-column: 1 / -1; color: var(--muted); font: 400 11px var(--mono); }

/* ---------- Helpers ---------- */
/* Fade-up on scroll. Only hidden when JS is running, so content still shows without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
:root { --x: #ff5c5c; --y: #7ee787; --z: #5ca8ff; }   /* axis colours */
.kicker { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

/* Viewport furniture shared by the home hero and project heroes */
.corner { position: absolute; z-index: 3; width: 22px; height: 22px; border: 0 solid rgba(255,255,255,.45); pointer-events: none; }
.corner.tl { top: 14px; left: 14px; border-width: 1px 0 0 1px; } .corner.tr { top: 14px; right: 14px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: 14px; left: 14px; border-width: 0 0 1px 1px; } .corner.br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }
.vp-stats { position: absolute; z-index: 3; top: 26px; left: 32px; font: 400 12px/1.8 var(--mono); text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.vp-stats div { display: grid; grid-template-columns: 74px auto; } .vp-stats dt { color: rgba(255,255,255,.55); } .vp-stats dd { color: var(--y); }
.vp-stats .latest dd { color: var(--accent); }
.gizmo { position: absolute; z-index: 3; left: 34px; bottom: 40px; width: 56px; height: 56px; pointer-events: none; }
.gizmo i { position: absolute; left: 0; bottom: 0; height: 2px; transform-origin: 0 50%; font-style: normal; }
.gizmo i::after { position: absolute; right: -12px; top: -8px; font: 700 11px var(--mono); }
.gizmo .x { width: 46px; background: var(--x); } .gizmo .x::after { content: "X"; color: var(--x); }
.gizmo .y { width: 30px; background: var(--y); transform: rotate(-35deg); } .gizmo .y::after { content: "Y"; color: var(--y); transform: rotate(35deg); }
.gizmo .z { width: 46px; background: var(--z); transform: rotate(-90deg); } .gizmo .z::after { content: "Z"; color: var(--z); transform: rotate(90deg); }
@media (max-width: 680px) {
  .gizmo, .corner { display: none; }
  .vp-stats { left: 16px; top: 14px; font-size: 11px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: block; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer .links { justify-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
