/* ==========================================================================
   Vassilis Kouvelis: "defense" variant
   Concept: SOC console  (see DESIGN.md)
   ========================================================================== */

:root {
  --bg: #07090c;
  --panel: #0d1117;
  --panel-2: #121821;
  --fg: #d7dee7;
  --dim: #8b96a5;
  --line: #1f2833;
  --line-2: #2c3a4a;
  --ok: #3ddc97;
  --warn: #ffb547;
  --deny: #ff6b6b;
  --key: #79b8ff;
  --str: #e6c07b;
  --type: #c792ea;
  --on-ok: #04110b;

  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --text: 'Commissioner', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(1rem, 3vw, 2.5rem);
  --tree-w: 15.5rem;
  --ease: cubic-bezier(.16, 1, .3, 1);        /* expo-out: settles softly */
  --ease-io: cubic-bezier(.65, 0, .35, 1);    /* in-out: for wipes */
  --radius: 8px;

  color-scheme: dark;
}

/* ---------- Language switching ---------- */
:root:not([data-lang="el"]) body [lang="el"] { display: none !important; }
:root[data-lang="el"] body [lang="en"] { display: none !important; }

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(139, 150, 165, .09) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
  color: var(--fg);
  font: 400 .95rem/1.65 var(--mono);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(61, 220, 151, .2);
  touch-action: manipulation;
}

::selection { background: var(--ok); color: var(--on-ok); }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
pre { margin: 0; }
strong { color: var(--ok); font-weight: 700; }

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

.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;
}
.print-only { display: none; }
[hidden] { display: none !important; }

/* Syntax tokens */
.c { color: var(--dim); }
.k { color: var(--key); }
.kw { color: var(--key); }
.s { color: var(--str); }
.n { color: var(--warn); }
.p { color: var(--dim); }
.ty { color: var(--type); }
.fn { color: var(--ok); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.pr { color: var(--ok); font-weight: 700; }

.skip {
  position: fixed;
  left: var(--gutter);
  top: calc(env(safe-area-inset-top, 0px) + .75rem);
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--ok);
  color: var(--on-ok);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(calc(-100% - 2rem));
  transition: transform .2s var(--ease);
}
.skip:focus-visible { transform: none; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--tree-w) minmax(0, 1fr);
  min-height: 100svh;
}

/* Explorer */
.tree {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.25rem) 1rem 1.25rem max(1rem, env(safe-area-inset-left, 0px));
  background: rgba(13, 17, 23, .92);
  border-right: 1px solid var(--line);
  font-size: .85rem;
}
.tree__title { color: var(--dim); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.tree__root { color: var(--fg); font-weight: 700; }
.tree__list { list-style: none; margin: 0; padding: 0 0 0 .5rem; display: grid; gap: .1rem; }
.tree__list a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--dim);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.tree__list a:hover { color: var(--fg); background: var(--panel-2); }
.tree__list a[aria-current="location"] { color: var(--fg); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--ok); }
.ic { font-style: normal; width: 1.4em; text-align: center; font-size: .75rem; font-weight: 700; }
.ic--sh, .ic--ok { color: var(--ok); }
.ic--md { color: var(--key); font-size: .62rem; }
.ic--dir { color: var(--str); }
.ic--log { color: var(--type); }
.ic--fw { color: var(--deny); }

