/* ============ Fonts (self-hosted, latin subset) ============ */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("../assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ============ Tokens ============ */
:root {
  --bg: #FFFFFF;
  --canvas: #F4F5F8;
  --dot: #D3D8E2;
  --node: #FFFFFF;
  --ink: #14161C;
  --muted: #535A6A;
  --line: #DFE2E9;
  --accent: #2C45DE;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8ECFF;
  --pop: #C2410C;
  --bar: #3550F0;
  --bar-empty: #E4E7EE;
  --lift: 0 1px 0 var(--line);
  --float: 0 10px 30px rgba(20, 22, 28, .07);

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max-w: 1160px;
  --nav-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1015;
    --canvas: #141720;
    --dot: #272C38;
    --node: #1A1E28;
    --ink: #EEF0F4;
    --muted: #A3AAB8;
    --line: #2A3141;
    --accent: #93A6FF;
    --accent-ink: #0E1015;
    --accent-soft: #1D2440;
    --pop: #FF9A5C;
    --bar: #93A6FF;
    --bar-empty: #222837;
    --float: none;
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg, iframe { display: block; max-width: 100%; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -0.04em; line-height: 1.02; margin-bottom: 1.1rem; max-width: 20ch; text-wrap: balance; }
h3 { font-size: 1.15rem; font-weight: 700; }
strong { font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); }
.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; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: 1rem; top: -100px; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 10px; z-index: 100; }
.skip-link:focus { top: .75rem; }

.section-inner { max-width: var(--max-w); margin: 0 auto; padding: clamp(4.5rem, 10vw, 8rem) 1.25rem 0; }
main > section:last-child .section-inner { padding-bottom: clamp(4.5rem, 10vw, 8rem); }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; color: var(--muted); max-width: 34em; margin: 0 0 2.75rem; }
/* numbers and key phrases pop inside sentences */
.pop, .exp-bullets strong { color: var(--pop); font-weight: 700; }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .6rem 1.35rem; border-radius: 12px; font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--node); }
.btn-ghost:hover { border-color: var(--accent); }
.text-link, .gh-legend a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ============ Nav ============ */
#nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
#nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { max-width: var(--max-w); margin: 0 auto; height: 100%; padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.nav-name { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.nav-links { display: flex; gap: .15rem; align-items: center; }
.nav-links a { display: block; padding: .45rem .75rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 550; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--canvas); }
.nav-links a.nav-cta { color: var(--accent-ink); background: var(--accent); margin-left: .4rem; font-weight: 650; }
.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-radius: 10px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1rem; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem .75rem; font-size: 1.05rem; }
  .nav-links a.nav-cta { margin: .5rem 0 0; text-align: center; }
}

/* ============ Hero: the dotted canvas ============ */
.canvas { background: var(--canvas) radial-gradient(var(--dot) 1.2px, transparent 1.3px) 0 0 / 22px 22px; }
.hero { border-bottom: 1px solid var(--line); margin-top: calc(var(--nav-h) * -1); padding-top: var(--nav-h); }
.hero-inner { max-width: var(--max-w); margin: 0 auto; padding: clamp(2.25rem, 8vw, 6.5rem) 1.25rem clamp(3rem, 8vw, 6.5rem); display: grid; gap: 2.75rem; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.3fr .8fr; gap: 3.5rem; } }
.hero-role { display: flex; align-items: center; gap: .8rem; font-weight: 650; font-size: clamp(1rem, 1.8vw, 1.1rem); line-height: 1.35; margin-bottom: 1rem; }
.hero-role img { flex: none; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; transform: scale(1.04); box-shadow: 0 0 0 3px var(--node); }
.hero h1 { font-size: clamp(3rem, 8.5vw, 6.25rem); line-height: .96; letter-spacing: -0.05em; margin-bottom: 1.6rem; }
.hero-tagline { font-size: clamp(1.15rem, 2.3vw, 1.5rem); line-height: 1.45; color: var(--muted); max-width: 27em; margin-bottom: 2.1rem; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.1rem; }

