/* ==========================================================================
   base.css: page layout and typography. No gimmicks in here.
   ========================================================================== */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
/* Plain night gradient for pages without the animated scene (legal pages) */
body { background: radial-gradient(ellipse at 50% 120%, #1B1B4A 0%, #090818 55%, #05040C 100%) fixed; }
a { color: var(--neon-a); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--neon-a); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--neon-b); color: var(--bg); }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 16px; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 600; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header: fox icon + name. Right side stays free for the cube. ---------- */
.site-header { position: absolute; inset: 0 0 auto; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 28px; padding-top: 18px; padding-bottom: 18px; padding-right: calc(var(--gutter) + var(--cube-corner) + 16px); }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.mark img { width: 26px; height: auto; display: block; }
.site-header nav { display: flex; gap: 20px; margin-left: auto; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--text); }

/* ---------- Intro ---------- */
.intro { padding: clamp(120px, 20vh, 200px) 0 clamp(64px, 10vh, 120px); }
.kicker { font-family: var(--display); font-weight: 600; color: var(--neon-a); font-size: clamp(1rem, 1.8vw, 1.35rem); margin-bottom: 14px; }
.title { font-weight: 800; font-size: clamp(3rem, 8.4vw, 7.4rem); line-height: 0.92; letter-spacing: -0.03em; margin-bottom: 28px; }
.title span { display: block; }
.lede { max-width: 38ch; font-size: clamp(1.1rem, 1.9vw, 1.4rem); }
.who { margin-top: clamp(48px, 8vh, 88px); }
.bio { max-width: var(--measure); color: #D2D2DC; }

/* Two columns: text left, cube spot and socials right (stacked on phones) */
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.intro-side { padding-top: clamp(0px, 4vh, 48px); }
.socials { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.socials li > a, .socials li > span { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; backdrop-filter: blur(8px); }
.socials li > a:hover { border-color: var(--neon-a); color: var(--neon-a); box-shadow: var(--glow-a); }
.socials li.soon { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.socials li.soon > span { all: unset; }
.socials small { font-size: 0.8rem; opacity: 0.7; }
.media { display: block; margin-top: 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.media img { display: block; width: 100%; height: auto; }
.media span { display: block; padding: 10px 14px; background: var(--surface); }

/* Contact form */
.contact-form { display: grid; gap: 14px; max-width: 620px; margin: 20px 0 28px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; }
.contact-form input, .contact-form textarea { font: inherit; color: var(--text); background: rgba(10, 8, 30, 0.8); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--neon-a); outline-offset: 1px; }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-form button { justify-self: start; }
.form-status { min-height: 1.6em; color: var(--neon-a); margin: 0; }

/* Soft dark halo behind text so it stays readable over the night scene */
.intro-text, .section h2, .hint, .project > h2, .project > p, .project > h3, .project > ul, .timeline, .site-header {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 22px rgba(5, 4, 12, 0.9);
}

/* ---------- Generic section ---------- */
.section { padding: clamp(64px, 10vh, 120px) 0; border-top: 1px solid var(--line); }
.hint { color: var(--muted); max-width: 48ch; }

/* ---------- Project articles (inside the unfold panel, or stacked without JS) ---------- */
.project { padding: 8px 0 48px; }
.project .tagline { font-size: 1.15rem; max-width: 56ch; }
.project p, .project ul { max-width: var(--measure); }
.project ul { padding-left: 1.2em; }
.project li { margin-bottom: 6px; }
.verdict { display: inline-flex; gap: 10px; align-items: baseline; font-weight: 600; }
.verdict::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--neon-a); box-shadow: var(--glow-a); flex: none; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 28px; margin: 28px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.9375rem; }
.stat.a b { color: var(--neon-a); text-shadow: var(--glow-a); }
.stat.b b { color: var(--neon-b); text-shadow: var(--glow-b); }
.stat.pending b { color: var(--muted); text-shadow: none; }

/* Interactive chart block */
.instrument { background: var(--surface); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.6vw, 28px); margin: 24px 0 36px; }
.instrument canvas { display: block; width: 100%; height: clamp(240px, 38vh, 420px); border-radius: 12px; background: var(--bg); margin: 14px 0 18px; }
.readout { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-bottom: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.note { color: var(--muted); font-size: 0.9375rem; margin-top: 14px; }
.slider { display: grid; gap: 4px; flex: 1 1 260px; }
.slider label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.slider output { color: var(--neon-a); font-family: var(--display); }
input[type="range"] { width: 100%; accent-color: var(--neon-a); height: 28px; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 11px 20px;
  border: 1px solid var(--line); background: transparent; color: var(--text); text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--text); }
button.go { background: var(--neon-a); color: #060418; border-color: var(--neon-a); box-shadow: var(--glow-a); }
button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.table-scroll { overflow-x: auto; margin: 8px 0 24px; }
table { border-collapse: collapse; min-width: 520px; width: 100%; max-width: 820px; }
th, td { text-align: left; padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; }
tr.hl td { color: var(--neon-a); font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.timeline li { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline time { color: var(--muted); }
.mail { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 4.4vw, 3rem); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.mail:hover { color: var(--neon-a); text-shadow: var(--glow-a); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 0.9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--muted); }

/* ---------- Legal pages ---------- */
.legal { padding: 120px 0 80px; max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 6vw, 3.2rem); overflow-wrap: anywhere; }
.legal h2 { font-size: 1.2rem; margin-top: 32px; }
.legal address { font-style: normal; margin-bottom: 1em; }

@media (max-width: 860px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-side { padding-top: 0; }
  .hero-slot { width: min(78vw, 340px); }
}
@media (max-width: 720px) {
  .site-header nav a.hide-s { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .mark span { display: none; }
}