.flags { margin-top: auto; display: grid; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.flag { display: flex; align-items: center; gap: .35rem; }
.flag__k { color: var(--key); font-size: .78rem; margin-right: .25rem; }
.flag button {
  font: 700 .72rem/1 var(--mono);
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: .45rem .6rem;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.flag button:hover { color: var(--fg); border-color: var(--dim); }
.flag button[aria-pressed="true"] { color: var(--on-ok); background: var(--ok); border-color: var(--ok); }
#motion-toggle[aria-pressed="false"] { color: var(--warn); border-color: var(--warn); background: transparent; }
#motion-toggle[aria-pressed="true"] .off-txt,
#motion-toggle[aria-pressed="false"] .on-txt { display: none !important; }

/* ---------- Main column ---------- */
main { min-width: 0; padding: 0 var(--gutter); }

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  padding: calc(env(safe-area-inset-top, 0px) + clamp(2rem, 6vw, 4rem)) 0 clamp(2rem, 5vw, 3rem);
}

/* Window chrome */
.win {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}
.win__bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 2.4rem;
  padding: 0 .9rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  color: var(--dim);
}
.dots { display: inline-flex; gap: .4rem; }
.dots i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--line-2); }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.win__file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.win__badge {
  margin-left: auto;
  font-size: .65rem;
  letter-spacing: .1em;
  padding: .2rem .45rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
}
.win__btn {
  margin-left: auto;
  font: 700 .72rem/1 var(--mono);
  color: var(--ok);
  background: transparent;
  border: 1px solid var(--ok);
  border-radius: 4px;
  padding: .4rem .65rem;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.win__btn:hover { background: var(--ok); color: var(--on-ok); }
.win__note { padding: .7rem 1rem; border-top: 1px solid var(--line); color: var(--dim); font-size: .72rem; }

/* Hero terminal */
.term__body { padding: clamp(1.1rem, 3vw, 2rem) clamp(1rem, 3vw, 2.25rem) clamp(1.3rem, 3vw, 2.25rem); display: grid; gap: .55rem; }
.cmd { color: var(--fg); }
.out { color: var(--dim); }
.hero__name {
  font: 800 clamp(2.4rem, 8.4vw, 7.25rem)/1 var(--mono);
  letter-spacing: -.045em;
  text-transform: uppercase;
  color: var(--fg);
  margin: .1em 0 .2em;
}
.hero__name span { text-shadow: 0 0 34px rgba(61, 220, 151, .16); }
.status { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; color: var(--fg); }
.status li { display: grid; grid-template-columns: auto 10ch minmax(0, 1fr); column-gap: 1ch; align-items: baseline; }
.status .k { white-space: nowrap; }
.cursor {
  display: inline-block;
  width: .6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--ok);
  margin-left: .1em;
}
.motion .cursor { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .12; } }

/* Scan line over hero terminal */
.term::after {
  content: '';
  position: absolute;
  inset: 2.4rem 0 auto 0;
  height: 8rem;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(61, 220, 151, .05) 50%, transparent);
  opacity: 0;
  will-change: transform;
}
.motion .term::after { opacity: 1; animation: scan 9s var(--ease-io) infinite; }
@keyframes scan { from { transform: translateY(-8rem); } to { transform: translateY(34rem); } }

/* Hero timeline: delay classes instead of inline styles (keeps the CSP strict: no 'unsafe-inline') */
.dl-0 { --d: 0s; }      .dl-40 { --d: .4s; }    .dl-105 { --d: 1.05s; } .dl-140 { --d: 1.4s; }
.dl-155 { --d: 1.55s; } .dl-175 { --d: 1.75s; } .dl-210 { --d: 2.1s; }  .dl-220 { --d: 2.2s; }
.dl-230 { --d: 2.3s; }  .dl-240 { --d: 2.4s; }  .dl-250 { --d: 2.5s; }  .dl-275 { --d: 2.75s; }
.dl-290 { --d: 2.9s; }

.out--focus { color: var(--fg); }
.out--focus .k { color: var(--ok); }

/* Hero reveal: smooth wipes for commands, a masked rise for the name, a soft slide for status lines.
   Only transform / opacity / clip-path are animated, so it stays on the compositor. */
.js.motion .t {
  clip-path: inset(-.2em 100% -.2em 0);
  animation: wipe .65s var(--ease-io) var(--d, 0s) forwards;
}
@keyframes wipe { to { clip-path: inset(-.2em 0 -.2em 0); } }

.js.motion .t--name {
  clip-path: inset(0 0 100% 0);
  transform: translateY(.35em);
  animation: rise 1.1s var(--ease) var(--d, 0s) forwards;
}
@keyframes rise { to { clip-path: inset(-.4em -.6em -.5em -.6em); transform: none; } }

