/* ==========================================================================
   alexcpp.dev — landing page
   Dark, monospace-leaning, deliberately close to a terminal without being one.
   ========================================================================== */

:root {
  --bg: #08090a;
  --bg-raised: #0e1011;
  --bg-hover: #141718;
  --line: #1e2223;
  --line-bright: #2c3132;

  --fg: #e6e8e6;
  --fg-muted: #8b9490;
  --fg-faint: #5a625f;

  --accent: #4ade80;
  --accent-dim: #166534;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rule: 1px solid var(--line);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A faint scanline/grid wash so the page feels adjacent to the OS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 0%, transparent 75%);
}

a { color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

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

/* --- layout primitives --------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.section {
  padding-block: clamp(4rem, 10vw, 7rem);
  border-top: var(--rule);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line-bright);
}

.section-head .count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}

/* --- skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.skip:focus { left: 0; }

/* --- header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.5rem;
}

.brand {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand .caret { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.nav a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--fg); }

.nav-os {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-os:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
}

/* Tablet: the full nav plus the language switcher no longer fits on one line —
   worse in German, where the labels are longer — so let the header wrap and give
   the nav its own row rather than pushing the page into horizontal scroll. */
@media (max-width: 900px) {
  .site-header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding-block: 0.55rem;
    gap: 0.5rem 1rem;
  }
  .nav {
    width: 100%;
    margin-left: 0;
    gap: 1.1rem;
    font-size: 0.78125rem;
    align-items: center;
  }
  .lang-switch { margin-left: auto; }
}

/* Phone: the section links go; brand, the OS button and the switcher fit on
   one line again, so the header returns to a single row. */
@media (max-width: 720px) {
  .nav a:not(.nav-os) { display: none; }
  .site-header .wrap { flex-wrap: nowrap; height: 3.5rem; padding-block: 0; }
  .nav { width: auto; margin-left: auto; }
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding-block: clamp(4rem, 14vw, 9rem) clamp(3rem, 8vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
  overflow-wrap: break-word;
}

.hero-tagline {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  color: var(--accent);
  letter-spacing: -0.01em;
}

.hero-blurb {
  margin: 0 0 1.75rem;
  font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 46ch;
  line-height: 1.5;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-faint);
  margin-bottom: 2rem;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }

.hero-portrait {
  width: clamp(9rem, 22vw, 13rem);
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--line-bright);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.4s ease;
}
.hero-portrait:hover { filter: grayscale(0); }

/* Placeholder shown while there is no avatar file yet. */
.hero-portrait-fallback {
  width: clamp(9rem, 22vw, 13rem);
  aspect-ratio: 1;
  border: 1px dashed var(--line-bright);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  text-align: center;
  padding: 1rem;
}

/* --- availability badge -------------------------------------------------- */

.availability {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.availability strong { color: var(--accent); font-weight: 600; }
.availability span:last-child { color: var(--fg-muted); }

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2.4s ease-out infinite;
  align-self: center;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- stats strip --------------------------------------------------------- */

.stats-strip {
  border-top: var(--rule);
  border-bottom: var(--rule);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0;
}
.stats > div {
  padding: 1.5rem 1.25rem;
}
/* Column rules only while the grid is actually in columns — on a wrapping grid
   a border-left would draw a stray line down the first item of every row. */
@media (min-width: 940px) {
  .stats > div { border-left: var(--rule); }
  .stats > div:first-child { border-left: 0; }
}
.stats dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.stats dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--fg);
  line-height: 1.4;
}

/* --- section lead -------------------------------------------------------- */

.section-lead {
  margin: -1rem 0 2.5rem;
  max-width: 62ch;
  font-size: 1.0625rem;
  color: var(--fg-muted);
}

/* --- services ------------------------------------------------------------ */

.services { display: grid; border-block: var(--rule); }

.service {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 12rem;
  gap: 1.5rem;
  padding: 1.75rem 0.5rem;
  border-bottom: var(--rule);
  transition: background 0.15s ease;
}
.services > .service:last-child { border-bottom: 0; }
.service:hover { background: color-mix(in srgb, var(--bg-raised) 82%, transparent); }

@media (max-width: 860px) {
  .service { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; padding-inline: 0; }
  .service-num { display: none; }
  .service-proof { border-left: 0 !important; padding-left: 0 !important; text-align: left !important; }
}

