/* ==========================================================================
   bluedev.in stylesheet
   Black and white theme, in either direction: white paper with black ink
   by default, or black paper with white ink in dark mode. No color used
   outside the studio's own gradient wordmark, which appears only as a
   brand mark and as a single "trace" accent on the homepage hero, and
   reads the same way in both modes.

   Theme resolution order:
   1. No preference saved -> follows the OS/browser (prefers-color-scheme).
   2. A preference saved ("light" or "dark") -> [data-theme] on <html> wins,
      set by a small inline script at the top of <head> (before paint, to
      avoid a flash of the wrong theme) and kept in sync by the toggle
      button wired up in js/main.js.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper: #ffffff;
  --paper-rgb: 255, 255, 255;
  --ink: #0a0a0a;
  --ink-soft: rgba(10, 10, 10, 0.64);
  --ink-faint: rgba(10, 10, 10, 0.4);
  --hairline: #e4e4e4;
  --hairline-strong: #b8b8b8;
  --mist: #fafafa;
  --shadow-banner: 0 18px 44px rgba(0, 0, 0, 0.12);

  /* Brand trace gradient: reserved for the logo mark and the hero signature only */
  --trace-1: #ff0055;
  --trace-2: #8a00ff;
  --trace-3: #00d0ff;

  --display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --nav-h: 76px;
  --container: 1180px;
  --radius: 3px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* System dark mode, unless the visitor has explicitly chosen "light" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0a0a;
    --paper-rgb: 10, 10, 10;
    --ink: #ffffff;
    --ink-soft: rgba(255, 255, 255, 0.64);
    --ink-faint: rgba(255, 255, 255, 0.4);
    --hairline: #232323;
    --hairline-strong: #4a4a4a;
    --mist: #141414;
    --shadow-banner: 0 18px 44px rgba(0, 0, 0, 0.6);
  }
}

