/* Tinker Scholar — STEM Academy · shared brand styles */
:root {
  --navy-950: #050b1c;
  --navy-900: #06102a;
  --navy-850: #071433;
  --navy-800: #081638;
  --navy-700: #0c2160;
  --line: #1d3a7a;
  --line-2: #23458f;
  --cyan: #4cc3ff;
  --cyan-2: #7fdcff;
  --blue: #1e6fe0;
  --yellow: #ffd21f;
  --text: #ffffff;
  --muted: #d5e1f7;
  --muted-2: #a9bde3;
  --danger: #ff7a7a;
  --ok: #6ee7a8;
  --radius: 2px;
  --f-display: "Archivo Black", Impact, sans-serif;
  --f-cond: "Oswald", "Arial Narrow", sans-serif;
  --f-tech: "Chakra Petch", "Segoe UI", sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--text); }
a:hover { color: var(--yellow); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 720px) { .wrap { padding: 0 16px; } }

.grid-bg {
  background-color: var(--navy-850);
  background-image:
    linear-gradient(rgba(76,150,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76,150,255,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,20,54,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-family: var(--f-cond); font-weight: 700; font-size: 29px; line-height: 1; letter-spacing: .01em; }
.brand-sub { font-family: var(--f-tech); font-weight: 500; font-size: 12px; letter-spacing: .5em; color: var(--cyan); }
.nav { display: flex; align-items: center; gap: 4px 26px; font-family: var(--f-tech); font-weight: 600; font-size: 14px; letter-spacing: .06em; }
.nav a { text-decoration: none; padding: 12px 0; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); width: 46px; height: 46px; cursor: pointer; }
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--navy-800); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 10px; text-align: center; justify-content: center; }
  .brand-name { font-size: 24px; }
  .brand-sub { font-size: 10px; letter-spacing: .4em; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-tech); font-weight: 700; font-size: 16px; letter-spacing: .04em;
  text-decoration: none; text-transform: uppercase;
  padding: 16px 24px; border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; line-height: 1.1; min-height: 48px;
}
.btn-primary { background: var(--yellow); color: var(--navy-900); }
.btn-primary:hover { background: #ffe066; color: var(--navy-900); }
.btn-outline { border-color: var(--cyan); color: var(--text); background: transparent; }
.btn-outline:hover { background: rgba(76,195,255,.12); color: var(--text); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--cyan); color: var(--text); }
.btn-sm { padding: 11px 16px; font-size: 13px; min-height: 44px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.nav .btn { padding: 14px 24px; font-size: 16px; }

/* ---------- type helpers ---------- */
.eyebrow { display: flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-weight: 700; font-size: 14px; color: var(--yellow); letter-spacing: .02em; margin: 0; }
.eyebrow::after { content: ""; flex: 0 1 160px; height: 1px; background: var(--yellow); }
.h-section { font-family: var(--f-cond); font-weight: 700; font-size: clamp(36px, 4.6vw, 62px); line-height: 1.05; letter-spacing: .01em; margin: 20px 0 8px; text-transform: uppercase; }
.lede { color: var(--muted); font-size: 19px; margin: 0; }
.tech { font-family: var(--f-tech); letter-spacing: .08em; }
.mono { font-family: var(--f-mono); }
.center { text-align: center; }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--line-2); background: linear-gradient(180deg, #0b1d4a, var(--navy-800)); }
.cut { clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px); }
.glow-card { filter: drop-shadow(0 0 10px rgba(76,195,255,.5)); }
.glow-card > .cut-outer { background: #3aa8ff; padding: 2px; }
.glow-card .cut-inner { background: linear-gradient(180deg, var(--navy-700), var(--navy-800)); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--f-tech); font-weight: 600; font-size: 13px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.input, select.input, textarea.input {
  font: inherit; color: var(--text); background: #0a1a45; border: 1px solid var(--line-2);
  padding: 13px 14px; border-radius: var(--radius); min-height: 48px; width: 100%;
}
.input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(76,195,255,.25); }
.form-error { color: var(--danger); font-size: 15px; min-height: 22px; margin: 0; }
.form-note { color: var(--muted-2); font-size: 14px; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-950); overflow: hidden; }
.site-footer .moon { width: 100%; height: 150px; object-fit: cover; object-position: center top; }
.footer-body { background: linear-gradient(180deg, #0a1636, var(--navy-950)); padding: 8px 0 40px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 28px; }
.footer-tag { display: flex; gap: 18px; align-items: flex-start; }
.footer-tag::before { content: ""; width: 40px; height: 3px; background: var(--yellow); margin-top: 13px; flex: none; }
.footer-tag p { margin: 0; font-family: var(--f-tech); font-weight: 500; font-size: 20px; letter-spacing: .2em; line-height: 1.5; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted-2); }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-motto { margin: 0; font-family: var(--f-mono); font-size: 13px; letter-spacing: .2em; color: var(--muted); }

/* ---------- motion ---------- */
.spin { transform-box: fill-box; transform-origin: center; animation: tsSpin 7s linear infinite; }
.spin-slow { transform-box: fill-box; transform-origin: center; animation: tsSpin 18s linear infinite; }
.pulse { transform-box: fill-box; transform-origin: center; animation: tsPulse 1.8s ease-in-out infinite; }
.flow { stroke-dasharray: 4 6; animation: tsFlow 1.2s linear infinite; }
.draw { stroke-dasharray: 220; stroke-dashoffset: 220; animation: tsDraw 3.2s ease-in-out infinite; }
.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: tsGrow 3.2s ease-in-out infinite; }
.d1 { animation-delay: .15s; } .d2 { animation-delay: .3s; } .d3 { animation-delay: .45s; }
.bob { transform-box: fill-box; animation: tsBob 2.4s ease-in-out infinite; }
.cube-stage { width: 120px; height: 120px; perspective: 520px; margin: 0 auto; }
.cube { position: relative; width: 96px; height: 96px; margin: 12px; transform-style: preserve-3d; animation: tsCube 9s linear infinite; }
.cube .face { position: absolute; inset: 0; border: 2px solid #5cc8ff; background: rgba(76,195,255,.09); box-shadow: 0 0 14px rgba(76,195,255,.45) inset; }
.cube .f1 { transform: translateZ(48px); } .cube .f2 { transform: rotateY(180deg) translateZ(48px); }
.cube .f3 { transform: rotateY(90deg) translateZ(48px); } .cube .f4 { transform: rotateY(-90deg) translateZ(48px); }
.cube .f5 { transform: rotateX(90deg) translateZ(48px); } .cube .f6 { transform: rotateX(-90deg) translateZ(48px); }
.cube .inner { position: absolute; inset: 30px; transform-style: preserve-3d; animation: tsCube 5s linear infinite reverse; }
.cube .inner .face { border-color: var(--yellow); background: rgba(255,210,31,.08); box-shadow: none; }
.cube .inner .f1 { transform: translateZ(18px); } .cube .inner .f2 { transform: rotateY(180deg) translateZ(18px); }
.cube .inner .f3 { transform: rotateY(90deg) translateZ(18px); } .cube .inner .f4 { transform: rotateY(-90deg) translateZ(18px); }
.cube .inner .f5 { transform: rotateX(90deg) translateZ(18px); } .cube .inner .f6 { transform: rotateX(-90deg) translateZ(18px); }
@keyframes tsSpin { to { transform: rotate(360deg); } }
@keyframes tsPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .65; } }
@keyframes tsFlow { to { stroke-dashoffset: -20; } }
@keyframes tsDraw { 0% { stroke-dashoffset: 220; } 55%,80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -220; } }
@keyframes tsGrow { 0% { transform: scaleY(.05); } 35%,80% { transform: scaleY(1); } 100% { transform: scaleY(.05); } }
@keyframes tsBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes tsCube { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin, .spin-slow, .pulse, .flow, .draw, .grow, .bob, .cube, .cube .inner { animation: none; }
  .draw { stroke-dashoffset: 0; }
}

/* ---------- 3D lab canvas ---------- */
.lab-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.lab-canvas:active { cursor: grabbing; }
.range { width: 100%; accent-color: var(--yellow); min-height: 32px; }
