/* better be great — editorial, light and dark. One stylesheet for every page.
   Theme: follows the device by default; the header switch sets html[data-theme] (light | dark).
   Thread: software craft, distilled → a deck of methods → a few sharp tools → help for your team → contact. */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/newsreader-var.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 200 800; font-display: swap; src: url("../fonts/newsreader-var-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-mono-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #f5f4f0;
  --card: #ffffff;
  --ink: #121412;
  --ink-2: #3b3e39;
  --muted: #6e716a;
  --rule: #dcdad2;
  --rule-2: #c4c1b7;
  --green: #42eb79;              /* the logo cursor — used for marks only, never for text */
  --green-glow: 0 0 0 1px rgba(66, 235, 121, 0.25), 0 0 16px rgba(66, 235, 121, 0.55);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --header-bg: rgba(245, 244, 240, 0.82);
  --bar-a: #fbfbf9; --bar-b: #ecebe6;
  --shadow: rgba(18, 20, 18, .25);
  --wrap: 1160px;
  --side: clamp(16px, 4vw, 40px);
  --rail: 150px;                 /* left gutter that carries the thread */
  --ease: cubic-bezier(.2, .75, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121311;
    --card: #1b1d1a;
    --ink: #ecebe5;
    --ink-2: #c4c5be;
    --muted: #8f928a;
    --rule: #2b2e29;
    --rule-2: #42463f;
    --header-bg: rgba(18, 19, 17, 0.8);
    --bar-a: #262824; --bar-b: #1c1e1b;
    --shadow: rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121311;
  --card: #1b1d1a;
  --ink: #ecebe5;
  --ink-2: #c4c5be;
  --muted: #8f928a;
  --rule: #2b2e29;
  --rule-2: #42463f;
  --header-bg: rgba(18, 19, 17, 0.8);
  --bar-a: #262824; --bar-b: #1c1e1b;
  --shadow: rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.wrap { width: min(100% - 2 * var(--side), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: var(--paper); font: 500 14px var(--sans); padding: 10px 14px; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand { display: block; line-height: 0; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.brand img { height: 26px; width: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
}
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--rule-2); border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; transition: border-color .25s, background .25s;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.js .site-header:not(.past-hero) .brand { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px); font: 500 14.5px var(--sans); }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav .btn-line { padding: 8px 16px; }
@media (max-width: 760px) {
  .nav a:not(.btn-line) { display: none; }
  .brand img { height: 22px; }
}

/* ---------- links & buttons ---------- */
.btn-line {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ink); border-radius: 999px;
  color: var(--ink); text-decoration: none; font: 500 15px var(--sans);
  padding: 12px 22px;
  transition: background .25s, color .25s;
}
.btn-line:hover { background: var(--ink); color: var(--paper) !important; }
.more {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 16px var(--sans); color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
}
.more .arr { display: inline-block; transition: transform .25s var(--ease); }
.more:hover .arr { transform: translateX(5px); }

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 14vh, 150px) 0 clamp(72px, 12vh, 128px); }
.wordmark {
  margin: 0 0 clamp(36px, 6vh, 64px);
  font: 700 clamp(1.7rem, 8.6vw, 6.4rem)/1 var(--mono);
  color: var(--ink); white-space: pre; letter-spacing: 0;
}
.wordmark span { display: inline-block; }
/* final state is the default; the keyframes describe where each glyph comes from */
.wordmark .k { transform: translateX(calc(var(--dx) * 1ch)); animation: wm-slide .8s cubic-bezier(.65, 0, .25, 1) 1s both; }
.wordmark .v { opacity: 0; transform: translateY(.95em) rotate(var(--rot)); animation: wm-drop .75s cubic-bezier(.55, 0, .8, .2) calc(.45s + var(--d) * 70ms) both; }
.wordmark .u { transform: translateX(calc(var(--dx) * 1ch)); animation: wm-slide .8s cubic-bezier(.65, 0, .25, 1) 1s both, wm-show .35s ease 1.55s both; }
.wordmark .cur {
  width: 1ch; height: .108em; vertical-align: -0.186em;
  background: var(--green); box-shadow: var(--green-glow);
  transform: translateX(calc(var(--dx) * 1ch));
  animation: wm-slide .8s cubic-bezier(.65, 0, .25, 1) 1s both, wm-show .3s ease 1.8s both, blink 1.1s steps(1) 2.6s infinite;
}
@keyframes wm-slide { from { transform: none; } }
@keyframes wm-drop { from { opacity: 1; transform: none; } }
@keyframes wm-show { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font: 400 clamp(2.5rem, 5.6vw, 4.9rem)/1.02 var(--serif);
  letter-spacing: -0.025em; color: var(--ink);
  margin: 0 0 28px; max-width: 14em;
}
.hero h1 em { font-style: italic; }
.hero .lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.6; max-width: 36em; margin: 0; }
.hero .lede a { color: var(--ink); text-decoration-color: var(--rule-2); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .2s; }
.hero .lede a:hover { text-decoration-color: var(--ink); }
.rise { animation: rise .9s var(--ease) both; }
.rise.d1 { animation-delay: .15s; } .rise.d2 { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- the story + its thread ---------- */
.story { position: relative; }
.thread { position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; pointer-events: none; }
.thread::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0.5px; width: 1px; background: var(--rule-2); }
.thread-fill { position: absolute; inset: 0; background: var(--green); transform-origin: top; transform: scaleY(1); }
.js .thread-fill { transform: scaleY(0); }

