/* ==========================================================
   FONTS — latin subsets from Google Fonts, served from this site
   (scripts/fetch-fonts.mjs). Variable files: one per family covers every
   weight and width used. swap = text shows at once in the fallback font.
   ========================================================== */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 500;
  font-stretch: 87.5%;
  font-display: swap;
  src: url("../assets/fonts/martian-mono-latin.woff2") format("woff2");
}

/* ==========================================================
   TOKENS — dark is the default; [data-theme="light"] is opt-in
   ========================================================== */
:root {
  --bg: #15171A;
  --panel: #1C1F23;
  --panel-2: #23272C;
  --line: #2E3339;
  --text: #ECEAE4;
  --dim: #A9A79F;
  --faint: #95948C;
  --ok: #3FB950;
  --warn: #E3A21A;
  --off: #6A6D72;
  --term-bg: #0F1012;
  --term-text: #C9C7C0;
  --focus: #E3A21A;
  --spot: rgba(236, 234, 228, 0.07);

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 8px;
  --wrap: 1160px;
  --gutter: 24px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #EDEFF1;
  --panel: #FFFFFF;
  --panel-2: #F4F5F6;
  --line: #D5D9DD;
  --text: #17191C;
  --dim: #50555B;
  --faint: #6B7077;
  --ok: #1A7F37;
  --warn: #8F5C00;
  --off: #8C9096;
  --term-bg: #1B1D20;
  --term-text: #D3D1CA;
  --focus: #8F5C00;
  --spot: rgba(23, 25, 28, 0.05);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  /* keeps section headings clear of the sticky top bar when jumping to #anchors */
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }

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

[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; font-stretch: 87.5%; letter-spacing: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ==========================================================
   LAMPS — always paired with a written state (.lamp-state)
   ========================================================== */
.lamp {
  display: inline-block;
  width: 9px; height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--off);
}
.lamp-ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent), 0 0 14px color-mix(in srgb, var(--ok) 50%, transparent);
}
.lamp-warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent), 0 0 14px color-mix(in srgb, var(--warn) 50%, transparent);
}
.lamp-state { display: inline-flex; align-items: center; gap: 8px; }
.lamp-state-ok { color: var(--ok); }
.lamp-state-warn { color: var(--warn); }
.lamp-state-off { color: var(--faint); }

/* ==========================================================
   TOP BAR
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-stretch: 115%; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  font-size: 12px;
}
.brand-name .dim { color: var(--faint); }

.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--dim); text-decoration: none; font-size: 14.5px; }
.topnav a:hover { color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px var(--mono);
  font-stretch: 87.5%;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
}
.status-chip-short { display: none; }

.icon-btn, .lang-suggest-dismiss {
  font: 500 12px var(--mono);
  font-stretch: 87.5%;
  color: var(--dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 32px;
  padding: 6px 9px;
  cursor: pointer;
}
.icon-btn:hover, .lang-suggest-dismiss:hover { color: var(--text); border-color: var(--dim); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  font: 500 12px var(--mono);
  font-stretch: 87.5%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
  color: var(--dim);
}
.lang-opt { padding: 4px 8px; border-radius: 2px; text-decoration: none; }
.lang-opt:hover { color: var(--text); }
.lang-opt.is-active, .lang-opt.is-active:hover { background: var(--text); color: var(--bg); }
.lang-sep { display: none; }

/* Below 900px the links move to a second, horizontally scrollable row instead
   of disappearing. Plain CSS, so it works without JavaScript. */
@media (max-width: 900px) {
  html { scroll-padding-top: 120px; }
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; min-height: 0; padding-top: 12px; }
  .topbar-actions { margin-left: auto; gap: 8px; }
  .topnav {
    order: 3;
    flex-basis: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 16px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 11px 8px; white-space: nowrap; }
}

/* Narrow phones: the chip shows its short label; the full one stays readable
   by screen readers (the short one is aria-hidden). */