.js.motion .status .t {
  clip-path: none;
  opacity: 0;
  transform: translateX(-10px);
  animation: slide-in .6s var(--ease) var(--d, 0s) forwards;
}
@keyframes slide-in { to { opacity: 1; transform: none; } }

.js.motion .fade { opacity: 0; transform: translateY(14px); animation: fade-up 1s var(--ease) var(--d, 0s) forwards; }
@keyframes fade-up { to { opacity: 1; transform: none; } }

.js.motion .tree { animation: tree-in .9s var(--ease) both; }
@keyframes tree-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

.hero__below { display: grid; gap: 1.25rem; }
.lede { font: 400 clamp(1.02rem, 1.35vw, 1.2rem)/1.6 var(--text); color: var(--fg); max-width: 60ch; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: 0; font-size: .82rem; }
.meta div { display: flex; gap: .6rem; }
.meta dt { color: var(--key); }
.meta dt::after { content: ':'; color: var(--dim); }
.meta dd { margin: 0; color: var(--fg); }

/* Buttons */
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.1rem;
  border-radius: 6px;
  font: 700 .9rem/1.2 var(--mono);
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { border-color: var(--ok); color: var(--ok); transform: translateY(-1px); }
.btn__pr { color: var(--ok); }
.btn--ok { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.btn--ok .btn__pr, .btn--ok .c { color: rgba(4, 17, 11, .65); }
.btn--ok:hover { background: #5ff0b0; border-color: #5ff0b0; color: var(--on-ok); }
.btn--xl { font-size: clamp(.9rem, 1.4vw, 1.05rem); padding: 1rem 1.3rem; }

/* ---------- Sections ---------- */
.sec { padding-top: clamp(4rem, 9vw, 7rem); }
.sec__h {
  font: 800 clamp(1.6rem, 3.4vw, 2.6rem)/1.1 var(--mono);
  letter-spacing: -.03em;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.sec__h .c { font-weight: 400; }

.js.motion .reveal {
  opacity: 0;
  transform: translateY(28px) scale(.985);
  transform-origin: 50% 0;
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.js.motion .reveal.is-in { opacity: 1; transform: none; }

/* Rows cascade in after their panel arrives (index set by main.js) */
.js.motion .reveal :is(.vfy > li, .fw tbody tr, .git > li, .tagsx > li, .diff > li, .tags > li, .layers > li, .which > div) {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s var(--ease), transform .8s var(--ease), background-color .2s var(--ease);
  transition-delay: calc(.18s + var(--i, 0) * 45ms), calc(.18s + var(--i, 0) * 45ms), 0s;
}
.js.motion .reveal.is-in :is(.vfy > li, .fw tbody tr, .git > li, .tagsx > li, .diff > li, .tags > li, .layers > li, .which > div) { opacity: 1; transform: none; }

.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

/* Code blocks */
.code { padding: clamp(1rem, 2.5vw, 1.6rem); font-size: .88rem; overflow-x: auto; }
.code--prose { display: grid; gap: 1rem; }
.code--prose p:not(.md-h) { font: 400 1rem/1.7 var(--text); color: var(--fg); max-width: 64ch; }
.md-h { font: 700 clamp(1.1rem, 1.8vw, 1.35rem)/1.4 var(--mono); color: var(--fg); }
pre.code { white-space: pre; line-height: 1.75; tab-size: 2; }
pre.code code { font: inherit; }
.code--num code { counter-reset: ln; }

/* ---------- Projects ---------- */
.proj {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  border-top: 1px dashed var(--line-2);
}
.proj + .proj { margin-top: 1rem; }
.proj--alt .proj__text { order: 2; }
.proj__text { display: grid; gap: 1rem; min-width: 0; }
.proj__text h3 { font: 800 clamp(1.35rem, 2.6vw, 2.1rem)/1.15 var(--mono); letter-spacing: -.03em; }
.proj__text p:not(.tagline) { font: 400 1rem/1.7 var(--text); max-width: 60ch; }
.tagline { font-size: .78rem; color: var(--dim); }
.tags { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  font-size: .72rem;
  padding: .3rem .55rem;
  border-radius: 4px;
  color: var(--key);
  background: rgba(121, 184, 255, .08);
  border: 1px solid rgba(121, 184, 255, .22);
}

/* Incident replay */
.log { list-style: none; margin: 0; padding: 1.1rem 1.1rem .9rem; display: grid; gap: .55rem; font-size: .84rem; }
.log li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.log__t { color: var(--dim); }
.log__lvl { font-weight: 700; min-width: 7.5ch; }
.lvl-in { color: var(--key); }
.lvl-co { color: var(--type); }
.lvl-al { color: var(--warn); }
.lvl-ok { color: var(--ok); }
.lvl-rv { color: var(--str); }
.log__end { grid-template-columns: auto minmax(0, 1fr) !important; color: var(--ok); padding-top: .5rem; border-top: 1px dashed var(--line-2); }

.js.motion .log li { opacity: 0; transform: translateY(6px); transition: opacity .55s var(--ease), transform .7s var(--ease); }
.js.motion .log li.on { opacity: 1; transform: none; }

/* ---------- Git log ---------- */
.git { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line-2); display: grid; gap: 1.75rem; }
.commit { position: relative; }
.commit::before {
  content: '';
  position: absolute;
  left: calc(-1.4rem - 7px);
  top: .35rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--dim);
}
.commit--head::before { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 0 4px rgba(61, 220, 151, .18); }
.commit__meta { color: var(--dim); font-size: .8rem; }
.ref { color: var(--on-ok); background: var(--ok); padding: .1rem .45rem; border-radius: 3px; font-weight: 700; margin-right: .4rem; }
.commit__msg { font: 800 clamp(1.1rem, 2vw, 1.45rem)/1.3 var(--mono); letter-spacing: -.02em; margin-top: .35rem; }
.commit__sub { color: var(--dim); font-size: .8rem; margin-top: .25rem; }
.diff { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .45rem; }
.diff li { position: relative; padding-left: 1.5rem; font: 400 .95rem/1.6 var(--text); max-width: 70ch; }
.diff li::before { content: '+'; position: absolute; left: .2rem; color: var(--ok); font: 700 .95rem var(--mono); }

.cmd--sub { margin: 2rem 0 1rem; }
.tagsx { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.tagsx li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.tagx {
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  color: var(--str);
  border: 1px solid rgba(230, 192, 123, .4);
  border-radius: 3px;
  padding: .25rem 0;
  margin-top: .4rem;
}

/* ---------- Firewall table ---------- */
.table-wrap { overflow-x: auto; }
.fw { width: 100%; border-collapse: collapse; font-size: .86rem; }
.fw th, .fw td { text-align: left; vertical-align: top; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.fw thead th { color: var(--dim); font-size: .7rem; letter-spacing: .12em; font-weight: 700; background: rgba(18, 24, 33, .6); }
.fw tbody th { color: var(--key); font-weight: 700; white-space: nowrap; }
.fw__id { color: var(--dim); font-variant-numeric: tabular-nums; width: 4ch; }
.fw tbody tr { transition: background-color .2s var(--ease); }
.fw tbody tr:hover { background: var(--panel-2); }
.act { display: inline-block; font-weight: 800; font-size: .72rem; letter-spacing: .08em; padding: .2rem .5rem; border-radius: 3px; }
.act--ok { color: var(--on-ok); background: var(--ok); }
.act--deny { color: #1a0505; background: var(--deny); }
.mem { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.mem li {
  font-size: .76rem;
  line-height: 1.3;
  padding: .2rem .5rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--fg);
  background: rgba(18, 24, 33, .6);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.fw tbody tr:hover .mem li { border-color: rgba(61, 220, 151, .35); }
.fw__deny td, .fw__deny th { color: var(--dim); border-bottom: 0; }
.fw__deny th { color: var(--deny); }

/* ---------- Homelab ---------- */
.sec__lede { font: 400 1.02rem/1.65 var(--text); color: var(--fg); max-width: 70ch; margin: -.5rem 0 1.5rem; }
.sec__lede .c { font-family: var(--mono); font-size: .82rem; }
.lab { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.lab__side { display: grid; gap: 1.25rem; min-width: 0; }

/* Defense in depth: each layer steps inward, shading from perimeter (red) to core (green) */
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.layers li {
  --tone: color-mix(in oklab, var(--deny) calc(100% - var(--l) * 16.6%), var(--ok));
  display: grid;
  grid-template-columns: 2rem 6.2rem minmax(0, 1fr);
  gap: .6rem;
  align-items: baseline;
  margin-inline: calc(var(--l) * .7rem) 0;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--tone) 9%, transparent), transparent 70%);
  font-size: .84rem;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.layers li:hover { border-color: var(--tone); }
.layers li:nth-child(1) { --l: 0; } .layers li:nth-child(2) { --l: 1; } .layers li:nth-child(3) { --l: 2; }
.layers li:nth-child(4) { --l: 3; } .layers li:nth-child(5) { --l: 4; } .layers li:nth-child(6) { --l: 5; }
.layers li:nth-child(7) { --l: 6; }
.layer__id { color: var(--tone); font-weight: 800; }
.layer__name { color: var(--key); font-weight: 700; }
.layer__items { color: var(--fg); }
.lab__sum { margin-top: 1rem; font-size: .78rem; }

.which { margin: .75rem 0 0; display: grid; gap: .55rem; }
.which div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.which dt { color: var(--ok); font-weight: 700; }
.which dd { margin: 0; font: 400 .92rem/1.55 var(--text); color: var(--fg); }
.which dd .c { font-family: var(--mono); font-size: .78rem; }

/* ---------- Verify report ---------- */
.vfy { list-style: none; margin: 1rem 0 0; padding: 0; }
.vfy li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 7rem 11rem;
  gap: 1rem;
  align-items: baseline;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.vfy li > * { transition: transform .25s var(--ease); }
.vfy li:hover > * { transform: translateX(4px); }
.st { font-weight: 800; font-size: .74rem; letter-spacing: .06em; white-space: nowrap; }
.st--ok { color: var(--ok); }
.st--warn { color: var(--warn); }
.vfy__name { color: var(--fg); overflow-wrap: anywhere; }
.vfy__link {
  text-decoration: underline;
  text-decoration-color: rgba(61, 220, 151, .35);
  text-decoration-style: dotted;
  text-underline-offset: .25em;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.vfy__link:hover { color: var(--ok); text-decoration-color: var(--ok); text-decoration-style: solid; }
.vfy__ext { color: var(--ok); font-size: .85em; }
.vfy__exp { margin-top: 1rem; font-size: .8rem; line-height: 1.9; color: var(--dim); }
.vfy__exp .st { margin-right: .5rem; }
.vfy__exp .vfy__link { color: var(--dim); }
.vfy__exp .vfy__link:hover { color: var(--ok); }

/* Inline text links (e.g. thesis → homelab) */
.inl { color: var(--ok); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: .2em; }
.inl:hover { text-decoration-style: solid; }
.vfy--exp .vfy__name { color: var(--dim); }
.vfy__by { color: var(--key); }
.vfy__when { color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.vfy__sum { margin-top: 1rem; color: var(--dim); font-size: .85rem; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(3rem, 7vw, 5rem); }
.contact__body { display: grid; gap: 1.5rem; }
.contact__src { font-size: .88rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.contact__big {
  font: 800 clamp(2.2rem, 8vw, 6.5rem)/1 var(--mono);
  letter-spacing: -.05em;
  text-transform: uppercase;
}
.contact__big .cursor { height: .85em; vertical-align: baseline; }

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; place-items: center; padding: var(--gutter); }
.notfound .win { width: min(46rem, 100%); }
.notfound__h { font: 800 clamp(1.4rem, 4vw, 2.4rem)/1.15 var(--mono); color: var(--deny); letter-spacing: -.02em; margin: .3em 0; }

/* ---------- Status bar footer ---------- */
.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 calc(-1 * var(--gutter));
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  font-size: .72rem;
  color: var(--dim);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sb { padding: .45rem .9rem; border-right: 1px solid var(--line); text-decoration: none; }
.sb--ok { background: var(--ok); color: var(--on-ok); font-weight: 700; border-right: 0; }
.sb--grow { margin-left: auto; border-left: 1px solid var(--line); }
a.sb:hover { color: var(--fg); background: var(--panel); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .split, .proj, .lab { grid-template-columns: minmax(0, 1fr); }
  .proj--alt .proj__text { order: 0; }
  .split { max-width: 62rem; }
}

@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .tree {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    padding: calc(env(safe-area-inset-top, 0px) + .5rem) var(--gutter) .5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .tree__title { display: none; }
  .tree__root { display: none; }
  .tree nav { min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
  .tree nav::-webkit-scrollbar { display: none; }
  .tree__list { display: flex; padding: 0; gap: .15rem; }
  .tree__list a { white-space: nowrap; padding: .45rem .55rem; font-size: .78rem; }
  .flags { margin: 0; padding: 0; border: 0; display: flex; gap: .5rem; }
  .flag__k { display: none; }
  /* No room for the "--motion" key: show the word itself; the button state shows on/off */
  #motion-toggle .on-txt, #motion-toggle .off-txt { display: none !important; }
  #motion-toggle .sr-only { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; }
  .split, .proj { grid-template-columns: 1fr; }
  .proj--alt .proj__text { order: 0; }
  .vfy li { grid-template-columns: 7.5rem minmax(0, 1fr) 10rem; }
  .vfy__by { display: none; }
}

@media (max-width: 640px) {
  .tree__list .ic { display: none; }
  .hero { min-height: calc(100svh - 3.25rem); }
  .status { font-size: .8rem; }
  .vfy li { grid-template-columns: 1fr; gap: .15rem; }
  .vfy__when { text-align: left; }
  .log li { grid-template-columns: auto minmax(0, 1fr); }
  .log__t { display: none; }
  .fw thead { display: none; }
  .fw, .fw tbody, .fw tr, .fw td, .fw th { display: block; width: auto; }
  .fw tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .fw td, .fw th { padding: .15rem 0; border: 0; }
  .fw tbody th { white-space: normal; }
  .fw__id { display: none !important; }
  .tagsx li { grid-template-columns: 1fr; gap: .4rem; }
  .layers li { margin-inline: 0; grid-template-columns: 2.2rem minmax(0, 1fr); row-gap: .15rem; }
  .layer__items { grid-column: 2; }
  .which div { grid-template-columns: 1fr; gap: .1rem; }
  .tagx { justify-self: start; padding: .2rem .5rem; }
  .sb--grow { margin-left: 0; border-left: 0; }
}

@media (pointer: fine) { html { overscroll-behavior: none; } }

/* ---------- Motion off (via the --motion toggle; motion is on by default) ---------- */
:root:not(.motion) { scroll-behavior: auto; }

/* ---------- Reduced-motion visitors: motion stays on, but calmer ----------
   Continuous effects stop (scan line, cursor blink); reveals keep their fade but lose the movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion .term::after { animation: none; opacity: 0; }
  .motion .cursor { animation: none; }
  .js.motion .t--name { transform: none; }
  .js.motion .status .t, .js.motion .fade, .js.motion .tree { transform: none; }
  @keyframes slide-in { to { opacity: 1; } }
  @keyframes fade-up { to { opacity: 1; } }
  @keyframes tree-in { from { opacity: 0; } to { opacity: 1; } }
  .js.motion .reveal, .js.motion .log li,
  .js.motion .reveal :is(.vfy > li, .fw tbody tr, .git > li, .tagsx > li, .diff > li, .tags > li, .layers > li, .which > div) { transform: none; }
  .btn:hover { transform: none; }
}

/* ==========================================================================
   PRINT: light, compact CV
   ========================================================================== */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root {
    --bg: #fff; --panel: #fff; --panel-2: #fff; --fg: #111; --dim: #555;
    --line: #d6d6d6; --line-2: #c4c4c4; --ok: #0f7a4f; --warn: #a05a00; --key: #1d4f91; --str: #6b4f00; --type: #6b3fa0; --deny: #b42318;
    color-scheme: light;
  }
  html, body { background: #fff !important; color: #111; font-size: 9.5pt; line-height: 1.45; }
  .app { display: block; }
  .no-print, .skip, .tree, .win__bar, .term::after, .cursor, .ctas, .statusbar, .contact, .win__note, .cmd:has(.cursor) { display: none !important; }
  .print-only { display: block; }
  .t, .fade, .reveal, .log li, .reveal *, .tree { opacity: 1 !important; transform: none !important; clip-path: none !important; animation: none !important; transition: none !important; }
  main { padding: 0; }
  .win { border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .hero { min-height: 0; padding: 0 0 5mm; display: block; }
  .term__body { padding: 0; gap: 1mm; }
  .hero__name { font-size: 26pt; text-shadow: none; margin: 1mm 0 2mm; }
  .hero__name span { text-shadow: none; }
  .hero__below { gap: 2mm; margin-top: 3mm; padding-top: 3mm; border-top: 1px solid #ccc; }
  .lede { font-size: 10pt; color: #222; max-width: none; }
  .meta { font-size: 8pt; }
  .print-contact { font-size: 8.5pt; color: #333; }
  .sec { padding-top: 6mm; break-inside: auto; }
  .sec__h { font-size: 12pt; margin-bottom: 2mm; padding-bottom: 1mm; border-bottom: 1px solid #bbb; }
  .split { display: block; }
  .split .win + .win { display: none; }
  .code { padding: 0; overflow: visible; }
  .code--prose p:not(.md-h) { font-size: 9.5pt; max-width: none; }
  .md-h { font-size: 10.5pt; }
  .proj { display: block; padding: 2mm 0; border-top: 0; break-inside: avoid; }
  .proj__text { gap: 1.5mm; }
  .proj__text h3 { font-size: 11.5pt; }
  .proj__text p:not(.tagline) { font-size: 9.5pt; max-width: none; }
  .tags li { font-size: 7pt; padding: .5mm 1.5mm; background: none; }
  .git { gap: 3mm; padding-left: 4mm; }
  .commit::before { left: calc(-4mm - 6px); }
  .commit { break-inside: avoid; }
  .commit__msg { font-size: 11pt; }
  .diff li { font-size: 9pt; }
  .cmd--sub { margin: 4mm 0 2mm; }
  .fw { font-size: 8.5pt; }
  .fw th, .fw td { padding: 1.5mm 2mm; }
  .fw thead th { background: none; }
  .act { background: none !important; color: var(--ok) !important; padding: 0; }
  .mem { display: block; }
  .mem li { display: inline; padding: 0; border: 0; background: none; font-size: 8.5pt; }
  .mem li + li::before { content: '· '; color: #888; }
  .mem li { margin-right: .35em; }
  .status, .cmd--status { display: none !important; }
  .proj { break-inside: auto; }
  .proj__text h3, .sec__h, .sec__lede { break-after: avoid; }
  .sec .win { break-before: avoid; }
  .lab__side { margin-top: 4mm; }
  .vfy__link { text-decoration: none; }
  .vfy__ext, .vfy__hint { display: none; }
  .vfy__exp { font-size: 8pt; line-height: 1.5; margin-top: 2mm; }
  .vfy__exp .vfy__link { color: #444; }
  .vfy__sum .c { display: none; }
  .inl { color: inherit; text-decoration: none; }
  .act--deny { color: var(--deny) !important; }
  .lab { display: block; }
  .lab__side .win:last-child { display: none; }
  .layers li { margin: 0; padding: 1mm 0; border: 0; background: none; font-size: 8.5pt; grid-template-columns: 8mm 24mm 1fr; break-inside: avoid; }
  .lab__sum { font-size: 8pt; }
  .which div { grid-template-columns: 22mm 1fr; }
  .which dd { font-size: 9pt; }
  .sec__lede { font-size: 9.5pt; margin: 0 0 2mm; }
  .vfy li { grid-template-columns: 18mm 1fr 20mm 36mm; padding: 1mm 0; font-size: 8.5pt; break-inside: avoid; }
  .vfy__by { display: block; }
  a[href^="http"]::after { content: ''; }
}
