/* Aix 42 — aix42.com. Designramar från Lars Hagelins spec (2026-10-30):
 * grafit/svart #0A0A0A, benvitt #F5F5F5, stålgrå #888888; Inter (rubriker/brödtext) + JetBrains Mono
 * (markörer, navigering, sidfot). Logotyp: AIX i tung sans (benvit) + 42 i monospace (stålgrå).
 * "Less is more": stort negativt utrymme, tunna linjer, inga bilder. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/jetbrains-mono-400.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/jetbrains-mono-500.woff2) format('woff2');
}

:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --text: #F5F5F5;
  --soft: #C9C9C9;
  --muted: #888888;
  --line: #262626;
  --faint: #4A4A4A;
  --sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Roboto Mono', ui-monospace, monospace;
  --max: 1200px;
  --gutter: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--text); color: var(--bg); }
a { color: inherit; }
a:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); position: relative; }

/* ---------- Sidhuvud ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  background: rgba(10, 10, 10, .72);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }

.logo { display: inline-flex; align-items: baseline; gap: .28em; text-decoration: none; font-size: 22px; line-height: 1; }
.logo-aix { font-family: var(--sans); font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.logo-42 { font-family: var(--mono); font-weight: 500; color: var(--muted); letter-spacing: -.02em; transition: color .25s; }
.logo:hover .logo-42 { color: var(--text); }

.nav { display: flex; gap: 32px; }
.nav a {
  font: 400 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 8px 0; position: relative; transition: color .2s;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 120px 0 96px; overflow: hidden;
}
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 75%); }
.hero-inner { position: relative; }
.hero h1 {
  margin: 0 auto; max-width: 14ch;
  font: 600 clamp(44px, 8.4vw, 112px)/.98 var(--sans); letter-spacing: -.045em;
}
.hero-lead {
  margin: 32px auto 0; max-width: 34em;
  font-size: clamp(17px, 1.7vw, 20px); line-height: 1.6; color: var(--muted);
}
.cursor {
  display: inline-block; width: .09em; height: .78em; margin-left: .08em; vertical-align: -.02em;
  background: var(--muted); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  font: 400 14px/1 var(--mono); color: var(--faint); text-decoration: none; padding: 10px; transition: color .2s;
}
.scroll-cue:hover { color: var(--text); }

/* ---------- Sektioner ---------- */
.section { position: relative; padding: clamp(88px, 13vw, 168px) 0; }
.rule { border: 0; height: 1px; background: var(--line); margin: 0 0 28px; }
.marker {
  margin: 0 0 40px;
  font: 400 12px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.hero .marker { margin-bottom: 28px; color: var(--faint); }
.idx { color: var(--text); margin-right: 14px; }
.prose { max-width: 40em; }
.prose p { margin: 0 0 1.2em; color: var(--soft); }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-size: clamp(22px, 2.6vw, 32px); line-height: 1.32; letter-spacing: -.018em;
  color: var(--text); font-weight: 500; max-width: 26em;
}
.prose .lead + p { margin-top: 1.6em; }

/* The Thesis: vänsterställd */
.thesis .prose { max-width: 50em; }

/* The Engine: förskjuten åt höger, nodstruktur i bakgrunden */
.engine { overflow: hidden; }
.node-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.6) 45%, transparent 85%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.6) 45%, transparent 85%); }
.engine-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.engine-body { grid-column: 5 / span 8; }
.engine h2 {
  margin: 0 0 28px; font: 600 clamp(40px, 6vw, 76px)/1 var(--sans); letter-spacing: -.04em;
}
.tagline {
  margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line);
  font: 400 15px/1.6 var(--mono); color: var(--muted);
}
.tagline span { color: var(--text); }

/* Modes of Deployment: strikt tvåkolumns-grid, lika tyngd */
.modes { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.mode { padding: 40px 48px 8px 0; }
.mode + .mode { padding: 40px 0 8px 48px; border-left: 1px solid var(--line); }
.mode-no { margin: 0 0 18px; font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: .06em; }
.mode h3 { margin: 0 0 22px; font: 600 clamp(24px, 2.4vw, 30px)/1.2 var(--sans); letter-spacing: -.02em; }
.mode h3 span { display: block; font-weight: 400; color: var(--muted); font-size: .72em; margin-top: 6px; letter-spacing: -.01em; }
.mode p { margin: 0 0 1.1em; color: var(--soft); }
.mode ul { list-style: none; margin: 8px 0 28px; padding: 0; border-top: 1px solid var(--line); }
.mode li { padding: 16px 0 16px 28px; border-bottom: 1px solid var(--line); color: var(--soft); position: relative; }
.mode li::before { content: '*'; position: absolute; left: 2px; top: 16px; font-family: var(--mono); color: var(--muted); }
.mode li strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* ---------- Sidfot (Terminalen) ---------- */
.terminal { padding: clamp(72px, 10vw, 128px) 0 40px; font-family: var(--mono); }
.term { margin: 0 0 56px; display: grid; gap: 14px; }
.term div { display: grid; grid-template-columns: 220px 1fr; gap: 24px; font-size: 15px; line-height: 1.5; }
.term dt { color: var(--muted); }
.term dt::after { content: ':'; }
.term dd { margin: 0; color: var(--text); }
.term a { text-decoration: none; border-bottom: 1px solid var(--faint); transition: border-color .2s; }
.term a:hover { border-color: var(--text); }
.notice { max-width: 72em; margin: 0 0 40px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.notice span { color: var(--soft); }
.term-foot {
  display: flex; flex-wrap: wrap; gap: 12px 32px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--faint);
}
.term-foot a { color: var(--faint); text-decoration: none; }
.term-foot a:hover { color: var(--text); }
.egg { margin-left: auto; cursor: default; transition: color .3s; }
.egg:hover { color: var(--muted); }

/* ---------- Avslöjning vid scroll (bara med JS och utan reducerad rörelse) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .engine-body { grid-column: 1 / -1; }
  .modes { grid-template-columns: 1fr; }
  .mode, .mode + .mode { padding: 36px 0 8px; border-left: 0; }
  .mode + .mode { border-top: 1px solid var(--line); margin-top: 24px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .top-row { height: auto; padding-top: 14px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav { gap: 18px; flex-wrap: wrap; }
  .nav a { font-size: 10.5px; letter-spacing: .1em; padding: 4px 0; }
  html { scroll-padding-top: 96px; }
  .hero { text-align: left; place-items: center start; }
  .hero h1, .hero-lead { margin-left: 0; }
  .term div { grid-template-columns: 1fr; gap: 2px; }
  .egg { margin-left: 0; }
}