/* Mini workflow: four nodes, wires drawn by js/main.js (straight fallback without it) */
.mini { position: relative; display: grid; gap: 1.4rem; text-decoration: none; color: var(--ink); }
.mini-node { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; column-gap: .8rem; align-items: center; width: min(100%, 300px); background: var(--node); border: 1.5px solid var(--line); border-radius: 16px; padding: .75rem 1rem; font-weight: 700; box-shadow: var(--lift); transition: border-color .2s; }
.mini:hover .mini-node { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mini-node i { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: .9rem; background: var(--accent-soft); color: var(--accent); }
.mini-node small { color: var(--muted); font-weight: 500; font-size: .85rem; line-height: 1.35; }
.mini-node:nth-child(odd) { justify-self: start; }
.mini-node:nth-child(even) { justify-self: end; }
.mini-node.is-out { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mini-node.is-out small { color: color-mix(in srgb, var(--accent-ink) 92%, transparent); }
.mini-node.is-out i { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); }
.mini-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 0; pointer-events: none; }
.mini-wires path { fill: none; stroke: var(--muted); stroke-width: 1.6; opacity: .6; }
.mini-wires circle { fill: var(--bg); stroke: var(--muted); stroke-width: 1.6; }
@media (max-width: 899px) { .mini { gap: 1rem; } .mini-node:nth-child(n) { justify-self: stretch; width: auto; } }
@media (max-width: 560px) { .mini { gap: .75rem; } .mini-node { padding: .55rem .85rem; border-radius: 14px; } .mini-node i { width: 28px; height: 28px; border-radius: 8px; } .mini-node small { font-size: .8rem; } }

/* ============ About ============ */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 400px; gap: 4rem; align-items: start; } }
.bio { max-width: 64ch; font-size: 1.08rem; }
.bio p + p { margin-top: 1.1rem; }
.about-figure img { width: 100%; height: auto; border-radius: 24px; border: 1.5px solid var(--line); }
.about-figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .75rem; line-height: 1.5; }
@media (max-width: 899px) { .about-figure { max-width: 480px; } }

/* quiet row of ports: focus areas, "How I build" */
.ports { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; margin-top: 2rem; color: var(--ink); font-weight: 650; font-size: .98rem; }
.ports li { display: flex; align-items: center; gap: .55rem; }
.ports li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }

/* ============ Experience ============ */
.timeline { border-top: 1px solid var(--line); }
.exp-entry { display: grid; gap: 1rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .exp-entry { grid-template-columns: 320px 1fr; gap: 3rem; } }
.exp-head { display: flex; align-items: center; gap: .9rem; }
.exp-logo { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: #FFFFFF; border: 1.5px solid var(--line); }
.exp-logo img { width: 32px; height: 32px; object-fit: contain; }
.exp-logo-wide { width: auto; padding: 0 .7rem; }
.exp-logo-wide img { width: auto; height: 17px; filter: brightness(0); } /* WeWALK ships a white wordmark */
.exp-company { font-size: clamp(1.35rem, 2.4vw, 1.6rem); letter-spacing: -0.03em; }
.exp-company a { color: var(--ink); text-decoration: none; }
.exp-company a:hover { color: var(--accent); text-decoration: underline; }
.exp-role { font-weight: 650; line-height: 1.4; margin-top: 1rem; }
.exp-date { font-size: .92rem; color: var(--muted); margin-top: .15rem; }
.exp-bullets { display: grid; gap: .7rem; align-content: start; }
.exp-bullets li { position: relative; padding-left: 1.4rem; color: var(--muted); }
.exp-bullets li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); }

