/* Layout: single column of full-bleed bands; content in a 1160px wrap.
   Sections alternate plain / tinted ground; split sections use a sticky heading column. */
:root {
  --bg: #F2F5F9;          /* cool paper with a cobalt bias */
  --surface: #FFFFFF;
  --tint: #E6ECF4;
  --ink: #0E1726;
  --muted: #55627A;
  --line: #CED7E4;
  --accent: #1D4ED8;      /* Mediterranean cobalt (azulejo blue) */
  --accent-ink: #FFFFFF;
  --accent-soft: #DCE5FB;
  --sun: #E89A1E;         /* Andalusian saffron, used sparingly */
  --ok: #16A34A;
  --code-bg: #0E1726;
  --code-fg: #D7DFEC;
  --code-dim: #7F8CA6;
  --code-str: #F2B45A;
  --code-key: #8EA8FF;
  --code-fn: #7FD3C3;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.4rem, 1.5rem + 3.8vw, 4.25rem);

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --header-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1019; --surface: #111A27; --tint: #0E1622; --ink: #E7ECF4; --muted: #93A0B7;
    --line: #223047; --accent: #7C9CFF; --accent-ink: #0A1019; --accent-soft: #1A2746;
    --sun: #F2B45A; --ok: #4ADE80; --code-bg: #060A11;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1019; --surface: #111A27; --tint: #0E1622; --ink: #E7ECF4; --muted: #93A0B7;
  --line: #223047; --accent: #7C9CFF; --accent-ink: #0A1019; --accent-soft: #1A2746;
  --sun: #F2B45A; --ok: #4ADE80; --code-bg: #060A11;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

.label {
  font: 500 var(--step--1)/1 var(--f-mono);
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.label::before { content: ""; width: 22px; height: 2px; background: currentColor; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; margin-right: auto; }
.brand__mark { font: 600 1.05rem/1 var(--f-mono); color: var(--accent); }
.brand__name { font: 600 1.05rem/1 var(--f-display); letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a.is-active { background: var(--tint); }
.nav .nav__cta { color: var(--accent-ink); background: var(--accent); margin-left: 6px; }
.nav .nav__cta:hover, .nav .nav__cta.is-active { color: var(--accent-ink); background: var(--accent); filter: brightness(1.08); }
.topbar__tools { display: flex; align-items: center; gap: 8px; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang a {
  text-decoration: none; display: inline-block;
  font: 500 0.75rem/1 var(--f-mono); letter-spacing: 0.06em;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 9px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn__bars, .menu-btn__bars::before, .menu-btn__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, background .2s; }
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; left: 0; }
.menu-btn__bars::before { top: -6px; }
.menu-btn__bars::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-btn__bars { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-btn__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.98rem/1 var(--f-body); text-decoration: none;
  padding: 15px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 64px);
}
.hero__text { display: grid; gap: 26px; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 var(--step--1)/1.3 var(--f-mono); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); flex: none; }
.hero__title { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: 1.0; }
.hero__title span, .hero__title em { display: block; }
.hero__title em {
  font-style: normal; color: var(--accent);
  font-variation-settings: "opsz" 96;
}
.hero__lead { font-size: var(--step-1); color: var(--muted); max-width: 36em; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* The one bold object: a plugin header that introduces Rene the way WordPress introduces a plugin. */
.editor {
  margin: 0; min-width: 0;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 60px -30px rgba(14, 23, 38, .55);
  transform: rotate(-1.2deg);
}
.editor__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.editor__dots { display: inline-flex; gap: 6px; flex: none; }
.editor__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3A475C; }
.editor__dots i:first-child { background: #E5675B; }
.editor__dots i:nth-child(2) { background: #E8B04A; }
.editor__dots i:nth-child(3) { background: #5BBF73; }
.editor__file { font: 400 0.75rem/1.2 var(--f-mono); color: var(--code-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.editor__code { margin: 0; padding: 20px 20px 24px; overflow-x: auto; font: 400 clamp(0.72rem, 0.66rem + 0.25vw, 0.85rem)/1.75 var(--f-mono); }
.c-k { color: var(--code-key); }
.c-c { color: var(--code-dim); }
.c-v { color: var(--code-fg); }
.c-n { color: var(--code-str); }
.c-m { color: #5E6B84; font-style: italic; }
.c-s { color: var(--code-str); }
.c-f { color: var(--code-fn); }
.caret { display: inline-block; width: .55em; height: 1.15em; vertical-align: -0.2em; margin-left: 2px; background: var(--code-key); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Stats ---------- */
.stats { padding-block: 0 clamp(48px, 7vw, 88px); }
.stats__list { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats__list > div { padding: 22px 24px 0 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stats__list > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.stats dd { margin: 0; font: 800 clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem)/1 var(--f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--muted); font-size: 0.95rem; max-width: 22em; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tint { background: var(--tint); }
.section__head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); max-width: 40rem; }
.section__head--row { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; }
.section__head--row > div { display: grid; gap: 14px; }
.section__note { color: var(--muted); max-width: 28rem; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split__head { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 32px); min-width: 0; }
.split__sub { color: var(--muted); max-width: 30rem; }
.split__body { min-width: 0; }
.prose { display: grid; gap: 18px; font-size: 1.0625rem; max-width: 40rem; }

.portrait {
  width: min(220px, 60%); aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  margin-top: 16px; box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line);
}

.facts { display: grid; margin-top: 14px; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts span { font: 500 var(--step--1)/1.6 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.facts strong { font-weight: 500; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.service {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: grid; gap: 12px; align-content: start;
  transition: border-color .2s, transform .2s;
}
.service:hover { border-color: var(--accent); transform: translateY(-2px); }
.service__tag { font: 500 var(--step--1)/1 var(--f-mono); color: var(--accent); }
.service p { color: var(--muted); font-size: 0.97rem; }

.stack { margin-top: clamp(48px, 6vw, 72px); display: grid; gap: 24px; }
.stack__title { font-size: var(--step-2); }
.stack__groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.stack__group { display: grid; gap: 12px; align-content: start; }
.stack__k { font: 500 var(--step--1)/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 0.875rem; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 36px); }
.project { display: grid; gap: 18px; align-content: start; min-width: 0; }
.project__shot {
  position: relative; display: block; aspect-ratio: 16 / 10; max-width: 100%;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 85% 110%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--line) 70%, transparent) 27px 28px),
    var(--surface);
  background-size: cover; background-position: top center;
}
.project__shot::after {
  content: attr(data-mono);
  position: absolute; inset: 36px 0 0; display: grid; place-items: center;
  font: 800 var(--mono-size, clamp(3rem, 2rem + 4vw, 5.5rem))/1 var(--f-display); letter-spacing: -0.04em; text-align: center; padding-inline: 16px;
  color: color-mix(in srgb, var(--accent) 55%, var(--surface));
}
.project__shot.has-img { background: var(--surface); }
.project__shot.has-img::after { content: none; }
.project__shot img { position: absolute; inset: 36px 0 0; width: 100%; height: calc(100% - 36px); object-fit: cover; object-position: top center; transition: transform .5s ease; }
.project:hover .project__shot img { transform: scale(1.02); }
.project__chrome {
  position: absolute; inset: 0 0 auto; height: 36px; z-index: 1;
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  background: var(--tint); border-bottom: 1px solid var(--line);
}
.project__chrome i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.project__chrome span { margin-left: 10px; font: 400 0.72rem/1 var(--f-mono); color: var(--muted); background: var(--surface); padding: 5px 10px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.project__meta { display: grid; gap: 10px; }
.project__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.project__kind { font: 500 0.75rem/1.4 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.project__meta p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tags li { font: 500 0.78rem/1.4 var(--f-mono); color: var(--accent); }

.project__shot { text-decoration: none; }
a.project__shot:hover { border-color: var(--accent); }
.more__title { margin-top: clamp(48px, 6vw, 72px); margin-bottom: 20px; font-size: var(--step-2); }
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.mini p { color: var(--muted); font-size: 0.97rem; }
@media (max-width: 900px) { .more { grid-template-columns: minmax(0, 1fr); } }

/* ---------- GitHub activity ---------- */
.gh { margin-top: clamp(56px, 7vw, 88px); display: grid; gap: 20px; }
.gh__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 40px; }
.gh__intro { display: grid; gap: 8px; max-width: 40rem; }
.gh__title { font-size: var(--step-2); }
.gh__sub { color: var(--muted); }
.gh__total { color: var(--muted); font-size: 0.95rem; }
.gh__total strong { font: 800 var(--step-3)/1 var(--f-display); color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-right: 6px; }
.gh__panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 24px); display: grid; gap: 16px; min-width: 0; }
.gh__scroll { overflow-x: auto; padding-bottom: 4px; --cell: 11px; --gap: 3px; }
@media (min-width: 1100px) { .gh__scroll { --cell: 14px; --gap: 4px; } }
.gh__months, .gh__grid { display: grid; grid-auto-flow: column; grid-auto-columns: var(--cell); gap: var(--gap); width: max-content; margin-inline: auto; }
.gh__months { grid-template-rows: auto; margin-bottom: 6px; font: 400 0.68rem/1 var(--f-mono); color: var(--muted); }
.gh__months span { white-space: nowrap; overflow: visible; }
.gh__grid { grid-template-rows: repeat(7, var(--cell)); }
.gh__grid i, .gh__legend i { width: var(--cell, 11px); height: var(--cell, 11px); border-radius: 3px; background: var(--tint); outline: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); outline-offset: -1px; }
.gh__grid i.is-pad { visibility: hidden; }
.gh__grid i[data-l="1"], .gh__legend i[data-l="1"] { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.gh__grid i[data-l="2"], .gh__legend i[data-l="2"] { background: color-mix(in srgb, var(--accent) 52%, var(--surface)); }
.gh__grid i[data-l="3"], .gh__legend i[data-l="3"] { background: color-mix(in srgb, var(--accent) 76%, var(--surface)); }
.gh__grid i[data-l="4"], .gh__legend i[data-l="4"] { background: var(--accent); }
.gh__grid.is-loading i { animation: ghPulse 1.4s ease-in-out infinite; }
@keyframes ghPulse { 50% { opacity: .55; } }
.gh__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; font-size: 0.85rem; color: var(--muted); }
.gh__status { margin-right: auto; }
.gh__status:empty { display: none; }
.gh__legend { display: inline-flex; align-items: center; gap: 4px; font: 400 0.72rem/1 var(--f-mono); }
.gh__legend span { margin-inline: 4px; }
.gh__link { color: var(--accent); font-weight: 600; text-decoration: none; margin-left: auto; }
.gh__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Experience log ---------- */
.log { position: relative; display: grid; gap: 34px; }
.log::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.log__item { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 22px; }
.log__item::before { content: ""; grid-column: 1; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--tint); border: 2px solid var(--accent); position: relative; z-index: 1; }
.log__item:first-child::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.log__hash { position: absolute; right: 0; top: 2px; font: 500 0.72rem/1.2 var(--f-mono); color: var(--sun); }
.log__body { grid-column: 2; display: grid; gap: 6px; padding-right: 76px; }
.log__when { font: 400 var(--step--1)/1.5 var(--f-mono); color: var(--muted); }
.log__body p:last-child { color: var(--muted); }
.edu__title { margin-top: 56px; margin-bottom: 16px; font-size: var(--step-2); }
.edu { display: grid; border-top: 1px solid var(--line); }
.edu li { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.edu strong { font-weight: 600; }
.edu span { font: 400 var(--step--1)/1.5 var(--f-mono); color: var(--muted); }

/* ---------- Contact ---------- */
.contact__alt { display: grid; gap: 10px; margin-top: 12px; }
.contact__alt li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.contact__alt span { font: 500 var(--step--1)/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.contact__alt a, .contact__alt strong { font-weight: 500; overflow-wrap: anywhere; }
.contact__alt a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); min-width: 0; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: #DC2626; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__submit { justify-self: start; }
.form__status { font-size: 0.95rem; color: var(--muted); }
.form__status:empty { display: none; }
.form__status.is-ok { color: var(--ok); }
.form__status.is-err { color: #DC2626; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 0.92rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between; }
.footer__mono { font-family: var(--f-mono); font-size: 0.78rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Load-in (from a visible resting state) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__text > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero__text > *:nth-child(2) { animation-delay: .06s; }
  .hero__text > *:nth-child(3) { animation-delay: .12s; }
  .hero__text > *:nth-child(4) { animation-delay: .18s; }
  .editor { animation: drop .9s .15s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes rise { from { transform: translateY(12px); opacity: .001; } }
@keyframes drop { from { transform: rotate(0deg) translateY(16px); opacity: .001; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .services, .stack__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .editor { transform: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__head { position: static; }
  .portrait { justify-self: center; }
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -20px rgba(14,23,38,.3);
  }
  .nav:not(.is-open) { display: none; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .nav .nav__cta { margin: 8px 0 0; text-align: center; }
}
@media (max-width: 640px) {
  .stats__list > div { padding: 16px 6px 0; gap: 4px; align-items: center; text-align: center; }
  .stats__list > div + div { padding-left: 6px; }
  .form__submit { justify-self: stretch; }
  .stats dd { font-size: 1.9rem; }
  .stats dt { font-size: 0.78rem; line-height: 1.35; hyphens: auto; overflow-wrap: break-word; }
  .projects, .services, .stack__groups, .form__row { grid-template-columns: minmax(0, 1fr); }
  .facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .log__hash { position: static; grid-column: 2; grid-row: 1; justify-self: start; }
  .log__item { row-gap: 2px; }
  .log__item::before { grid-row: 1 / span 2; }
  .log__body { grid-row: 2; padding-right: 0; }
  .brand__name { display: none; }
}