.service-num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-faint);
  padding-top: 0.25rem;
}

.service h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.service-summary {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.9375rem;
}

.service-detail {
  margin: 0 0 0.85rem;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  max-width: 62ch;
}

.service-proof {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: right;
  border-left: var(--rule);
  padding-left: 1.25rem;
}
.proof-label {
  display: block;
  color: var(--fg-faint);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* --- references / quotes ------------------------------------------------- */

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.quote {
  margin: 0;
  padding: 1.5rem;
  border: var(--rule);
  border-radius: 4px;
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quote blockquote {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #c9cfcb;
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--accent-dim);
  flex: 1;
}

.quote figcaption {
  display: grid;
  gap: 0.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}
.quote figcaption strong { color: var(--fg); font-size: 0.8125rem; font-weight: 600; }
.quote-date { color: var(--fg-faint); }

.quote-original summary {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--fg-faint);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.quote-original summary:hover { color: var(--accent); }
.quote-original p {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--fg-faint);
  font-style: italic;
  line-height: 1.55;
}

/* --- contact CTA --------------------------------------------------------- */

.cta-head {
  margin: 0 0 1rem;
  font-size: clamp(1.125rem, 2.6vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  max-width: 24ch;
}

/* --- buttons ------------------------------------------------------------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 3px;
  border: 1px solid var(--line-bright);
  color: var(--fg);
  background: var(--bg-raised);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--fg-faint); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, #fff);
  border-color: color-mix(in srgb, var(--accent) 85%, #fff);
}

/* --- blinking cursor ----------------------------------------------------- */

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- about --------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4rem);
  align-items: start;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}

.prose p {
  margin: 0 0 1.25rem;
  max-width: var(--measure);
  color: #c9cfcb;
}
.prose p:last-child { margin-bottom: 0; }

.facts {
  font-family: var(--mono);
  font-size: 0.8125rem;
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-raised);
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: var(--rule);
}
.facts div:last-child { border-bottom: 0; }
.facts dt, .facts .k { color: var(--fg-faint); }
.facts dd, .facts .v { margin: 0; color: var(--fg); text-align: right; }

/* --- skills -------------------------------------------------------------- */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: var(--rule);
}
.skills h3 {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.skills ul { margin: 0; padding: 0; list-style: none; }
.skills li {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--fg-muted);
  padding: 0.15rem 0;
}

/* --- projects ------------------------------------------------------------ */

.projects { display: grid; border-block: var(--rule); }
.projects > .project:last-child { border-bottom: 0; }

.project {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem 0.5rem;
  border-bottom: var(--rule);
  text-decoration: none;
  transition: background 0.15s ease;
}
.project:hover { background: var(--bg-raised); }

@media (max-width: 720px) {
  .project {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    padding-inline: 0;
  }
  .project-index { display: none; }
}

.project-index {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-faint);
  padding-top: 0.2rem;
}

.project-title {
  margin: 0 0 0.35rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.project-title .arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.project:hover .project-title .arrow { opacity: 1; transform: translateX(0); }

.project-tagline {
  margin: 0 0 0.35rem;
  color: var(--fg-muted);
  max-width: 60ch;
  font-size: 0.9375rem;
}

.project-role {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--fg-faint);
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.project-side {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  text-align: right;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.status[data-status="archived"]::before,
.status[data-status="completed"]::before { background: var(--fg-faint); }

/* --- gallery ------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-raised);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35);
  transition: transform 0.35s ease, filter 0.35s ease;
}
.shot:hover img { transform: scale(1.04); filter: grayscale(0); }
.shot-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.5rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.empty-note {
  margin: 0;
  padding: 2rem;
  border: 1px dashed var(--line-bright);
  border-radius: 4px;
  color: var(--fg-faint);
  font-size: 0.9375rem;
  text-align: center;
}
.empty-note code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--fg-muted);
}

/* --- press kit ----------------------------------------------------------- */

.lead-line {
  font-size: 1.0625rem;
  color: var(--fg) !important;
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
}

.prose strong { color: var(--fg); font-weight: 600; }

/* --- writing ------------------------------------------------------------- */

.posts { display: grid; border-block: var(--rule); }
.posts > .post:last-child { border-bottom: 0; }

.post {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem 0.5rem;
  border-bottom: var(--rule);
  text-decoration: none;
  transition: background 0.15s ease;
}
.post:hover { background: var(--bg-raised); }

@media (max-width: 640px) {
  .post { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; padding-inline: 0; }
}

.post time {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-faint);
}
.post h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; }
.post p { margin: 0; color: var(--fg-muted); font-size: 0.9375rem; max-width: 62ch; }