/* ============ Automation: the four-stage pipeline ============ */
.auto-section { position: relative; overflow: hidden; isolation: isolate; }
.auto-section > .section-inner { position: relative; z-index: 1; }
/* desk scene, faded in behind the heading on the right */
.auto-bg { position: absolute; z-index: 0; top: clamp(1rem, 4vw, 3rem); right: 0; width: min(52%, 760px); height: auto; pointer-events: none;
  opacity: .32; filter: invert(1) hue-rotate(180deg) saturate(.6); mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 65% 65% at 60% 45%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 65% 65% at 60% 45%, #000 30%, transparent 75%); }
@media (prefers-color-scheme: dark) { .auto-bg { opacity: .4; filter: saturate(.7); mix-blend-mode: screen; } }
@media (max-width: 760px) { .auto-bg { width: 115%; right: -20%; top: 0; opacity: .22; } }

.pipe { display: grid; gap: 1.15rem; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.stage { position: relative; background: var(--node); border: 1.5px solid var(--line); border-radius: 20px; padding: 1.35rem 1.25rem 1.2rem; }
.stage-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .8rem; }
.stage-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stage-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.stage > p { color: var(--muted); font-size: .95rem; margin-bottom: .8rem; }
.stage li { padding: .6rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.stage li b { display: block; font-weight: 700; }
.stage li span { display: block; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.stage-out { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stage-out > p, .stage-out li span { color: color-mix(in srgb, var(--accent-ink) 92%, transparent); }
.stage-out li { border-color: color-mix(in srgb, var(--accent-ink) 24%, transparent); }
.stage-out .stage-icon { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); }
/* wires and ports between stages */
.stage + .stage::before { content: ""; position: absolute; left: calc(-1.15rem - 2px); top: 2.45rem; width: calc(1.15rem + 2px); border-top: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.stage:not(.stage-out)::after { content: ""; position: absolute; right: -7px; top: calc(2.45rem - 5px); width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
@media (max-width: 980px) {
  .pipe { grid-template-columns: 1fr 1fr; }
  .stage:nth-child(3)::before { display: none; }
  .stage:nth-child(2)::after { display: none; }
}
@media (max-width: 620px) {
  .pipe { grid-template-columns: 1fr; gap: 1.6rem; }
  .stage + .stage::before, .stage:nth-child(3)::before { display: block; left: 2.3rem; top: calc(-1.6rem - 2px); width: 0; height: calc(1.6rem + 2px); border-top: 0; border-left: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
  .stage:not(.stage-out)::after, .stage:nth-child(2)::after { display: block; right: auto; left: calc(2.3rem - 5px); top: auto; bottom: -7px; }
}
.sub-h { font-size: 1.2rem; letter-spacing: -0.02em; margin: 3.25rem 0 .25rem; }
.auto-section .ports { margin-top: .9rem; }

.toolkit { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 1rem; }
.toolkit h4 { font-size: .98rem; font-weight: 700; padding-bottom: .6rem; border-bottom: 2px solid var(--accent); margin-bottom: .25rem; }
.toolkit li { padding: .45rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .97rem; }

/* ============ Cards (guides, GitHub, LinkedIn, contact) ============ */
.card { background: var(--node); border: 1.5px solid var(--line); border-radius: 20px; padding: 1.5rem; }

/* ============ Guides ============ */
.guide-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.guide-card { position: relative; display: flex; flex-direction: column; gap: .55rem; color: var(--ink); text-decoration: none; transition: border-color .2s; }
.guide-card:hover { border-color: var(--accent); }
.guide-card:hover .guide-more { text-decoration: underline; }
.guide-kicker { font-size: .85rem; font-weight: 600; color: var(--muted); }
.guide-title { font-weight: 750; font-size: 1.15rem; line-height: 1.35; letter-spacing: -0.015em; }
.guide-desc { color: var(--muted); font-size: .95rem; }
.guide-more { margin-top: auto; padding-top: .35rem; color: var(--accent); font-weight: 650; }

/* ============ Projects ============ */
.tiles { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); margin-bottom: 3.5rem; }
.tile { display: flex; flex-direction: column; background: var(--canvas); border: 1.5px solid var(--line); border-radius: 28px; padding: clamp(1.6rem, 4vw, 2.6rem); }
.app-icon { width: 88px; height: 88px; border-radius: 22%; border: 1px solid var(--line); margin-bottom: 1.4rem; }
.app-kicker { font-size: .88rem; font-weight: 600; color: var(--muted); margin: 0 0 .35rem; }
.app-name { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.035em; line-height: 1.1; margin: 0 0 .7rem; }
.tile-text { color: var(--muted); max-width: 32em; margin: 0 0 1.4rem; }
.tile-foot { margin-top: auto; }
.app-store { display: inline-block; line-height: 0; text-decoration: none; }
.app-store img { height: 44px; width: auto; }
.app-credits { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; }
.app-credits dt { color: var(--muted); display: inline; }
.app-credits dt::after { content: ": "; }
.app-credits dd { display: inline; margin: 0; font-weight: 650; color: var(--ink); }
.app-credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.app-credits a:hover { color: var(--accent); }

/* GitHub calendar */
.gh-lead { color: var(--muted); margin: 0 0 1.1rem; }
.gh-lead strong { color: var(--pop); }
.gh-card { padding: 1.4rem 1.4rem 1.1rem; }
.gh-scroll { overflow-x: auto; direction: rtl; scrollbar-width: thin; }   /* phones: newest weeks visible first */
.gh-cal { direction: ltr; width: 100%; min-width: 640px; height: auto; }
.gh-cal text { font: 9px var(--font); fill: var(--muted); }
.l0 { fill: var(--bar-empty); background: var(--bar-empty); }
.l1 { fill: color-mix(in srgb, var(--bar) 30%, var(--bar-empty)); background: color-mix(in srgb, var(--bar) 30%, var(--bar-empty)); }
.l2 { fill: color-mix(in srgb, var(--bar) 55%, var(--bar-empty)); background: color-mix(in srgb, var(--bar) 55%, var(--bar-empty)); }
.l3 { fill: color-mix(in srgb, var(--bar) 78%, var(--bar-empty)); background: color-mix(in srgb, var(--bar) 78%, var(--bar-empty)); }
.l4 { fill: var(--bar); background: var(--bar); }
.gh-legend { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-top: .9rem; font-size: .9rem; }
.gh-legend a { font-weight: 650; text-decoration: none; }
.gh-legend a:hover { text-decoration: underline; }
.gh-scale { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .8rem; }
.gh-sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.gh-scale .gh-sq:first-child { margin-left: 4px; }
.gh-scale .gh-sq:last-child { margin-right: 4px; }

/* ============ LinkedIn ============ */
.li-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.li-card { display: flex; flex-direction: column; gap: .75rem; }
.li-card time { font-size: .88rem; color: var(--muted); font-weight: 600; }
.li-card .headline { font-weight: 650; line-height: 1.45; }
.li-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: auto; }
.li-embed { width: 100%; border: 0; border-radius: 12px; min-height: 520px; background: var(--canvas); }
.li-note { font-size: .84rem; color: var(--muted); }
.li-more { margin: 1.4rem 0 0; }
.li-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }

/* ============ Contact ============ */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.25fr; gap: 4rem; align-items: start; } }
.contact-info { display: grid; gap: 1.4rem; }
.contact-label { font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: .15rem; }
.contact-link { font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.3rem); letter-spacing: -0.015em; overflow-wrap: anywhere; text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
.contact-form { display: grid; gap: 1.1rem; }
.form-row { display: grid; gap: .35rem; }
.form-row label { font-weight: 650; font-size: .95rem; }
.form-row input, .form-row textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .9rem; min-height: 48px; width: 100%; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted); }
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row textarea { resize: vertical; }
.field-error, .form-global-error { color: #B42318; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .field-error, .form-global-error { color: #FDA29B; } }
.form-success { background: var(--accent-soft); padding: 1rem 1.25rem; border-radius: 12px; font-weight: 650; margin-bottom: 1rem; }
/* Formspree ajax marks the shown message with data-fs-active */
[data-fs-success]:not([data-fs-active]), div[data-fs-error]:not([data-fs-active]) { display: none; }
.contact-form .btn { justify-self: start; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 1.75rem 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; font-size: .9rem; color: var(--muted); }

/* ============ Guide article page ============ */
.guide { max-width: 780px; padding-bottom: clamp(4rem, 8vw, 6rem); }
.guide-crumb { font-size: .95rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; }
.guide-crumb a { color: var(--accent); text-decoration: none; }
.guide-crumb a:hover { text-decoration: underline; }
.guide h1 { font-size: clamp(2.1rem, 5.5vw, 3.2rem); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: .9rem; }
.guide-meta { color: var(--muted); font-size: .95rem; margin-bottom: 2.25rem; }
.guide .lead { margin: 0 0 2rem; }
.guide h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); letter-spacing: -0.03em; line-height: 1.2; max-width: none; margin: 3rem 0 .9rem; }
.guide h3 { font-size: 1.15rem; margin: 1.9rem 0 .5rem; }
.guide p { margin: 0 0 1rem; }
.guide ul, .guide ol { margin: 0 0 1.25rem; padding-left: 1.4rem; display: grid; gap: .45rem; }
.guide ul { list-style: disc; }
.guide ol { list-style: decimal; }
.guide li::marker { color: var(--accent); font-weight: 700; }
.guide code { font-family: var(--mono); font-size: .86em; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; padding: .08em .35em; overflow-wrap: anywhere; }
.guide pre { background: var(--canvas); border: 1.5px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; margin: 0 0 1.25rem; overflow-x: auto; line-height: 1.55; }
.guide pre code { background: none; border: 0; padding: 0; font-size: .85rem; overflow-wrap: normal; white-space: pre; }
.guide table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: .96rem; }
.guide th, .guide td { text-align: left; vertical-align: top; padding: .65rem .75rem; border-top: 1px solid var(--line); }
.guide th { width: 34%; font-weight: 650; color: var(--ink); }
.guide tr:last-child th, .guide tr:last-child td { border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .guide th, .guide td { display: block; width: auto; padding: .35rem 0; border: 0; } .guide th { padding-top: .75rem; border-top: 1px solid var(--line); } }
.guide-cta { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; background: var(--canvas); }
.guide-cta p { margin: 0; max-width: 46ch; color: var(--muted); }
.guide-cta .guide-cta-h { margin-bottom: .35rem; }