/* Explicit "dark" choice, regardless of what the OS reports */
:root[data-theme="dark"] {
  --paper: #0a0a0a;
  --paper-rgb: 10, 10, 10;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.64);
  --ink-faint: rgba(255, 255, 255, 0.4);
  --hairline: #232323;
  --hairline-strong: #4a4a4a;
  --mist: #141414;
  --shadow-banner: 0 18px 44px rgba(0, 0, 0, 0.6);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--trace-1), var(--trace-2), var(--trace-3), var(--trace-1));
  flex: none;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--sm { padding: 10px 16px; font-size: 13.5px; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(var(--paper-rgb), 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--hairline); }
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo { height: 22px; width: auto; }
.nav__logo img { height: 100%; width: auto; display: block; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav__links a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
}
.nav__cta { display: flex; align-items: center; gap: 18px; }
.nav__cta .btn { display: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 17px; height: 17px; display: block; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}
.nav__toggle span {
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  background: var(--paper);
  padding: 40px 32px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.mobile-menu.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu__links { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu__links a {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.mobile-menu__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
}

@media (min-width: 861px) {
  .nav__cta .btn { display: inline-flex; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__cta .btn--ghost { display: none; }
}

/* ==========================================================================
   Sections / layout
   ========================================================================== */
main { padding-top: var(--nav-h); }

.section { padding: 108px 0; border-bottom: 1px solid var(--hairline); }
.section:last-of-type { border-bottom: none; }
.section--tight { padding: 84px 0; }
.section--mist { background: var(--mist); }

.section__head {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 56px;
}
.section__head h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; }
.section__head p { color: var(--ink-soft); font-size: 17px; max-width: 54ch; }

/* schematic corner-frame: used sparingly as the page's signature framing device */
.frame { position: relative; }
.frame__tick {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.frame__tick::before, .frame__tick::after { content: ''; position: absolute; background: var(--ink-faint); }
.frame__tick::before { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.frame__tick::after { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.frame__tick--tl { top: -7px; left: -7px; }
.frame__tick--tr { top: -7px; right: -7px; }
.frame__tick--bl { bottom: -7px; left: -7px; }
.frame__tick--br { bottom: -7px; right: -7px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 96px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--hairline) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  opacity: 0.9;
}
.hero__inner { position: relative; }
.hero__eyebrow {
  margin-bottom: 28px;
  opacity: 0;
  animation: slideUpFade 0.8s var(--ease) forwards;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.03;
  max-width: 16ch;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: slideUpFade 0.8s var(--ease) 0.12s forwards;
}
.hero p.hero__lede {
  margin-top: 26px;
  max-width: 56ch;
  font-size: 18px;
  color: var(--ink-soft);
  opacity: 0;
  animation: slideUpFade 0.8s var(--ease) 0.24s forwards;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  opacity: 0;
  animation: slideUpFade 0.8s var(--ease) 0.36s forwards;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 44px;
  opacity: 0;
  animation: slideUpFade 0.8s var(--ease) 0.48s forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.status-pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--trace-1), var(--trace-2), var(--trace-3), var(--trace-1));
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.trace {
  width: 100%;
  height: auto;
  margin-top: 4px;
  overflow: visible;
}
.trace path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: draw 1.6s var(--ease) 0.3s forwards;
}
.trace circle { animation: fade-in 0.6s ease 1.7s forwards; opacity: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.service-card {
  background: var(--paper);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.service-card:hover {
  background: var(--mist);
  transform: translateY(-4px);
}
.service-card__icon {
  width: 34px;
  height: 34px;
  stroke: var(--ink);
  transition: transform 0.3s var(--ease);
}
.service-card:hover .service-card__icon {
  transform: translateY(-2px) scale(1.05);
}
.service-card__icon-img { width: 34px; height: 34px; border-radius: 8px; }
.service-card__tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.service-card h3 { font-size: 21px; }
.service-card p { color: var(--ink-soft); font-size: 15.5px; max-width: 42ch; }
.service-card__link {
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  width: fit-content;
  margin-top: -4px;
}

.section-footer-link { margin-top: 32px; }

@media (max-width: 700px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Process
   ========================================================================== */
.process-list { display: flex; flex-direction: column; }
.process-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 32px;
  padding: 30px 20px;
  margin: 0 -20px;
  border-top: 1px solid var(--hairline);
  transition: padding-left 0.3s var(--ease), background-color 0.3s var(--ease);
}
.process-item:hover {
  padding-left: 32px;
  background-color: var(--mist);
}
.process-item:last-child { border-bottom: 1px solid var(--hairline); }
.process-item__index { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); padding-top: 4px; }
.process-item__body h3 { font-size: 19px; margin-bottom: 8px; }
.process-item__body p { color: var(--ink-soft); font-size: 15.5px; max-width: 60ch; }

@media (max-width: 600px) {
  .process-item { grid-template-columns: 1fr; gap: 8px; }
}

/* ==========================================================================
   Open source
   ========================================================================== */
.oss-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.oss-link {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.oss-link:hover { border-color: var(--ink); transform: translateY(-2px); }
.oss-link__label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); display: flex; justify-content: space-between; align-items: center; }
.oss-link__label span {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}
.oss-link:hover .oss-link__label span {
  transform: translate(3px, -3px);
}
.oss-link h3 { font-size: 22px; }
.oss-link p { color: var(--ink-soft); font-size: 15px; }

@media (max-width: 860px) {
  .oss-links { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.contact-tile {
  background: var(--paper);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-tile__label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.contact-tile__email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 10px;
  width: fit-content;
  transition: border-color 0.2s var(--ease);
}
.contact-tile__email:hover { border-color: var(--ink); }
.contact-tile__note { font-size: 14.5px; color: var(--ink-soft); }
.copy-btn { color: var(--ink-faint); }
.copy-btn:hover { color: var(--ink); }

@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 72px 0 28px; }
.site-footer__top {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: 40px;
  padding-bottom: 56px;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 18px; }
.site-footer__slogan {
  font-family: var(--display);
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.site-footer__col h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
  font-weight: 500;
}
.site-footer__col ul { display: flex; flex-direction: column; gap: 12px; }
.site-footer__col a, .site-footer__col button {
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.site-footer__col a:hover, .site-footer__col button:hover { color: var(--ink); }

.site-footer__middle {
  border-top: 1px solid var(--hairline);
  padding: 60px 0;
  margin-top: 40px;
  overflow: hidden;
}
.site-footer__massive-title {
  font-family: var(--display);
  font-size: clamp(60px, 16vw, 190px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: var(--ink);
  user-select: none;
  text-align: center;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  flex-wrap: wrap;
}
.site-footer__brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.site-footer__bottom-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer__bottom-right a,
.site-footer__bottom-right button {
  font-size: 12.5px;
  color: var(--ink-faint);
  transition: color 0.2s var(--ease);
}
.site-footer__bottom-right a:hover,
.site-footer__bottom-right button:hover {
  color: var(--ink);
}

@media (max-width: 860px) {
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: span 2; }
  .site-footer__middle { padding: 40px 0; margin-top: 24px; }
}
@media (max-width: 560px) {
  .site-footer__top { grid-template-columns: 1fr; gap: 32px; }
  .site-footer__brand { grid-column: span 1; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .site-footer__bottom-right { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ==========================================================================
   Cookie consent banner
   ========================================================================== */
.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: 620px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-banner);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.cookie-banner.is-visible { transform: translateY(0); opacity: 1; }
.cookie-banner__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cookie-banner__head svg { width: 16px; height: 16px; }
.cookie-banner__title { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.cookie-banner p { font-size: 14.5px; color: var(--ink-soft); }
.cookie-banner a { border-bottom: 1px solid var(--ink-soft); }
.cookie-banner__actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 480px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 20px; }
  .cookie-banner__actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Simple pages (about / legal)
   ========================================================================== */
.page-hero { padding: 96px 0 64px; }
.page-hero .eyebrow { margin-bottom: 22px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 54px); max-width: 20ch; }
.page-hero__icon { display: inline-block; vertical-align: -8px; margin-right: 14px; border-radius: 9px; }
.page-hero p.lede { margin-top: 20px; font-size: 17px; color: var(--ink-soft); max-width: 58ch; }
.meta-line { margin-top: 24px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); }

.prose { max-width: 760px; }
.prose h2 { font-size: 24px; margin: 0 0 16px; }
.prose h3 { font-size: 18px; margin: 36px 0 10px; }
.prose p { color: var(--ink-soft); font-size: 16px; margin-bottom: 16px; }
.prose ul { margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.prose ul li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: 16px; }
.prose ul li::before { content: '•'; position: absolute; left: 2px; color: var(--ink-faint); }
.prose a { border-bottom: 1px solid var(--ink); color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose p code, .prose li code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--mist);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

.legal-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: calc(var(--nav-h) + 40px);
}
.legal-nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  padding: 8px 0;
  border-left: 2px solid var(--hairline);
  padding-left: 14px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.legal-nav a:hover { color: var(--ink); border-left-color: var(--ink); }

.legal-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
}

/* Blog post table of contents: a single block above the article, not a side rail */
.toc-box {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 36px;
}
.toc-box__label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.toc-box ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.toc-box li { counter-increment: toc; }
.toc-box a {
  display: flex;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-soft);
}
.toc-box a::before {
  content: counter(toc);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  flex: none;
}
.toc-box a:hover { color: var(--ink); }
@media (max-width: 800px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-nav { display: none; }
}

.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: 24px; }
table.cookie-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14.5px; }
table.cookie-table th, table.cookie-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.cookie-table th { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); background: var(--mist); }
table.cookie-table tr:last-child td { border-bottom: none; }
table.cookie-table td.mono { font-family: var(--mono); font-size: 13.5px; }