.chapter { position: relative; padding: clamp(88px, 12vw, 150px) 0 0 var(--rail); }
.chapter:last-child { padding-bottom: clamp(88px, 11vw, 140px); }
.node {
  position: absolute; left: 0; top: calc(clamp(88px, 12vw, 150px) + 5px);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--rule-2);
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.node.on, html:not(.js) .node { background: var(--green); border-color: var(--green); box-shadow: var(--green-glow); }
.node.end { width: 22px; height: 6px; border-radius: 1px; top: calc(clamp(88px, 12vw, 150px) + 22px); left: -3px; }
.node.end.on { animation: blink 1.1s steps(1) infinite; }
.num { position: absolute; left: 34px; top: calc(clamp(88px, 12vw, 150px) + 2px); font: 500 13px var(--mono); color: var(--muted); }

.kicker { font: 500 12.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.kicker .kn { display: none; }
.chapter h2 {
  font: 400 clamp(2.3rem, 4.6vw, 3.9rem)/1.04 var(--serif);
  letter-spacing: -0.022em; color: var(--ink); margin: 0 0 22px;
}
.chapter .lede { font-size: 1.15rem; max-width: 34em; margin: 0; }

@media (max-width: 900px) {
  .thread, .node, .num { display: none; }
  .chapter { padding-left: 0; border-top: 1px solid var(--rule); margin-top: 0; }
  .kicker .kn { display: inline; margin-right: .8em; color: var(--ink); }
}

/* ---------- 01 the deck ---------- */
/* the product shot: it settles into place when it scrolls in, then follows the pointer with a slight tilt */
.deck-figure { margin: clamp(40px, 6vw, 68px) 0 clamp(24px, 3vw, 36px); perspective: 1400px; }
.js .deck-figure { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .deck-figure.in { opacity: 1; transform: none; }
.deck-shot {
  display: block; position: relative;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s var(--ease);
}
.js .deck-figure:not(.in) .deck-shot { transform: rotateX(16deg) scale(.96); }
.deck-figure.in .deck-shot { transition: transform 1.1s var(--ease); }
.deck-figure.live .deck-shot { transition: transform .45s var(--ease); }
.deck-shot:focus-visible { outline-offset: 6px; }
.deck-shot img { width: 100%; }
.byline { font-size: 15px; color: var(--muted); margin: 0 0 28px; }

/* ---------- 02 tools ---------- */
.irrlicht {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center;
  margin: clamp(40px, 6vw, 64px) 0 clamp(36px, 5vw, 56px);
}
.menubar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 40px; padding: 0 16px;
  background: linear-gradient(var(--bar-a), var(--bar-b)); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 14px 34px -18px var(--shadow);
  font: 500 13px var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden;
}
.menubar .menus { display: flex; gap: 18px; color: var(--muted); }
.menubar .menus b { color: var(--ink); font-weight: 500; }
.menubar .status { display: flex; align-items: center; gap: 12px; }
.lamp { width: 10px; height: 10px; border-radius: 50%; }
.lamp.p { background: #a855f7; box-shadow: 0 0 10px rgba(168, 85, 247, .6); }
.lamp.o { background: #fb923c; box-shadow: 0 0 10px rgba(251, 146, 60, .6); }
.lamp.g { background: var(--green); box-shadow: 0 0 10px rgba(66, 235, 121, .7); }
.menubar .time { margin-left: 6px; color: var(--ink); }
.irrlicht h3 { font: 400 2rem/1.1 var(--serif); color: var(--ink); margin: 0 0 8px; letter-spacing: -0.015em; }
.irrlicht p { margin: 0 0 16px; }
.irrlicht a { font-weight: 500; color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--rule-2); }
.irrlicht a:hover { text-decoration-color: var(--ink); }
@media (max-width: 760px) { .irrlicht { grid-template-columns: 1fr; } .menubar .menus span:nth-child(n+3) { display: none; } }

.tools { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--rule); }
.tools a {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; gap: 24px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.tools .tn { font: 400 1.3rem/1.2 var(--serif); color: var(--ink); }
.tools .td { color: var(--muted); font-size: 15.5px; }
.tools .tg { color: var(--muted); transition: transform .25s var(--ease), color .25s; }
.tools a:hover .tg { transform: translate(3px, -3px); color: var(--ink); }
.tools a:hover .tn { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (max-width: 640px) { .tools a { grid-template-columns: 1fr auto; row-gap: 4px; } .tools .td { grid-column: 1; grid-row: 2; } .tools .tg { grid-row: 1; grid-column: 2; } }

/* ---------- 03 consulting ---------- */
.consult { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; margin-top: clamp(40px, 6vw, 64px); max-width: 860px; }
.consult img { width: 132px; height: 132px; object-fit: cover; object-position: 50% 18%; border-radius: 50%; filter: grayscale(1) contrast(1.05); }
.offers { list-style: none; margin: 26px 0 32px; padding: 0; border-top: 1px solid var(--rule); }
.offers li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.offers b { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) { .consult { grid-template-columns: 1fr; } .consult img { width: 96px; height: 96px; } }

/* ---------- 04 contact ---------- */
.mail {
  display: inline-block; margin-top: 8px;
  font: 500 clamp(1.15rem, 3.4vw, 2.3rem)/1.2 var(--mono); letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
  border-bottom: 2px solid var(--green);
}
.mail:hover { background: rgba(66, 235, 121, .14); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 44px 0 40px; font-size: 14.5px; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer img { height: 20px; width: auto; margin-bottom: 16px; }
.site-footer address { font-style: normal; line-height: 1.7; }
.site-footer h4 { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--ink); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; line-height: 1.95; }
.site-footer a { text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; font: 500 12.5px var(--mono); color: var(--muted); }
.colophon a { color: var(--muted); }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .cols > div:first-child { grid-column: 1 / -1; } }

/* ---------- legal pages ---------- */
.legal { padding: clamp(56px, 9vw, 112px) 0; }
.legal .wrap { max-width: 740px; }
.legal h1 { font: 400 clamp(2.4rem, 5.4vw, 3.8rem)/1.05 var(--serif); letter-spacing: -0.025em; color: var(--ink); margin: 0 0 36px; overflow-wrap: anywhere; }
.legal h2 { font: 400 1.6rem/1.2 var(--serif); color: var(--ink); margin: 48px 0 12px; }
.legal h3 { font: 500 1rem var(--sans); color: var(--ink); margin: 26px 0 6px; }
.legal p { margin: 0 0 12px; overflow-wrap: anywhere; }
.legal strong { color: var(--ink); font-weight: 500; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal .back { font: 500 14px var(--sans); text-decoration: none; color: var(--muted); }
.legal .back:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* the theme switch needs scripts; without them the page simply follows the device */
html:not(.has-theme) .theme-toggle { display: none; }
