/* ==========================================================================
   BLADE RUNNER, SOBER EDITION
   Fog, concrete and dusty ochre. Closer to 2049 than to the neon of 1982.
   No rain, no glow, no flicker. Same class names as bladerunner.css,
   so the two files can be swapped without touching your HTML.

   Layout     .container  .section  .grid  .grid--2  .grid--3  .stack
   Header     .site-header  .site-nav  .brand
   Hero       .hero  .hero__title  .hero__lede  (.neon is accepted, and does nothing)
   Surfaces   .panel  .panel--amber  .panel--magenta  .readout
   Controls   .btn  .btn--primary  .btn--ghost  .tag
   Forms      label  input  textarea  select
   Data       table  .data-table
   Footer     .site-footer
   Utilities  .text-dim  .text-amber  .text-cyan  .text-magenta  .scanlines
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;500;600&family=Barlow:wght@400;500&family=IBM+Plex+Mono:wght@400&display=swap");

/* ---------- Tokens ---------- */
:root {
  --ink: #0f1112;
  --concrete: #1a1e20;
  --slab: #232829;
  --line: #34393a;

  --text: #d6d0c4;
  --dim: #8b867b;

  --ochre: #c48a4c;      /* the one accent: sodium light through haze */
  --ochre-soft: rgba(196, 138, 76, 0.14);
  --steel: #7ea0a6;      /* links and secondary accent, kept quiet */
  --rust: #a8553f;       /* errors and warnings only */

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", "Courier New", monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.4rem;
  --step-2: 2rem;
  --step-3: clamp(2.2rem, 4vw, 3rem);
  --step-4: clamp(2.8rem, 8vw, 6.25rem);

  --measure: 64ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  background-color: var(--ink);
  /* Dust-coloured fog rising from the horizon, a cold grey light above */
  background-image:
    radial-gradient(ellipse 90% 50% at 50% 110%, rgba(196, 138, 76, 0.20), transparent 70%),
    radial-gradient(ellipse 70% 35% at 80% -10%, rgba(126, 160, 166, 0.10), transparent 70%),
    linear-gradient(180deg, var(--concrete) 0%, var(--ink) 100%);
  background-attachment: fixed;
}

/* Fine film grain, static and very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img, svg, video { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 400; }
h4 { font-size: var(--step-0); font-weight: 500; letter-spacing: 0.18em; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

a {
  color: var(--steel);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 0.2s;
}
a:hover { color: var(--text); }

::selection { background: var(--ochre); color: var(--ink); }

:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

hr { border: 0; height: 1px; margin: 3.5rem 0; background: var(--line); }

code, kbd, pre, samp { font-family: var(--font-data); font-size: 0.9em; color: var(--ochre); }

/* ---------- Layout ---------- */
.container { width: min(100% - 2.5rem, 1080px); margin-inline: auto; }

.section { padding-block: clamp(4rem, 9vw, 8rem); }

.stack > * + * { margin-top: 1.00rem; }

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------- Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 18, 0.85);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { color: var(--ochre); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }

.site-nav a {
  padding: 0.3rem 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--ochre); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(6rem, 16vw, 12rem) clamp(4rem, 10vw, 8rem); }

.hero__title {
  font-size: var(--step-4);
  font-weight: 300;
  letter-spacing: 0.1em;
  line-height: 1;
  margin-bottom: 0.5em;
}

.hero__lede {
  max-width: 42ch;
  margin-bottom: 2.5rem;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--dim);
}

/* Kept for compatibility with the neon edition: a plain title here */
.neon, .neon--magenta { text-shadow: none; animation: none; }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  padding: 1.75rem;
  background: var(--slab);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ochre);
  transition: border-color 0.25s, background-color 0.25s;
}
.panel > :last-child { margin-bottom: 0; }
.panel:hover { background: #292f30; border-color: #4a5051; border-left-color: var(--ochre); }

/* The accent variants share one palette here: restraint over colour coding */
.panel--amber   { border-left-color: var(--ochre); }
.panel--magenta { border-left-color: var(--rust); }

/* Terminal readout: dim amber on near-black, no glow */
.readout {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-data);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ochre);
  background: #0b0c0c;
  border: 1px solid var(--line);
}

.scanlines { position: relative; }
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
}

/* ---------- Buttons and tags ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--dim);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { color: var(--ink); background: var(--text); border-color: var(--text); }

.btn--primary { color: var(--ink); background: var(--ochre); border-color: var(--ochre); }
.btn--primary:hover { background: #d9a165; border-color: #d9a165; }

.btn--ghost { color: var(--dim); border-color: var(--line); }
.btn--ghost:hover { color: var(--text); background: var(--slab); border-color: var(--dim); }

.tag {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  font-family: var(--font-data);
  font-size: var(--step--1);
  color: var(--dim);
  border: 1px solid var(--line);
}

/* ---------- Forms ---------- */
label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.2s;
}

input::placeholder, textarea::placeholder { color: #565b5a; }

input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ochre); }

input:user-invalid, textarea:user-invalid { border-color: var(--rust); }

textarea { min-height: 8rem; resize: vertical; }

/* ---------- Tables ---------- */
table, .data-table { width: 100%; border-collapse: collapse; font-family: var(--font-data); font-size: 0.92rem; }

th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--dim);
}

td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }

tbody tr:hover td { background: var(--ochre-soft); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 3rem;
  font-size: var(--step--1);
  color: var(--dim);
  border-top: 1px solid var(--line);
}

/* ---------- Utilities ---------- */
.text-dim     { color: var(--dim); }
.text-amber   { color: var(--ochre); }
.text-cyan    { color: var(--steel); }
.text-magenta { color: var(--rust); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; padding-block: 0.8rem; }
  .panel { padding: 1.4rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
