/* ============================================================
   Carlos Machicado — Portfolio
   Design system: minimal + terminal accents, light/dark
   Plain CSS, no build step.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --accent: #3a6b54;          /* verde salvia profundo (AA en texto) */
  --accent-2: #9a6a3c;        /* terracota desierto, apagado (acento 2) */
  --accent-soft: #e7efe8;     /* salvia muy claro, solo superficies */
  --term: #5c7d4e;            /* verde hoja para marcadores mono */
  --sand: #d9c7a8;            /* arena */
  --on-accent: #ffffff;       /* texto sobre fondo de acento */
  --dot: rgba(58, 107, 84, .5);   /* color base del puntillismo */

  --bg: #faf8f3;              /* blanco cálido */
  --bg-soft: #f1ece1;         /* arena muy claro (marca el ritmo de secciones) */
  --surface: #fffefb;
  --text: #20231e;            /* grafito cálido */
  --text-muted: #5e6157;
  --text-faint: #8a8d80;
  --border: #e7e0d2;
  --border-strong: #d7cebb;

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

  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1080px;
  --gutter: clamp(20px, 5vw, 48px);

  --shadow: 0 1px 2px rgba(20, 24, 31, .04), 0 8px 24px rgba(20, 24, 31, .06);
  --shadow-hover: 0 2px 4px rgba(20, 24, 31, .06), 0 16px 40px rgba(20, 24, 31, .10);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --accent: #a8c3a0;          /* salvia pastel sobre fondo oscuro */
  --accent-2: #cf9d6b;        /* terracota claro */
  --accent-soft: #1b2c25;
  --term: #8fb57e;
  --sand: #2a3a30;
  --on-accent: #10201c;       /* texto oscuro sobre acento pastel */
  --dot: rgba(168, 195, 160, .52);

  --bg: #10201c;              /* verde petróleo profundo (no negro) */
  --bg-soft: #142a24;         /* distinto de --bg: recupera el ritmo de secciones */
  --surface: #17241f;
  --text: #e4e7dd;            /* hueso */
  --text-muted: #9ba396;
  --text-faint: #6e7668;
  --border: #243a32;
  --border-strong: #2f4a40;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .5);
}

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

.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 110px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
.bg-soft { background: var(--bg-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; text-decoration: none; }

/* ---------- Eyebrow (terminal flavor) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--term);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: "//"; color: var(--accent); opacity: .7; }
.eyebrow--prompt::before { content: "$"; }

.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); }
.section-head p { color: var(--text-muted); margin-top: 12px; font-size: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { box-shadow: var(--shadow-hover); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.btn .ico { width: 18px; height: 18px; }

/* ---------- Header / Nav ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mono { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.brand .dot { color: var(--term); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-muted); font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }

.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-soft); }
.icon-btn svg { width: 19px; height: 19px; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
}
.lang-toggle button {
  border: 0; background: transparent; color: var(--text-muted);
  padding: 8px 11px; cursor: pointer; transition: background .2s, color .2s;
}
.lang-toggle button.active { background: var(--accent); color: var(--on-accent); }

.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

/* mobile nav */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 22px;
    transform: translateY(-130%); transition: transform .35s var(--ease);
    box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px; font-size: 16px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(28px, 4.5vw, 52px) clamp(44px, 7vw, 76px); overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 19px 19px;
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 80% 4%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 72% 64% at 80% 4%, #000 0%, transparent 72%);
  opacity: .5;
}
.hero .container { position: relative; z-index: 1; }
.hero-inner { max-width: 820px; }
.hero h1 {
  font-size: clamp(40px, 7.4vw, 72px); letter-spacing: -.03em; margin: 8px 0 0;
}
.hl { color: var(--accent); }
.hero-role { font-size: clamp(17px, 2.6vw, 23px); font-weight: 600; color: var(--text); margin-top: 10px; }
.hero .lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--text-muted); margin-top: 18px; max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-socials { display: flex; gap: 10px; margin-top: 30px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: clamp(44px, 7vw, 72px); }
.stat {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; background: var(--surface);
}
.stat .num { font-family: var(--font-mono); font-size: clamp(24px, 3.2vw, 32px); font-weight: 700; color: var(--accent); line-height: 1; }
.stat .num .suffix { font-size: .6em; }
.stat .lbl { font-size: 13px; color: var(--text-muted); margin-top: 9px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Hero 2-column + identity card ---------- */
.hero-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.hero-main { min-width: 0; }
.hero-card { margin: 0; }
@media (max-width: 880px) { .hero-layout { grid-template-columns: 1fr; } .hero-card { max-width: 380px; } }

/* ---------- Tech logo carousel ---------- */
.tech-strip {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg-soft); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
/* 3 identical copies in the DOM; animating by exactly one copy (-100%/3)
   keeps the loop seamless on any viewport up to ~2 copies wide. */
.tech-strip .marquee { display: flex; width: max-content; animation: marquee 46s linear infinite; will-change: transform; }
.tech-strip:hover .marquee { animation-play-state: paused; }
.tech { position: relative; display: flex; align-items: center; justify-content: center; width: 128px; height: 96px; flex: none; }
.tech img { width: 40px; height: 40px; filter: grayscale(1); opacity: .46; transition: filter .25s var(--ease), opacity .25s var(--ease), transform .25s var(--ease); }
.tech:hover img { filter: none; opacity: 1; transform: translateY(-5px); }
.tech .name {
  position: absolute; bottom: 16px; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--accent); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
  white-space: nowrap; pointer-events: none;
}
.tech:hover .name { opacity: 1; transform: translateY(0); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-100% / 3)); } }
@media (prefers-reduced-motion: reduce) { .tech-strip .marquee { animation: none; flex-wrap: wrap; justify-content: center; } .tech img { opacity: .8; filter: none; } }