.pref-box {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 32px;
}
.pref-box__status { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.pref-box__status strong { color: var(--ink); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 300;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   Package pages (/packages/*.html)
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--ink-faint); transition: color 0.2s var(--ease); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span[aria-current] { color: var(--ink-soft); }

.pkg-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.pkg-badge {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--ink-soft);
}

.pkg-stats {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin: 8px 0 8px;
}
.pkg-stat { flex: 1 1 120px; padding: 20px 22px; border-right: 1px solid var(--hairline); }
.pkg-stat:last-child { border-right: none; }
.pkg-stat__value { font-family: var(--display); font-size: 21px; font-weight: 600; }
.pkg-stat__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 5px; }

.code-block { background: var(--mist); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px 22px; overflow-x: auto; margin-bottom: 22px; }
.code-block__label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.code-block pre { margin: 0; }
.code-block code { font-family: var(--mono); font-size: 13.5px; line-height: 1.65; white-space: pre; color: var(--ink); }

.pkg-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 8px; }

.pkg-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px 30px;
  margin: 44px 0 8px;
}
.pkg-download h3 { font-size: 18px; margin-bottom: 6px; }
.pkg-download p { color: var(--ink-soft); font-size: 14.5px; margin: 0; max-width: 46ch; }

@media (max-width: 600px) {
  .pkg-stat { flex: 1 1 45%; }
}

/* ==========================================================================
   Work / project case studies (/projects/*.html + the home "Work" section)
   ========================================================================== */
.work-feature {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.work-feature__media { background: var(--mist); min-height: 260px; }
.work-feature__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.work-feature__body { padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.work-feature__body h3 { font-size: 25px; }
.work-feature__body p { color: var(--ink-soft); font-size: 15.5px; max-width: 46ch; }
.work-feature__actions { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .work-feature { grid-template-columns: 1fr; }
  .work-feature__media { min-height: 200px; }
}

.shot {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 4px 0 28px;
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
  background: var(--mist);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }

