/* KaadzOS website — hand-authored editorial stylesheet.
   Pure black, pure white, one grotesk. No scripts, no cards, no decoration
   that does not carry information. */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --black: #000;
  --white: #fff;
  --ink: #ededed;              /* body copy */
  --grey: #9c9c9c;             /* secondary copy, 7.3:1 on black */
  --grey-dim: #8a8a8a;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.36);

  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;

  --pad: clamp(18px, 4.4vw, 72px);
  --maxw: 1560px;
  --section: clamp(56px, 8vw, 128px);
}

@media (prefers-contrast: more) {
  :root {
    --ink: #fff;
    --grey: #d0d0d0;
    --grey-dim: #b8b8b8;
    --line: rgba(255, 255, 255, 0.34);
    --line-strong: rgba(255, 255, 255, 0.6);
  }
}

* { box-sizing: border-box; }

html {
  background: var(--black);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

/* A hairline scrollbar: a 4px visible rule inside a 10px draggable strip,
   black track, white on hover. The WebKit pseudo-elements carry Blink and
   WebKit; Firefox gets the standard properties below. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: var(--black);
}

::-webkit-scrollbar-track { background: var(--black); }

::-webkit-scrollbar-thumb {
  background: #5c5c5c;
  border: 3px solid var(--black);
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active { background: var(--white); }

::-webkit-scrollbar-corner { background: var(--black); }

/* Code blocks get a slimmer horizontal version of the same hairline. */
pre::-webkit-scrollbar { height: 6px; }

pre::-webkit-scrollbar-thumb { border-width: 1px; }

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #5c5c5c var(--black);
  }
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.15rem);
  line-height: 1.55;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--white); color: var(--black); }

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

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* ------------------------------------------------------------- utilities */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
}

.skip {
  position: absolute;
  top: -200px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--white);
  color: var(--black);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skip:focus { top: 12px; }

.lede, .cols p, .afternote, .spec dd { text-wrap: pretty; }

/* -------------------------------------------------------------- masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--black);
  border-bottom: 1px solid var(--line);
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 48px);
  padding-block: 15px;
}

.wordmark {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
}

.masthead-meta { margin: 0; }

.masthead-nav {
  display: flex;
  gap: clamp(16px, 2.6vw, 36px);
}

.masthead-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.masthead-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.masthead-nav a:hover::after,
.masthead-nav a:focus-visible::after { transform: scaleX(1); }

.masthead-nav a:hover,
.masthead-nav a:focus-visible { color: var(--white); }

/* ------------------------------------------------------------------ hero */
.hero { padding: clamp(48px, 8.2vw, 120px) 0 clamp(28px, 4vw, 52px); }

.kicker { margin: 0 0 clamp(24px, 4.5vw, 52px); }

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 13vw, 11.4rem);
  line-height: 0.86;
  letter-spacing: -0.048em;
  font-weight: 760;
  text-wrap: balance;
}

h1 .line { display: block; }

h1 .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.hero-foot {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 84px);
  align-items: end;
  margin-top: clamp(30px, 5.2vw, 66px);
}

.lede {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(1.06rem, 1.5vw, 1.36rem);
  line-height: 1.42;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 30px;
  justify-content: flex-end;
}

.btn {
  display: inline-block;
  padding: 1.05em 1.55em;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
  font-weight: 640;
  font-size: 0.95rem;
  letter-spacing: -0.008em;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--black); color: var(--white); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding-bottom: 5px;
  color: var(--white);
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.15s ease;
}

.arrow-link:hover { border-color: var(--white); }

.arrow-link span { transition: transform 0.18s ease; }

.arrow-link:hover span { transform: translateX(4px); }

.ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: clamp(30px, 5vw, 56px) 0 0;
  padding: 15px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.ticker li {
  padding-right: clamp(16px, 2.4vw, 32px);
  margin-right: clamp(16px, 2.4vw, 32px);
  border-right: 1px solid var(--line);
}

.ticker li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

/* ------------------------------------------------------------ screenshot */
.shot {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  border-top: 1px solid var(--line);
  margin: 0;
  padding-block: 14px;
}

/* -------------------------------------------------------------- chapters */
.chapter {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 3.1fr);
  gap: clamp(24px, 4vw, 72px);
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.shot + .shell .chapter:first-child { border-top: 0; }

.chapter-index {
  margin: 0;
  position: sticky;
  top: 84px;
  align-self: start;
}

.chapter-body { min-width: 0; }

h2 {
  margin: 0 0 clamp(28px, 4vw, 52px);
  font-size: clamp(2.3rem, 6.4vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 720;
  text-wrap: balance;
}

.statement {
  font-size: clamp(1.7rem, 3.4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-weight: 520;
  max-width: 30ch;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3.4vw, 52px);
  color: var(--grey);
  max-width: 78ch;
}

.cols p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.82em;
  letter-spacing: 0;
  color: var(--white);
}

/* ------------------------------------------------------------------ spec */
.spec {
  margin: 0;
  border-top: 1px solid var(--line);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) 2fr;
  gap: clamp(16px, 3vw, 44px);
  padding-block: clamp(16px, 2vw, 22px);
  border-bottom: 1px solid var(--line);
}

.spec dt {
  padding-top: 0.35em;
  transition: color 0.2s ease;
}

.spec-row:hover dt { color: var(--white); }

.spec dd {
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.19rem);
  line-height: 1.46;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ----------------------------------------------------------------- packs */
.packs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(22px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(2.1rem, 5.8vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 720;
}

.packs li {
  display: inline-flex;
  align-items: baseline;
}

.afternote {
  margin: clamp(28px, 4vw, 48px) 0 0;
  max-width: 58ch;
  color: var(--grey);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.6;
}

/* ----------------------------------------------------------------- stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: clamp(20px, 2.8vw, 34px) clamp(14px, 2vw, 28px) clamp(20px, 2.8vw, 34px) 0;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: 0; padding-right: 0; }

.stat b {
  display: block;
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 12px;
  color: var(--grey-dim);
}

/* -------------------------------------------------------------- download */
.download-actions {
  justify-content: flex-start;
  margin-bottom: clamp(34px, 5vw, 60px);
}

.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 44px);
}

.code-label {
  margin: 0 0 10px;
  color: var(--grey-dim);
}

pre {
  margin: 0;
  padding: clamp(16px, 2vw, 22px);
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--black);
  font-family: var(--mono);
  font-size: clamp(0.76rem, 0.85vw, 0.84rem);
  line-height: 1.65;
  color: var(--ink);
  transition: border-color 0.2s ease;
}

pre:hover { border-color: var(--line-strong); }

pre code {
  border: 0;
  font-size: inherit;
  color: inherit;
}

/* ---------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 7vw, 92px) 0 clamp(26px, 4vw, 44px);
}

.footer-mark {
  margin: 0 0 clamp(30px, 5vw, 60px);
  font-size: clamp(2.8rem, 10vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(22px, 4vw, 56px);
}

.footer-label { margin: 0 0 14px; color: var(--grey-dim); }

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li { margin-bottom: 8px; }

.footer-grid a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-grid a:hover,
.footer-grid a:focus-visible { color: var(--white); border-color: var(--white); }

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 28px;
  margin: clamp(36px, 5vw, 64px) 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--grey-dim);
  font-size: 0.64rem;
}

/* --------------------------------------------------------------- motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .kicker { animation: rise 0.7s cubic-bezier(0.22, 0.7, 0.24, 1) 0.02s both; }
  h1 .line { animation: rise 0.7s cubic-bezier(0.22, 0.7, 0.24, 1) both; }
  h1 .line:nth-child(1) { animation-delay: 0.06s; }
  h1 .line:nth-child(2) { animation-delay: 0.12s; }
  h1 .line:nth-child(3) { animation-delay: 0.18s; }
  .lede { animation: rise 0.7s cubic-bezier(0.22, 0.7, 0.24, 1) 0.28s both; }
  .hero-foot .actions { animation: rise 0.7s cubic-bezier(0.22, 0.7, 0.24, 1) 0.34s both; }
  .ticker { animation: rise 0.7s cubic-bezier(0.22, 0.7, 0.24, 1) 0.4s both; }
}

/* Scroll-driven reveals are a progressive enhancement; without support the
   content simply stays visible. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

/* A one-pixel reading rule across the bottom of the masthead. */
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .masthead::after {
      animation: progress linear both;
      animation-timeline: scroll(root);
    }
  }
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .hero-foot { grid-template-columns: 1fr; align-items: start; }
  .actions { justify-content: flex-start; }
  .chapter { grid-template-columns: 1fr; gap: 20px; }
  .chapter-index { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; padding-right: 0; }
  .stat:nth-child(1),
  .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .stat:nth-child(3) { padding-left: 0; }
  .codes { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .masthead-meta { display: none; }
}

@media (max-width: 620px) {
  .masthead-nav { gap: 14px; }
  .ticker { gap: 8px 0; }
  .ticker li { padding-right: 12px; margin-right: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .colophon { flex-direction: column; }
}

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

@media print {
  .masthead { position: static; }
  .masthead::after { display: none; }
  .kicker, h1 .line, .lede, .hero-foot .actions, .ticker, .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
