/* Self-hosted so no visitor data goes to Google and there is no extra
   round trip before text renders. */
/* Both families ship as variable fonts, so one file per family covers every
   weight the page uses. Declaring a weight range lets the browser pick the
   instance instead of downloading the same bytes once per weight. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2-variations"),
       url("assets/fonts/inter-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;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2-variations"),
       url("assets/fonts/jetbrains-mono-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;
}

/* ============================================================
   Design tokens
   ============================================================ */

:root {
  --bg: #faf9f6;
  --bg-soft: #f2f0ea;
  --surface: #ffffff;
  --surface-strong: #fdfcf9;
  --text: #1a1a18;
  --muted: #57544e;
  --line: rgba(26, 26, 24, 0.12);
  --accent: #12756c;
  --accent-strong: #0d5a52;
  --accent-warm: #b95f2c;
  --ok: #15803d;
  --azure: #0F6CBD;
  --shadow: 0 24px 70px rgba(20, 20, 18, 0.1);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

body.light {
  --bg: #faf9f6;
  --bg-soft: #f2f0ea;
  --surface: #ffffff;
  --surface-strong: #fdfcf9;
  --text: #1a1a18;
  --muted: #57544e;
  --line: rgba(26, 26, 24, 0.12);
  --accent: #12756c;
  --accent-strong: #0d5a52;
  --accent-warm: #b95f2c;
  --ok: #15803d;
  --azure: #0F6CBD;
  --shadow: 0 24px 70px rgba(20, 20, 18, 0.1);
}

body:not(.light) {
  --bg: #0d0d0c;
  --bg-soft: #141413;
  --surface: #161615;
  --surface-strong: #1d1d1b;
  --text: #ecebe6;
  --muted: #b9b6ac;
  --line: rgba(236, 235, 230, 0.11);
  --accent: #6fc3b4;
  --accent-strong: #9bd9cb;
  --accent-warm: #d9895a;
  --ok: #4ade80;
  --azure: #4FA8E8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Base
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
}

/* Cursor spotlight. Dark mode only (it reads as a smudge on light), and the
   JS that drives it is gated on a fine pointer + no reduced-motion. */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 70%
  );
}

body:not(.light).spotlight-on .spotlight {
  opacity: 1;
}

/* Faint technical dot grid, fading out down the page. Decorative only. */
.dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 55%, transparent) 1.2px, transparent 1.1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 95%);
  mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 95%);
}

body.light .dots {
  opacity: 0.5;
}

/* Soft colour wash so the page is not a flat sheet. */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 10% 6%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 72%),
    radial-gradient(45% 34% at 90% 26%, color-mix(in srgb, var(--accent-warm) 26%, transparent), transparent 72%),
    radial-gradient(55% 40% at 50% 104%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}

body.light .glow {
  opacity: 0.8;
}

/* Reading progress. A 2px line, no layout impact. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent));
  transition: width 0.1s linear;
}

/* Fine grain. Stops large flat dark areas from looking like an empty canvas. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.light .grain {
  opacity: 0.02;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

body.motion-ready .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.motion-ready .reveal.show {
  opacity: 1;
  transform: none;
}

/* Anything still carrying placeholder copy is visibly marked so it
   cannot ship looking like real content. Remove the attribute in the
   HTML once the real content is in. */
[data-placeholder] {
  text-decoration: underline dashed color-mix(in srgb, var(--accent-warm) 70%, transparent);
  text-underline-offset: 4px;
}

/* ============================================================
   Shell — sticky identity rail + scrolling content
   ============================================================ */

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px);
  width: min(1680px, 100%);
  margin: 0 auto;
  padding-inline: clamp(22px, 4vw, 72px);
}

.rail {
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}

.rail-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding-block: clamp(44px, 9vh, 88px);
}

.portrait-wrap {
  display: block;
  width: 96px;
  height: 96px;
}

/* A dark portrait on a near-black page needs a defined edge, or it reads
   as an empty box. The ring does that without a visible border line. */