@media (max-width: 560px) {
  .status-chip { white-space: nowrap; }
  .status-chip-short { display: inline; }
  .status-chip-full {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Phones: the availability chip gives way to the buttons; the same
   information is on the status board ("looking") and its footer. */
@media (max-width: 480px) {
  .status-chip { display: none; }
}

/* Smallest phones (320px): tighter gutter, and the brand keeps only its mark
   on screen (the name stays as the link's accessible name). */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .topnav { padding: 0 10px; }
  .topnav a { padding-left: 5px; padding-right: 5px; }
  .brand-name {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Language suggestion, shown by JS only when the visitor prefers another language. */
.lang-suggest { background: var(--panel); border-bottom: 1px solid var(--line); font-size: 14px; }
.lang-suggest-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.lang-suggest a { font-weight: 600; }
.lang-suggest-dismiss { margin-left: auto; }

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  font: 600 15px var(--sans);
  font-stretch: 110%;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1.5px solid var(--text);
  color: var(--text);
  background: none;
  cursor: pointer;
}
.btn:hover { background: var(--panel-2); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--dim); border-color: var(--dim); }

/* ==========================================================
   HERO + STATUS BOARD
   ========================================================== */
.hero { padding: 72px 0 64px; }

/* Wide signage type. Sized with clamp() so "Henrique" alone fits a 320px
   screen; it only ever breaks between words. */
.hero-name {
  font-size: clamp(2.15rem, 0.9rem + 6.3vw, 5.5rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 28px;
}

.hero-sub { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; }
.hero-desc { color: var(--dim); max-width: 62ch; font-size: 18px; }
.hero-desc strong { display: block; color: var(--text); font-weight: 600; font-stretch: 112%; font-size: 20px; margin-bottom: 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.board {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.board-cell {
  grid-column: span 2;
  background: var(--panel);
  padding: 20px 22px 22px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 120px;
}
.board-cell[data-span="3"] { grid-column: span 3; }
.board-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--faint); }
.board-value { font-size: 21px; font-weight: 600; font-stretch: 112%; line-height: 1.25; }
.board-detail { color: var(--faint); }
.board-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  background: var(--panel-2);
  color: var(--faint);
  padding: 10px 22px;
}

@media (max-width: 900px) {
  .hero { padding: 48px 0; }
  .hero-sub { grid-template-columns: 1fr; gap: 24px; }
  .board { grid-template-columns: 1fr 1fr; }
  .board-cell, .board-cell[data-span="3"] { grid-column: span 1; }
  .board-cell:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .board { grid-template-columns: 1fr; }
  .board-cell { min-height: 0; }
}

/* ==========================================================
   SECTIONS
   ========================================================== */
.section { padding: 80px 0; border-top: 1px solid var(--line); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section h2 {
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem);
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: -0.01em;
}
.sec-aside { color: var(--faint); }

.section-lead { color: var(--dim); max-width: 64ch; font-size: 18px; }

.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }

@media (max-width: 900px) {
  .section { padding: 56px 0; }
  .about { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================
   PROJECTS — each card is a station on the line
   ========================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  font: 500 12px var(--mono);
  font-stretch: 87.5%;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  min-height: 32px;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--dim); }
.filter-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter-count { color: var(--faint); }

.stations { display: grid; gap: 16px; }