/* --- contact ------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4rem);
  align-items: start;
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

.links { display: grid; gap: 1px; background: var(--line); border: var(--rule); border-radius: 4px; overflow: hidden; }

.link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-raised);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.875rem;
  transition: background 0.15s ease;
}
.link-row:hover { background: var(--bg-hover); }
.link-row .handle { color: var(--fg-faint); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; }

/* --- contact gate -------------------------------------------------------- */

.gate {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  background: var(--bg-raised);
}

.gate-trigger {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.gate-trigger:hover { filter: brightness(1.08); }

.gate-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-faint);
  line-height: 1.5;
}
.gate-note a { color: var(--accent); text-underline-offset: 3px; }

.gate-row { display: flex; align-items: center; gap: 0.5rem; }

.gate-row canvas {
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  display: block;
}

.gate-refresh,
.gate-submit {
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
.gate-refresh { width: 2.25rem; padding: 0.5rem 0; }
.gate-refresh:hover, .gate-submit:hover { border-color: var(--accent); color: var(--accent); }

.gate-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.5rem 0.65rem;
  outline: none;
}
.gate-row input:focus { border-color: var(--accent); }

.gate-error { margin: 0; font-size: 0.8125rem; color: #f87171; }

.gate.revealed { gap: 1px; padding: 0; background: var(--line); overflow: hidden; }

.gate-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-raised);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.875rem;
  transition: background 0.15s ease;
}
.gate-item:hover { background: var(--bg-hover); }
.gate-label { color: var(--fg-faint); }
.gate-value { color: var(--accent); overflow-wrap: anywhere; text-align: right; }

/* --- footer -------------------------------------------------------------- */

.site-footer {
  border-top: var(--rule);
  padding-block: 2.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* --- blog article -------------------------------------------------------- */

.article { padding-block: clamp(3rem, 8vw, 5rem); }
.article header { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: var(--rule); }
.article h1 {
  margin: 0.75rem 0 0.5rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.article .article-body { max-width: var(--measure); }
.article .article-body h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.article .article-body p { margin: 0 0 1.25rem; color: #c9cfcb; }
.article .article-body a { color: var(--accent); text-underline-offset: 3px; }
.article .article-body code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-raised);
  border: var(--rule);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}
.article .article-body pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--bg-raised);
  border: var(--rule);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.6;
}
.article .article-body pre code { background: none; border: 0; padding: 0; }

.back-link {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }

/* --- language switcher --------------------------------------------------- */

.lang-switch {
  display: inline-flex;
  gap: 1px;
  margin-left: 0.25rem;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
}

.lang-switch .lang {
  padding: 0.3rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  background: var(--bg-raised);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-switch .lang:hover { color: var(--fg); background: var(--bg-hover); }
.lang-switch .lang.on { color: var(--bg); background: var(--accent); font-weight: 600; }

@media (max-width: 720px) {
  .lang-switch { margin-left: auto; }
}

/* --- touch ergonomics ---------------------------------------------------- */

/* Inline links inside prose are as small as their text — fine with a mouse,
   awkward with a thumb. Widen the ones people actually reach for. Keyed on
   width as well as pointer type: narrow screens are touch in practice, and a
   width query is something a test can actually verify. */
@media (pointer: coarse), (max-width: 900px) {
  .brand { padding-block: 0.5rem; }
  .gate-note a,
  .site-footer a {
    display: inline-block;
    padding-block: 0.4rem;
  }
  .link-row { padding-block: 1rem; }
  .lang-switch .lang { padding: 0.5rem 0.65rem; }
  .nav a { padding-block: 0.35rem; }
}

/* --- pointer effects ----------------------------------------------------- */

/* Canvas sits above the static CSS grid and below all content. Purely
   decorative: it must never intercept a click, and the page is complete
   without it if JavaScript never runs. */
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Hero elements drift very slightly against the pointer. */
[data-fx-parallax] { transition: transform 0.5s cubic-bezier(.2, .7, .3, 1); }

@media (prefers-reduced-motion: reduce) {
  .fx-canvas { display: none; }
  [data-fx-parallax] { transform: none !important; }
}