.portrait {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  background: var(--bg-soft);
  box-shadow: 0 0 0 1px var(--line), 0 0 0 4px color-mix(in srgb, var(--text) 4%, transparent);
}

.portrait-fallback {
  display: none;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.portrait-wrap.no-photo .portrait {
  display: none;
}

.portrait-wrap.no-photo .portrait-fallback {
  display: grid;
}

.rail-name {
  margin-top: 22px;
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  letter-spacing: -0.03em;
}

.rail-role {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text);
}

.rail-meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.rail-bio {
  max-width: 34ch;
  margin-top: 20px;
  color: var(--muted);
}

.rail-now {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 34ch;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

.now-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Rail navigation */

.rail-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-block: 36px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-rule {
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  transition: width 0.22s ease, opacity 0.22s ease;
}

.rail-nav a:hover,
.rail-nav a.active {
  color: var(--text);
}

.rail-nav a:hover .nav-rule,
.rail-nav a.active .nav-rule {
  width: 52px;
  opacity: 1;
}

/* Rail footer */

.rail-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cv-link:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.cv-icon {
  width: 14px;
  height: 14px;
}

.social {
  display: flex;
  gap: 4px;
}

.social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.social a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.social svg {
  width: 17px;
  height: 17px;
}

.theme-toggle {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ============================================================
   Content blocks
   ============================================================ */

.content {
  min-width: 0;
  padding-block: clamp(44px, 9vh, 88px);
  counter-reset: section;
}

.block + .block {
  margin-top: clamp(64px, 9vh, 104px);
}

.block-label::before {
  content: counter(section, decimal-leading-zero) " / ";
  counter-increment: section;
  color: var(--muted);
  opacity: 0.65;
}

.block-label {
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 20px;
  padding-block: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.prose p + p {
  margin-top: 16px;
}

.prose {
  color: var(--muted);
  max-width: 62ch;
}

/* Highlighted terms read as a deliberate mark, not just brighter text: the
   accent colour sits on a faint tint of itself, so it holds up in both themes. */
.prose strong {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-weight: 500;
  padding: 0.08em 0.32em;
  margin: 0 -0.06em;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.inline-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s ease;
}

.inline-link:hover {
  color: var(--accent);
}

/* ============================================================
   Skills
   ============================================================ */

.skill-groups {
  display: grid;
  gap: 26px;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.skill-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.87rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-list li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body.light .skill-icon {
  filter: brightness(0.82) saturate(1.15);
}

/* Icons are masked rather than <img> so they inherit the text colour and
   respond to theme and hover. */
.skill-icon {
  width: 15px;
  height: 15px;
  flex: none;
  background-color: var(--icon-color, currentColor);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* ============================================================
   Experience timeline
   ============================================================ */

.company + .company {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.company-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.company-logo {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
}

.company-logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.logo-fallback {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.company-logo.no-logo img {
  display: none;
}

.company-logo.no-logo .logo-fallback {
  display: grid;
}

.company-name {
  font-size: 1.12rem;
}

.company-span,
.company-loc {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.company-span:empty {
  display: none;
}

/* Roles hang off a single continuous rule, the way a company block with
   multiple positions reads on LinkedIn. */
.role-track {
  margin-top: 18px;
  margin-left: 19px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.role {
  position: relative;
}

.role + .role {
  margin-top: 28px;
}

.role::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line);
}

.role-current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.role-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.role-type {
  margin-top: 2px;
  font-size: 0.86rem;
  color: var(--muted);
}

.role-date {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.role-team {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

.built-list {
  max-width: 62ch;
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.built-list li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
}

.built-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

.built-list strong {
  color: var(--text);
  font-weight: 500;
}

.role-copy {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--muted);
}

/* ============================================================
   Projects
   ============================================================ */

.project {
  padding: 20px 18px;
  margin-inline: -18px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project:hover {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 10%, transparent);
}

.project + .project {
  margin-top: 8px;
}

.project-head h3 {
  font-size: 1.05rem;
}

.project-head h3 a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.project:hover .project-head h3 a,
.project-head h3 a:hover {
  color: var(--accent);
}

.ext {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.project:hover .ext,
a:hover > .ext {
  transform: translate(2px, -2px);
}

.project-sub {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.project-copy {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--muted);
}

/* Architecture diagrams */

/* Below ~600px the diagram would scale its labels down to ~5px, so it gets
   a min-width and scrolls horizontally instead of becoming unreadable. */
.diagram-scroll {
  margin-top: 20px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.diagram {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
  color: var(--muted);
}

.dg rect {
  fill: color-mix(in srgb, var(--surface-strong) 92%, var(--bg));
  stroke: var(--line);
  stroke-width: 1;
  transition: stroke 0.2s ease, fill 0.2s ease;
}

.dg .node {
  cursor: default;
}

.dg .node:hover rect {
  stroke: var(--accent);
  fill: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.dg .node:hover .dg-t {
  fill: var(--accent);
}

.dg line {
  stroke: currentColor;
  stroke-width: 1.3;
  opacity: 0.5;
}

.dg-t {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  text-anchor: middle;
}

.dg-s {
  fill: color-mix(in srgb, var(--text) 75%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-anchor: middle;
}

/* Tech tags */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag-row li {
  padding: 4px 9px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.71rem;
}

/* Labs */

.labs {
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.labs-label {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.labs-list {
  margin-top: 12px;
}

.labs-list li + li {
  margin-top: 2px;
}

.labs-list a {
  display: grid;
  gap: 3px;
  padding: 10px;
  margin-inline: -10px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.labs-list a:hover {
  background: var(--bg-soft);
}

.labs-name {
  font-weight: 500;
}

.labs-list a:hover .labs-name {
  color: var(--accent);
}

.labs-desc {
  font-size: 0.87rem;
  color: var(--muted);
}

.all-repos {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.all-repos:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   Certifications
   ============================================================ */

.cert + .cert {
  margin-top: 2px;
}

.cert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-inline: -18px;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.cert:hover {
  background: var(--bg-soft);
}

.cert-badge {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.cert-body h3 {
  font-size: 0.98rem;
}

.cert-code {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.cert-verify {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cert-verify:hover {
  color: var(--accent);
}

.training {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.training-label {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.training h3 {
  margin-top: 10px;
  font-size: 1rem;
}

.training-org {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

.training-copy {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--muted);
}

/* ============================================================
   Contact + footer
   ============================================================ */

.contact-line {
  color: var(--text);
  font-size: 1.05rem;
}

.site-foot {
  margin-top: clamp(56px, 8vh, 88px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
}


/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 1024px) {
  .rail-nav {
    display: flex;
  }
}

@media (max-width: 1023px) {
  .rail-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-block: 26px 0;
  }

  .rail-nav .nav-rule {
    display: none;
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rail {
    position: static;
    height: auto;
  }

  .rail-inner {
    height: auto;
    padding-block: clamp(48px, 8vh, 72px) 0;
  }

  .rail-bio,
  .rail-now {
    max-width: 58ch;
  }

  .rail-foot {
    margin-top: 28px;
  }

  .content {
    padding-block: clamp(40px, 7vh, 64px);
  }

  .block-label {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
  }
}

@media (max-width: 620px) {
  .cert {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 10px;
  }

  .cert-verify {
    grid-column: 2;
  }

  .theme-toggle {
    margin-left: 0;
  }
}

@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;
  }
}

/* ---------- 404 page ---------- */

.notfound {
  display: grid;
  place-content: center;
  gap: 14px;
  min-height: 100vh;
  padding-inline: 22px;
  text-align: center;
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.notfound h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.notfound p {
  color: var(--muted);
}

.notfound a {
  justify-self: center;
  margin-top: 8px;
}

/* Large monitors: the page uses the width, and type scales with it. */
@media (min-width: 1600px) {
  body {
    font-size: 1.02rem;
  }

  .rail-name {
    font-size: 2.35rem;
  }

  .content {
    padding-block: clamp(56px, 9vh, 104px);
  }
}

/* ---------- Platform figure ---------- */

.stack-figure {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.stack-svg {
  display: block;
  width: 100%;
  min-width: 460px;
  height: auto;
  color: var(--muted);
}

.stack-figure {
  overflow-x: auto;
}

.layer rect {
  stroke: color-mix(in srgb, var(--text) 12%, transparent);
  stroke-width: 1;
  transition: opacity 0.2s ease;
}

.layer:hover rect {
  opacity: 0.85;
}

.lyr-t {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
}

.lyr-s {
  fill: color-mix(in srgb, var(--text) 90%, transparent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.lyr-n {
  fill: color-mix(in srgb, var(--text) 70%, transparent);
  font-family: var(--font-mono);
  font-size: 13px;
  text-anchor: end;
  opacity: 0.7;
}

.lyr-arrow line {
  stroke: currentColor;
  stroke-width: 1.4;
  opacity: 0.55;
}

figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
}

.lyr-bg {
  fill: var(--surface-strong);
  stroke: none;
}

/* Nothing may push the page wider than the screen. */
.block,
.project,
.company,
.skill-groups,
.role-track {
  min-width: 0;
}

@media (max-width: 620px) {
  .stack-svg {
    min-width: 420px;
  }
}

/* ---------- Contact form ---------- */

/* display:grid would otherwise beat the browser's [hidden] rule. */
.contact-form[hidden] {
  display: none;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 62ch;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.contact-form label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* The honeypot has to be reachable for a bot and invisible to a person. */
.field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.contact-form button {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-form button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  background: var(--accent);
}

.contact-form button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.form-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.form-status.ok {
  color: var(--accent);
}

.form-status.bad {
  color: var(--accent-warm);
}

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

/* ---------- Sent confirmation ---------- */

.sent {
  display: grid;
  justify-items: center;
  gap: 6px;
  max-width: 62ch;
  margin-top: 26px;
  padding: 30px 22px;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  text-align: center;
}

.sent[hidden] {
  display: none;
}

/* Focus moves here so screen readers announce it; the ring adds nothing. */
.sent:focus {
  outline: none;
}

.sent-mark {
  width: 64px;
  height: 64px;
  color: var(--ok);
  margin-bottom: 6px;
}

.sent-ring,
.sent-check {
  stroke: currentColor;
}

/* Drawn state is the default, so the tick is still there if animations never
   run. The keyframes only animate it into view. */
.sent-ring {
  stroke-dasharray: 170;
  stroke-dashoffset: 0;
  animation: ring-draw 0.5s ease;
}

.sent-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 0;
  animation: check-draw 0.35s ease 0.35s backwards;
}

@keyframes ring-draw {
  from { stroke-dashoffset: 170; }
  to { stroke-dashoffset: 0; }
}

@keyframes check-draw {
  from { stroke-dashoffset: 48; }
  to { stroke-dashoffset: 0; }
}

.sent-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.sent-note {
  font-size: 0.9rem;
  color: var(--muted);
}

.sent-note span {
  color: var(--text);
}

.sent-again {
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.sent-again:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Failure gets a marker too, so the state is never ambiguous. */
.form-status.bad::before {
  content: "\2715  ";
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .sent-ring,
  .sent-check {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ---------- Writing ---------- */

.note {
  padding: 20px 18px;
  margin-inline: -18px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.note + .note {
  margin-top: 8px;
}

.note:hover {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.note h3 {
  font-size: 1.05rem;
}

.note-meta {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

.note p:not(.note-meta) {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--muted);
}


/* Credential badge under the photo. */
.cred-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--azure) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--azure) 10%, transparent);
  color: var(--azure);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-icon {
  width: 13px;
  height: 13px;
  flex: none;
  background-color: var(--azure);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