/* ---------- Demos sub-block (lives inside Projects) ---------- */
.demos-sub { margin-top: clamp(34px, 5vw, 54px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px dashed var(--border-strong); }
.demos-sub .eyebrow { margin-bottom: 18px; }

/* ---------- Section relief (varied subtle motifs per block) ----------
   3 motifs used with intent: dots = data/AI, lines = structure/backend,
   arcs = trajectory/progress. Each masked to a different corner so it
   never crosses the centered text. All use var(--dot) → light/dark safe,
   static → no motion concerns. */
.relief { position: relative; }
.relief > .container { position: relative; z-index: 1; }
.relief::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  /* "donut" mask: clean zone behind the centered text, motif visible toward all edges */
  -webkit-mask-image: radial-gradient(ellipse 78% 66% at 50% 46%, transparent 0 30%, #000 80%);
  mask-image: radial-gradient(ellipse 78% 66% at 50% 46%, transparent 0 30%, #000 80%);
}
.relief-dots::before { background-image: radial-gradient(var(--dot) 1.6px, transparent 2.2px); background-size: 22px 22px; opacity: .6; }
.relief-lines::before { background-image: repeating-linear-gradient(-45deg, var(--dot) 0 1.5px, transparent 1.5px 10px); opacity: .48; }
.relief-arcs::before {
  background-image: repeating-radial-gradient(circle at 100% 100%, transparent 0 40px, var(--dot) 40px 41.5px); opacity: .34;
  /* arcs are continuous curved strokes — wider clean zone so they don't cross body text */
  -webkit-mask-image: radial-gradient(ellipse 80% 72% at 50% 46%, transparent 0 42%, #000 88%);
  mask-image: radial-gradient(ellipse 80% 72% at 50% 46%, transparent 0 42%, #000 88%);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.about-body p { color: var(--text-muted); margin-bottom: 18px; font-size: 17.5px; }
.about-body strong { color: var(--text); font-weight: 600; }
.about-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 22px; box-shadow: var(--shadow); font-family: var(--font-mono); font-size: 13.5px;
}
.about-card .row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.about-card .row:last-child { border-bottom: 0; }
.about-card .k { color: var(--text-faint); }
.about-card .v { color: var(--text); text-align: right; }
.about-card .v.accent { color: var(--accent); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.skill-group { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; background: var(--surface); transition: border-color .25s, transform .25s; }
.skill-group:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-group h3 { font-size: 13px; font-family: var(--font-mono); color: var(--term); letter-spacing: .03em; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.skill-group h3 svg { width: 17px; height: 17px; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 7px;
}

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 760px) { .projects-grid { grid-template-columns: 1fr; } }

.project {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 26px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  overflow: hidden;
}
.project::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--term)); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.project:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.project:hover::before { transform: scaleX(1); }
.project.is-flagship, .project.is-wide { grid-column: span 2; }
@media (max-width: 760px) { .project.is-flagship, .project.is-wide { grid-column: span 1; } }

.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.project-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent);
}
.project-ico svg { width: 23px; height: 23px; }
.badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.badge--live { background: color-mix(in srgb, var(--term) 14%, transparent); color: var(--term); }
.badge--live .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--term); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--term) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.project h3 { font-size: 21px; margin-bottom: 8px; }
.project .desc { color: var(--text-muted); font-size: 15.5px; flex-grow: 1; }
.project .stack { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.project .stack .tag { font-size: 11.5px; padding: 4px 9px; }
.project .links { display: flex; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.project .links a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.project .links a svg { width: 16px; height: 16px; }
.project .links .link-muted { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-faint); font-family: var(--font-mono); }
.flagship-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 18px; }
.flagship-meta .fm { font-family: var(--font-mono); }
.flagship-meta .fm .n { font-size: 20px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.flagship-meta .fm .l { font-size: 12px; color: var(--text-muted); }
.proj-highlight { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 9px 13px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.proj-highlight:hover { text-decoration: none; filter: brightness(.97); }
.proj-highlight svg { width: 16px; height: 16px; }

/* ---------- Demos (live) ---------- */
.demos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.demo {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 22px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.demo:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.demo h3 { font-size: 18px; }
.demo p { color: var(--text-muted); font-size: 14.5px; }
.demo .demo-link { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14.5px; }
.demo .demo-link svg { width: 16px; height: 16px; }
.demo--placeholder { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--text-faint); }
.demo--placeholder svg { width: 26px; height: 26px; opacity: .6; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 8px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 34px 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 3px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.tl-item.is-current::before { background: var(--term); border-color: var(--term); box-shadow: 0 0 0 4px color-mix(in srgb, var(--term) 25%, transparent); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.tl-role { font-size: 18px; font-weight: 700; }
.tl-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.tl-org { color: var(--accent); font-weight: 600; font-size: 15px; margin-top: 2px; }
.tl-item ul { margin-top: 12px; display: grid; gap: 8px; }
.tl-item li { position: relative; padding-left: 20px; color: var(--text-muted); font-size: 15.5px; }
.tl-item li::before { content: "▹"; position: absolute; left: 0; color: var(--term); }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .edu-grid { grid-template-columns: 1fr; } }
.edu {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 22px;
}
.edu .edu-ico { flex-shrink: 0; width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.edu .edu-ico svg { width: 23px; height: 23px; }
.edu h3 { font-size: 17px; }
.edu .edu-org { color: var(--text-muted); font-size: 14.5px; margin-top: 4px; }
.edu .edu-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-head { margin-inline: auto; }
.contact h2 { font-size: clamp(28px, 5vw, 44px); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 32px; }
.contact-card {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 14px 20px; color: var(--text); font-weight: 500; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.contact-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.contact-card svg { width: 20px; height: 20px; color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 34px; }
.footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.footer .muted { color: var(--text-faint); font-size: 13.5px; font-family: var(--font-mono); }
.footer a { color: var(--text-muted); }

/* ---------- Case study ---------- */
.cs-back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13.5px; color: var(--text-muted); font-weight: 500; }
.cs-back:hover { color: var(--accent-2); text-decoration: none; }
.cs-back svg { width: 16px; height: 16px; }

.cs-hero { padding-block: clamp(40px, 7vw, 72px) clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.cs-hero h1 { font-size: clamp(32px, 6vw, 56px); letter-spacing: -.03em; color: var(--accent); }
.cs-hero .cs-sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--text-muted); margin-top: 12px; max-width: 720px; }
.cs-hero .cs-role { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); margin-top: 16px; }

/* ---------- Case-study page relief: reuse the home .relief donut per block ---------- */
.cs-hero.relief { overflow: hidden; }
.cs-section.relief > * { position: relative; z-index: 1; }

.cs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.cs-stats .chip { background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; }
.cs-stats .chip .n { font-family: var(--font-mono); font-size: clamp(20px, 3vw, 26px); font-weight: 700; color: var(--accent); line-height: 1; }
.cs-stats .chip .l { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
@media (max-width: 640px) { .cs-stats { grid-template-columns: repeat(2, 1fr); } }

.cs-body { padding-block: clamp(36px, 6vw, 64px); }
.cs-section { margin-bottom: clamp(40px, 6vw, 64px); }
.cs-section:last-child { margin-bottom: 0; }
.cs-section > h2 {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; color: var(--accent);
  text-transform: lowercase; border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.cs-section > h2 .idx { color: var(--term); }
.cs-lede { font-size: 17.5px; color: var(--text); max-width: 760px; }
.cs-lede + .cs-lede { margin-top: 14px; }

.cs-dl { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.cs-dl .it { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cs-dl .it:last-child { border-bottom: 0; }
.cs-dl dt { font-weight: 600; color: var(--accent); font-size: 14.5px; font-family: var(--font-mono); }
.cs-dl dd { margin: 6px 0 0; color: var(--text-muted); font-size: 15.5px; }
.cs-dl dd code, .cs-lede code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-soft); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--accent); }

/* RAG flow */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-top: 8px; }
.flow-step { flex: 1; min-width: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: relative; }
.flow-step .fs-t { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.flow-step .fs-t svg { width: 16px; height: 16px; }
.flow-step .fs-d { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.flow-arrow { display: flex; align-items: center; color: var(--term); font-size: 20px; }
@media (max-width: 720px) { .flow-arrow { transform: rotate(90deg); width: 100%; justify-content: center; } }

.cs-callout { background: var(--accent-soft); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 20px 24px; }
.cs-callout-head { font-family: var(--font-mono); font-weight: 600; color: var(--accent); font-size: 14px; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.cs-callout p { font-size: 15.5px; color: var(--text-muted); margin: 0 0 12px; }
.cs-callout p:last-child { margin-bottom: 0; }
.cs-callout em { font-style: italic; color: var(--text); }
.cs-callout code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--accent); }
.cs-callout-impact { color: var(--text) !important; }
.cs-callout-impact strong { color: var(--accent); }

.cs-note { font-size: 13.5px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 8px; }
.cs-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- i18n visibility ---------- */
[data-i18n-hide] { display: none !important; }

/* ---------- Pointillism / stipple identity ---------- */
.section-head .eyebrow::after {
  content: ""; display: inline-block; width: 54px; height: 7px; margin-left: 8px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 9px 7px; opacity: .9; vertical-align: middle;
}
.about-photo-wrap { position: relative; width: 176px; height: 176px; margin: 0 auto 18px; }
.about-photo {
  width: 176px; height: 176px; border-radius: 50%; object-fit: cover;
  position: relative; z-index: 1; border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
.about-photo-wrap::before {
  content: ""; position: absolute; inset: -15px; border-radius: 50%; z-index: 0;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.6px);
  background-size: 9px 9px; opacity: .8;
  -webkit-mask-image: radial-gradient(circle, transparent 50%, #000 53%, transparent 82%);
  mask-image: radial-gradient(circle, transparent 50%, #000 53%, transparent 82%);
}
.about-name { text-align: center; font-weight: 700; font-size: 17px; margin: 0 0 2px; }
.about-tagline { text-align: center; color: var(--term); font-family: var(--font-mono); font-size: 12.5px; margin: 0 0 18px; }

/* ---------- Reveal animations (progressive enhancement) ---------- */
.js .reveal { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1 !important; transform: none !important; } }