.station {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.station-featured { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.station-plain { grid-template-columns: 1fr; }

.station-shot { background: var(--panel-2); border-right: 1px solid var(--line); min-height: 100%; }
.station-shot picture, .station-shot img { width: 100%; height: 100%; }
.station-shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.term { margin: 0; height: 100%; background: var(--term-bg); }
.term pre {
  margin: 0;
  padding: 20px;
  font: 400 12.5px/1.75 var(--mono);
  font-stretch: 87.5%;
  color: var(--term-text);
  white-space: pre-wrap;
}
.term-prompt { color: #5BD06D; }

.station-body { padding: 24px 26px; display: grid; gap: 12px; align-content: start; }
.station-status { display: flex; align-items: center; gap: 14px; }
.badge { color: var(--faint); border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; }
.station h3 { font-size: 24px; font-weight: 700; font-stretch: 115%; }
.station p { color: var(--dim); max-width: 64ch; }
.station .station-status { color: inherit; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 0; list-style: none; }
.tags li {
  font: 500 11.5px var(--mono);
  font-stretch: 87.5%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
}

.station-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 6px; }
.station-links a { font-weight: 600; font-stretch: 110%; }

@media (max-width: 900px) {
  .station, .station-featured { grid-template-columns: 1fr; }
  .station-shot { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ==========================================================
   STACK — bento
   ========================================================== */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack-group {
  grid-column: span 2;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.stack-group h3 { font-size: 15px; font-weight: 600; font-stretch: 112%; color: var(--dim); }
.stack-group ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.stack-group li { font-size: 15px; padding: 6px 11px; background: var(--panel-2); border-radius: 4px; }
.stack-group-planned { border-style: dashed; }

@media (max-width: 900px) {
  .stack { grid-template-columns: 1fr 1fr; }
  .stack-group { grid-column: span 1; }
}
@media (max-width: 520px) {
  .stack { grid-template-columns: 1fr; }
}

/* ==========================================================
   CERTIFICATIONS
   ========================================================== */
.certs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cert { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; align-content: start; }
.cert-name { font-weight: 600; font-stretch: 105%; }
.cert-meta { color: var(--faint); }

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

/* ==========================================================
   TIMELINE — oldest to newest, like a line
   ========================================================== */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.timeline-item { background: var(--panel); padding: 22px; display: grid; gap: 6px; align-content: start; }
.timeline-date { color: var(--faint); }
.timeline-item h3 { font-size: 18px; font-weight: 700; font-stretch: 112%; }
.timeline-item p:last-child { color: var(--dim); font-size: 15px; }

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

/* ==========================================================
   CONTACT
   ========================================================== */
.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.contact .section-lead { margin-top: 10px; }
.contact-links { display: grid; gap: 12px; justify-items: start; }
.contact-email {
  font-size: clamp(1.15rem, 0.8rem + 1.6vw, 1.9rem);
  font-weight: 700;
  font-stretch: 115%;
  text-decoration: none;
  border-bottom: 2px solid var(--ok);
  overflow-wrap: anywhere;
}
.contact-social { display: flex; gap: 20px; font-weight: 600; }

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

/* ==========================================================
   FOOTER
   ========================================================== */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font: 400 12px var(--mono);
  font-stretch: 87.5%;
  color: var(--faint);
}

/* ==========================================================
   CASE STUDY — page and dialog share the same <article>
   ========================================================== */
.cs-page { padding: 40px var(--gutter) 80px; max-width: 920px; }
.cs-back { margin-bottom: 28px; }
.cs-back a { color: var(--dim); }

.case-study { display: grid; gap: 40px; }
.cs-draft {
  color: var(--warn);
  border: 1px dashed var(--warn);
  border-radius: 4px;
  padding: 8px 12px;
}
.cs-head { display: grid; gap: 14px; }
.cs-head h1 {
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.4rem);
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.cs-head .station-status { gap: 16px; color: var(--faint); }
.cs-summary { color: var(--dim); font-size: 18px; max-width: 64ch; }

.cs-section { display: grid; gap: 14px; }
.cs-section h2 { font-size: 22px; font-weight: 700; font-stretch: 115%; }
.cs-section > p { color: var(--dim); max-width: 68ch; }
.cs-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--dim); max-width: 70ch; }
.cs-list li::marker { color: var(--faint); }

/* Architecture: an ordered list drawn as a flow of stations. */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 28px;
  counter-reset: step;
}
.flow-step {
  position: relative;
  counter-increment: step;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.flow-step::before {
  content: counter(step);
  font: 500 11px var(--mono);
  color: var(--faint);
}
/* connector to the next step */
.flow-step + .flow-step::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -29px;
  width: 28px;
  height: 2px;
  background: var(--ok);
}
.flow-label { font-weight: 600; font-stretch: 110%; overflow-wrap: anywhere; }
.flow-detail { color: var(--faint); overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .flow { grid-auto-flow: row; gap: 20px; }
  .flow-step + .flow-step::after { top: -21px; left: 24px; width: 2px; height: 20px; }
}

/* Dialog used by js/case-study.js on the home page. */
.case-dialog {
  width: min(920px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: contain;
}
.case-dialog::backdrop { background: rgba(8, 9, 10, 0.72); backdrop-filter: blur(3px); }
.case-dialog-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.case-dialog-bar a { color: var(--dim); font-size: 14px; }
.case-dialog-body { padding: 28px clamp(16px, 4vw, 40px) 40px; }

/* ==========================================================
   CV — a document: light paper in any theme, one column, prints as A4
   ========================================================== */
.cv-page { padding: 32px 0 80px; }
.cv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
  max-width: calc(210mm + 2 * var(--gutter));
}
.cv-note { color: var(--dim); font-size: 14px; max-width: 60ch; }

.cv-sheet {
  max-width: 210mm;
  margin: 0 auto;
  background: #FFFFFF;
  color: #17191C;
  padding: 16mm 17mm;
  border-radius: 4px;
  box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.6);
}
.cv { font-family: var(--sans); font-size: 10pt; line-height: 1.4; display: grid; gap: 11px; font-kerning: none; }
.cv a { color: inherit; text-decoration: none; }
.cv-head { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1.5px solid #17191C; }
.cv-head h1 { font-size: 21pt; font-weight: 800; font-stretch: 110%; line-height: 1.1; }
.cv-role { font-size: 11.5pt; font-weight: 600; }
.cv-contact { font-size: 9pt; color: #3D4247; overflow-wrap: anywhere; }
.cv-section { display: grid; gap: 5px; }
.cv-section h2 {
  font-size: 11pt;
  font-weight: 700;
  font-stretch: 105%;
  padding-bottom: 2px;
  border-bottom: 1px solid #C9CDD1;
}
.cv-section > p { color: #2B2F33; }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cv-entry { display: grid; gap: 1px; break-inside: avoid; }
.cv-entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
.cv-entry-meta { color: #4A4F55; font-size: 9pt; }
.cv-entry p { color: #2B2F33; }
.cv-bullets { list-style: disc; margin: 0; padding-left: 16px; display: grid; gap: 1px; color: #2B2F33; }
.cv-links { font-size: 9pt; color: #4A4F55; overflow-wrap: anywhere; }
.cv-plain { margin: 0; padding-left: 16px; display: grid; gap: 1px; color: #2B2F33; }

@media (max-width: 760px) {
  .cv-sheet { padding: 24px 18px; border-radius: 0; }
}

@page { size: A4; margin: 13mm 15mm; }
@media print {
  /* The page margins show the root background: keep the whole sheet white. */
  html:has(.page-cv), .page-cv { background: #FFFFFF !important; color-scheme: light; }
  .page-cv .topbar,
  .page-cv .footer,
  .page-cv .cv-toolbar,
  .page-cv .lang-suggest { display: none !important; }
  .page-cv .cv-page { padding: 0; }
  .page-cv .cv-sheet { max-width: none; padding: 0; box-shadow: none; border-radius: 0; }
}

/* ==========================================================
   TERMINAL
   ========================================================== */
.terminal {
  width: min(760px, calc(100% - 24px));
  height: min(520px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--term-bg);
  color: var(--term-text);
}
.terminal[open] { display: flex; flex-direction: column; }
.terminal::backdrop { background: rgba(8, 9, 10, 0.6); }
.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid #2E3339;
  color: #A9A79F;
}
.terminal .icon-btn { color: #A9A79F; border-color: #2E3339; }
.terminal-out {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}
.terminal-out p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-out a { color: #5BD06D; }
.terminal-echo { color: #ECEAE4; margin-top: 8px !important; }
.terminal-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #2E3339;
}
.terminal-prompt { color: #5BD06D; font-size: 14px; }
.terminal-form input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: #ECEAE4;
  font-size: 14px;
  padding: 6px 0;
}
.terminal-form input:focus { outline: none; }
.terminal-form:focus-within { box-shadow: inset 0 2px 0 var(--focus); }

/* ==========================================================
   404
   ========================================================== */
.not-found { min-height: 60vh; display: flex; align-items: center; border-top: 0; }
.not-found-inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: center; width: 100%; }
.not-found .board { margin-top: 0; grid-template-columns: 1fr; }
.not-found .board-cell { grid-column: auto; min-height: 0; }
.not-found-route { overflow-wrap: anywhere; }
.not-found-msgs { display: grid; gap: 36px; }
.not-found-msg h1, .not-found-title { font-size: clamp(1.6rem, 1rem + 2.4vw, 2.4rem); font-weight: 800; font-stretch: 120%; margin-bottom: 8px; }
.not-found-title { font-size: clamp(1.2rem, 0.9rem + 1.2vw, 1.5rem); color: var(--dim); }
.not-found-msg p { color: var(--dim); margin-bottom: 18px; }

@media (max-width: 900px) {
  .not-found-inner { grid-template-columns: 1fr; gap: 36px; }
}

/* ==========================================================
   MOTION — opt-in, and never needed for content to show
   ========================================================== */

/* Pointer-following highlight on cards (position set by js/spotlight.js). */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.spot:hover::before { opacity: 1; }

/* Scroll-driven entrance where supported. Only position moves, never opacity:
   if the animation never runs (old browser, print, screenshot), content is
   simply in place. */
@keyframes rise { from { translate: 0 24px; } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

/* Theme switch: a short cross-fade through the View Transitions API. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }

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

@media print {
  .topbar, .lang-suggest, .filter, .skip-link { display: none !important; }
  .reveal { animation: none !important; }
}