/* Node-chain diagram in guides: a row of nodes on wide screens, a column on phones */
.flow { display: flex; align-items: stretch; gap: 1.75rem; margin: 0 0 2.5rem; padding: 1.5rem; border-radius: 18px; border: 1.5px solid var(--line); }
.flow-node { position: relative; flex: 1 1 0; background: var(--node); border: 1.5px solid var(--line); border-radius: 14px; padding: .7rem .85rem; font-weight: 650; font-size: .95rem; line-height: 1.35; box-shadow: var(--lift); }
.flow-node + .flow-node::before { content: ""; position: absolute; left: -1.75rem; top: 50%; width: 1.75rem; border-top: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.flow-node + .flow-node::after { content: ""; position: absolute; left: -7px; top: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--node); border: 2px solid var(--muted); }
.flow-kind { display: block; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: .2rem; }
.flow-source { border-style: dashed; color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .flow { flex-direction: column; gap: 1.4rem; }
  .flow-node + .flow-node::before { left: 1.4rem; top: -1.4rem; width: 0; height: 1.4rem; border-top: 0; border-left: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
  .flow-node + .flow-node::after { left: calc(1.4rem - 5px); top: -7px; }
}
/* Longer chains (6+ nodes) always stack: a row would squeeze the node names */
.flow-long { flex-direction: column; gap: 1.2rem; }
.flow-long .flow-node { padding: .55rem .85rem; max-width: 380px; }
.flow-long .flow-node + .flow-node::before { left: 1.4rem; top: -1.2rem; width: 0; height: 1.2rem; border-top: 0; border-left: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.flow-long .flow-node + .flow-node::after { left: calc(1.4rem - 5px); top: -7px; }
