/* criobits.com — handmade, no framework */

@font-face { font-family: "Adventor"; font-weight: 400; font-display: swap; src: url("../fonts/adventor-regular.woff2") format("woff2"); }
@font-face { font-family: "Adventor"; font-weight: 700; font-display: swap; src: url("../fonts/adventor-bold.woff2") format("woff2"); }

:root {
  --page: #0b0806;
  --bg: #0b0806;
  --bg-2: #17110d;
  --panel: rgba(13, 11, 10, .93);
  --side: rgba(24, 20, 17, .92);
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f6f1eb;
  --muted: #a69d94;
  --accent: #ff8a3d;
  --accent-2: #ff5a1f;
  --accent-ink: #1c0d03;
  --ok: #5fd38d;
  --warn: #ffc24a;
  --glow: rgba(255, 122, 40, .22);
  --shadow: 0 40px 100px -40px rgba(0, 0, 0, .9);
  --bits: 255, 236, 220;
  --bits-frost: 255, 146, 66;

  --font: "Adventor", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --radius: 18px;
  --app-h: min(100%, 880px);
}
:root[data-theme="light"] {
  --page: #ff7a33;
  --bg: #ffffff;
  --bg-2: #fff4ec;
  --panel: rgba(255, 255, 255, .96);
  --side: rgba(252, 248, 244, .98);
  --surface: rgba(255, 255, 255, .9);
  --surface-2: #ffffff;
  --line: rgba(40, 22, 10, .1);
  --line-strong: rgba(40, 22, 10, .2);
  --text: #1a120c;
  --muted: #6e6259;
  --accent: #c64a00;
  --accent-2: #ff6a1f;
  --accent-ink: #1c0d03;
  --ok: #15803d;
  --warn: #a15c07;
  --glow: rgba(255, 106, 31, .16);
  --shadow: 0 40px 90px -40px rgba(120, 40, 0, .45);
  --bits: 60, 36, 20;
  --bits-frost: 230, 90, 10;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text); overflow: hidden;
  font-family: var(--font); font-size: 16.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }
.caret { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- backdrop: technical grid + spotlight that follows the cursor ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(520px circle at var(--px, 30%) var(--py, 30%), rgba(255, 122, 40, .30), transparent 70%),
    radial-gradient(60% 50% at 100% 100%, rgba(255, 90, 31, .14), transparent 70%),
    #0b0806;
}
[data-theme="light"] .backdrop::before {
  background:
    radial-gradient(520px circle at var(--px, 30%) var(--py, 30%), rgba(255, 255, 255, .45), transparent 70%),
    linear-gradient(160deg, #ff8a3d, #ff5f2b);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask: radial-gradient(90% 80% at 50% 50%, #000 40%, transparent 100%); mask: radial-gradient(90% 80% at 50% 50%, #000 40%, transparent 100%);
}
[data-theme="light"] .backdrop::after {
  background:
    linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px) 0 0 / 44px 44px;
}

/* ---------- stage ---------- */
.stage {
  height: 100svh; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: clamp(14px, 4vh, 46px) clamp(14px, 2.6vw, 40px);
}
.app {
  height: var(--app-h); min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr);
  border-radius: 30px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  background: var(--panel); backdrop-filter: blur(22px) saturate(1.3);
  animation: app-in 1s var(--ease) both;
}
@keyframes app-in { from { opacity: 0; transform: translateY(26px) scale(.985); } }

/* ---------- sidebar ---------- */
.side {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
  padding: clamp(28px, 5vh, 48px) 26px 24px; background: var(--side); border-right: 1px solid var(--line);
  overflow-y: auto; scrollbar-width: none;
}
.emblem { position: relative; width: 140px; height: 140px; flex: none; }
.emblem::before { /* dotted halo, like a frosted print */
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, var(--line-strong) 1.1px, transparent 1.6px) 0 0 / 9px 9px;
  -webkit-mask: radial-gradient(circle at 75% 80%, #000 0 35%, transparent 62%); mask: radial-gradient(circle at 75% 80%, #000 0 35%, transparent 62%);
}
.emblem-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 28%, var(--accent-2) 52%, transparent 78%, var(--accent));
  animation: spin 9s linear infinite; box-shadow: 0 0 40px -6px var(--glow);
}
.emblem-core {
  position: absolute; inset: 4px; border-radius: 50%; overflow: hidden; display: block;
  background: var(--bg-2); box-shadow: inset 0 0 0 3px var(--side);
}
.emblem-core img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; transition: transform .8s var(--ease); }
.emblem:hover .emblem-core img { transform: scale(1.06); }
.side-id { display: grid; gap: 4px; }
.side-name { margin: 0; font-size: 27px; line-height: 1.1; letter-spacing: -.02em; }
.side-name strong { color: var(--accent); }
.side-role { margin: 0; color: var(--muted); font-size: 14.5px; }
.side-status {
  justify-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0;
  padding: 5px 12px; border-radius: 999px; font-size: 11.5px; color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: ping 2.2s var(--ease) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.socials { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.socials a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line); transition: color .25s, border-color .25s, transform .3s var(--spring);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }
.side-tools { display: flex; gap: 8px; }
.tool {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 11px; cursor: pointer;
  display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  transition: border-color .25s, transform .25s var(--ease), background-color .3s;
}
.tool:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tool svg { width: 17px; height: 17px; grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s; }
.i-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
[data-theme="light"] .i-sun { opacity: 1; transform: none; }
[data-theme="light"] .i-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
.side-foot { margin-top: auto; display: grid; gap: 3px; font-size: 11px; color: var(--muted); opacity: .8; }

/* ---------- buttons ---------- */
.btn {
  --tx: 0px; --ty: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px;
  border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; border: 0; white-space: nowrap;
  transform: translate(var(--tx), var(--ty)); transition: transform .35s var(--ease), box-shadow .35s, background-color .3s, border-color .3s, color .3s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(120deg, #ffa257, #ff5a1f); color: var(--accent-ink); box-shadow: 0 12px 34px -12px var(--accent-2); }
.btn-primary:hover { box-shadow: 0 16px 44px -10px var(--accent-2); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-outline { background: transparent; border: 1.5px solid var(--text); color: var(--text); height: 44px; }
.btn-outline:hover { background: var(--text); color: var(--bg); }

/* ---------- panel & pages ---------- */
.panel { position: relative; min-width: 0; overflow: hidden; outline: none; --dir: 1; }
.page {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  opacity: 0; visibility: hidden; transform: translateX(calc(var(--dir) * 46px));
  transition: opacity .45s var(--ease), transform .7s var(--ease), visibility 0s linear .7s;
}
.page.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease) .12s, transform .8s var(--ease) .08s, visibility 0s; }
.page.is-leaving { transform: translateX(calc(var(--dir) * -46px)); }
.page-inner { padding: clamp(34px, 6vh, 62px) clamp(24px, 4.6vw, 64px) 56px; max-width: 980px; }

.js .page .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.js .page.is-active .reveal { opacity: 1; transform: none; transition-delay: calc(var(--d, 0s) + .18s); }

.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }
.title { margin: 0; font-size: clamp(1.9rem, 3.6vw, 3.1rem); line-height: 1.05; letter-spacing: -.025em; font-weight: 700; max-width: 20ch; }
.lead { margin: 16px 0 0; max-width: 620px; color: var(--muted); font-size: 17px; }

/* home */
.page-home { display: grid; place-items: center; text-align: center; overflow: hidden; }
.bits { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-home::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(52% 46% at 50% 50%, color-mix(in srgb, var(--bg) 88%, transparent), transparent 80%);
}
.home-inner { position: relative; padding: 40px 28px; max-width: 760px; }
.kicker { color: var(--accent); font-size: 13.5px; letter-spacing: .04em; margin: 0 0 16px; }
.hero-name { margin: 0; font-weight: 400; line-height: .92; letter-spacing: -.035em; font-size: clamp(3rem, 7.4vw, 6.6rem); }
.hero-name strong {
  display: inline-block; font-weight: 700;
  background: linear-gradient(100deg, var(--text) 0%, var(--accent) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { margin: 22px 0 0; font-size: clamp(15px, 1.7vw, 19px); }
.role-prefix { color: var(--accent); }
.hero-lead { max-width: 540px; margin: 16px auto 0; color: var(--muted); font-size: clamp(15.5px, 1.4vw, 17.5px); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 34px; align-items: start; margin-top: 6px; }
.about-paragraphs p { margin: 18px 0 0; color: var(--muted); }
.about-paragraphs p:first-child { color: var(--text); font-size: 18.5px; }
.facts {
  margin: 24px 0 0; padding: 20px 22px; border-radius: var(--radius); font-size: 13px; line-height: 1.75; white-space: pre-wrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); overflow-x: auto;
}
.facts .k { color: var(--accent); } .facts .s { color: var(--ok); } .facts .p { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 34px 0 0; }
.stat { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat dt { font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat dt span { color: var(--accent); }
.stat dd { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* terminal */
.term {
  margin-top: 30px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-strong);
  background: #0d0a08; color: #f6f1eb; box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .8);
  --muted: #a69d94; --accent: #ff8a3d; --accent-2: #ff5a1f; --ok: #5fd38d; --warn: #ffc24a; --text: #f6f1eb;
}
.term-bar { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: #a69d94; }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.term-status { margin-left: auto; opacity: .7; }
.term-body { height: clamp(250px, 40vh, 380px); overflow-y: auto; padding: 16px 20px 20px; font-size: 14px; line-height: 1.65; scrollbar-width: thin; cursor: text; }
.term-out > div { white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { color: var(--text); margin-top: 10px; }
.term-out .cmd::before { content: "filippo@criobits:~$ "; color: var(--accent); }
.term-out .muted { color: var(--muted); }
.term-out .ok { color: var(--ok); }
.term-out .warn { color: var(--warn); }
.term-out a { color: var(--accent); }
.term-out .grid { display: grid; grid-template-columns: max-content 1fr; gap: 2px 22px; }
.term-out .ascii { color: var(--accent); line-height: 1.15; font-size: 12px; margin: 4px 0 10px; }
.term-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.prompt { color: var(--accent); white-space: nowrap; }
.term-line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: inherit; font: inherit; caret-color: var(--accent); padding: 0; }
.term-line input::placeholder { color: var(--muted); opacity: .6; }
.term-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.term-suggest button {
  font-family: var(--mono); font-size: 12.5px; padding: 7px 12px; border-radius: 9px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s, transform .2s;
}
.term-suggest button:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }

/* career spec */
.spec { margin-top: 30px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.spec-head { display: flex; justify-content: space-between; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.spec-head .file { color: var(--text); }
.spec-head .run { color: var(--warn); }
.spec-head .run.done { color: var(--ok); }
.spec-body { padding: 6px 22px 4px; font-size: 14px; }
.suite { padding: 16px 0 14px; border-bottom: 1px dashed var(--line); }
.suite:last-child { border-bottom: 0; }
.suite-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.suite-head .kw { color: var(--accent-2); }
.suite-head .company { color: var(--text); font-family: var(--font); font-weight: 700; font-size: clamp(17px, 2vw, 21px); letter-spacing: -.01em; }
.suite-head .role { color: var(--accent); font-family: var(--font); font-size: 15px; }
.suite-head .when { margin-left: auto; color: var(--muted); font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.tests { list-style: none; margin: 10px 0 0; padding: 0 0 0 4px; }
.test { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 3px 0; color: var(--muted); }
.test .st { width: 16px; height: 16px; border-radius: 50%; border: 1.6px solid var(--line-strong); border-top-color: var(--warn); }
.spec.running .test:not(.pass) .st { animation: spin .8s linear infinite; }
.test .ms { font-size: 11.5px; opacity: 0; transition: opacity .3s; }
.test.pass { color: var(--text); }
.test.pass .st { border: 0; background: var(--ok); display: grid; place-items: center; animation: pop .4s var(--ease); }
.test.pass .st::after { content: ""; width: 7px; height: 4px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.test.pass .ms { opacity: .55; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
.edu-line { padding: 14px 0 8px; color: var(--muted); font-size: 13px; }
.edu-line b { color: var(--accent-2); font-weight: 400; }
.spec-foot { padding: 13px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); min-height: 46px; }
.spec-foot .ok { color: var(--ok); font-weight: 700; }

/* skills */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.filters button {
  font-size: 13.5px; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--muted); transition: all .3s var(--ease);
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.skill-cloud { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 11px; }
.skill {
  --mx: 50%; --my: 50%;
  position: relative; padding: 13px 19px; border-radius: 14px; font-size: clamp(15px, 1.5vw, 18px);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .55s var(--ease), filter .5s, border-color .3s;
}
.page.is-active .skill { opacity: 1; transform: none; transition-delay: calc(var(--d, 0s) + .2s), calc(var(--d, 0s) + .2s), 0s, 0s; }
.page.is-active .skill.off { opacity: .16; transform: scale(.94); filter: blur(1px); transition-delay: var(--d2, 0s); }
.skill::before { content: ""; position: absolute; inset: 0; background: radial-gradient(140px circle at var(--mx) var(--my), var(--glow), transparent 70%); opacity: 0; transition: opacity .3s; }
.skill:hover { border-color: var(--line-strong); }
.skill:hover::before { opacity: 1; }
.skill span { position: relative; }

/* certs */
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 30px; perspective: 1200px; }
.cert {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; padding: 26px; border-radius: 22px; overflow: hidden; min-height: 236px;
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
}
.js .page .cert.reveal { transform: translateY(18px) rotateX(var(--rx)) rotateY(var(--ry)); }
.js .page.is-active .cert.reveal { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.cert.tilting { transition: transform .08s linear, border-color .3s !important; transition-delay: 0s !important; }
.cert:hover { border-color: var(--line-strong); }
.cert::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; mix-blend-mode: screen;
  background:
    radial-gradient(260px circle at var(--mx) var(--my), rgba(255,255,255,.16), transparent 65%),
    linear-gradient(115deg, transparent 20%, rgba(255,200,140,.18) 35%, rgba(255,110,40,.15) 50%, rgba(255,230,170,.12) 62%, transparent 78%);
  background-size: 100% 100%, 220% 220%;
  background-position: center, var(--mx) var(--my);
}
[data-theme="light"] .cert::before { mix-blend-mode: multiply; }
.cert:hover::before { opacity: 1; }
.cert-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cert-code { font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.badge.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge.pending { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.done::before { content: ""; width: 7px; height: 4px; border: solid currentColor; border-width: 0 0 1.8px 1.8px; transform: translateY(-1px) rotate(-45deg); }
.badge.pending::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.cert-name { margin: 6px 0 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.cert-org { color: var(--accent); font-size: 14.5px; }
.cert ul { list-style: none; margin: 4px 0 0; padding: 0; color: var(--muted); font-size: 14px; }
.cert li::before { content: "— "; color: var(--line-strong); }
.cert-foot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.cert-foot a { color: var(--accent); font-weight: 700; text-decoration: none; font-family: var(--font); font-size: 14px; }
.cert-foot a:hover { text-decoration: underline; }
.meter { position: relative; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; width: 100%; }
.meter::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--warn), transparent); animation: scan 2.2s var(--ease) infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* projects */
.project-list { margin-top: 28px; border-top: 1px solid var(--line); }
.project {
  --mx: 50%;
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px 26px; align-items: start;
  padding: 28px 6px; border-bottom: 1px solid var(--line); isolation: isolate;
}
.project::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .45s var(--ease);
  background: radial-gradient(420px 200px at var(--mx) 50%, var(--glow), transparent 70%);
}
.project:hover::before { opacity: 1; }
.p-index { font-family: var(--mono); color: var(--muted); font-size: 12.5px; padding-top: 8px; }
.p-kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.p-title { margin: 6px 0 0; font-size: clamp(23px, 2.8vw, 34px); line-height: 1.06; letter-spacing: -.025em; transition: transform .5s var(--ease); }
.project:hover .p-title { transform: translateX(8px); }
.p-desc { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags span { font-family: var(--mono); font-size: 11.5px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); }

/* contact */
.page-contact .page-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.mega { margin: 0; font-size: clamp(3.2rem, 9vw, 7.6rem); line-height: .92; letter-spacing: -.045em; font-weight: 700; }
.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 34px; }
.mail {
  font-size: clamp(18px, 2.8vw, 30px); text-decoration: none; color: var(--text); word-break: break-all;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0% 2px no-repeat; padding-bottom: 4px; transition: background-size .6s var(--ease), color .3s;
}
.mail:hover { background-size: 100% 2px; color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 999px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: border-color .25s, transform .25s var(--ease); }
.pill:hover { border-color: var(--accent); transform: translateY(-2px); }
.pill svg { width: 18px; height: 18px; color: var(--accent); }

/* ---------- rail (icon nav + arrows) ---------- */
.rail { height: var(--app-h); display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 16px; animation: app-in 1s var(--ease) .15s both; }
.rail-nav, .rail-arrows {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px;
  border-radius: 999px; background: var(--side); border: 1px solid var(--line-strong); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.rail-nav a, .rail-arrows button {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; transition: color .3s;
}
.rail-nav a:hover, .rail-arrows button:hover { color: var(--text); }
.rail-nav a.active { color: var(--accent); }
.rail-nav svg, .rail-arrows svg { width: 21px; height: 21px; }
.rail-nav a::after { /* tooltip */
  content: attr(data-label); position: absolute; right: calc(100% + 14px); top: 50%; translate: 6px -50%;
  padding: 6px 11px; border-radius: 9px; white-space: nowrap; font-size: 13px; font-weight: 700;
  background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .2s, translate .3s var(--ease);
}
.rail-nav a:hover::after, .rail-nav a:focus-visible::after { opacity: 1; translate: 0 -50%; }
.rail-glider {
  position: absolute; left: 9px; top: 9px; width: 44px; height: 44px; border-radius: 50%; z-index: 0;
  background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translate(var(--gx, 0px), var(--gy, 0px)); transition: transform .55s var(--spring);
}
.counter { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; padding: 2px 0; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 80; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700;
  transition: opacity .35s, transform .45s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 250px minmax(0, 1fr); }
  .emblem { width: 116px; height: 116px; }
  .about { grid-template-columns: 1fr; gap: 0; }
}
@media (max-height: 760px) and (min-width: 901px) {
  .side { gap: 14px; }
  .emblem { width: 100px; height: 100px; }
}
@media (max-width: 900px) {
  .stage { display: block; padding: 0; height: 100svh; }
  .app { height: 100svh; border-radius: 0; border: 0; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .side {
    flex-direction: row; text-align: left; gap: 12px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
    border-right: 0; border-bottom: 1px solid var(--line); overflow: visible;
  }
  .emblem { width: 46px; height: 46px; }
  .emblem::before, .side-status, .socials, .side-foot { display: none; }
  .emblem-ring { inset: 0; }
  .emblem-core { inset: 2px; box-shadow: none; }
  .side-id { flex: 1; min-width: 0; gap: 0; }
  .side-name { font-size: 17px; }
  .side-role { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail {
    position: fixed; z-index: 40; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    height: auto; animation: none;
  }
  .rail-nav { flex-direction: row; padding: 6px; gap: 0; }
  .rail-nav a { width: 40px; height: 40px; }
  .rail-nav svg { width: 19px; height: 19px; }
  .rail-nav a::after { display: none; }
  .rail-glider { left: 6px; top: 6px; width: 40px; height: 40px; }
  .rail-arrows { display: none; }
  .page-inner { padding: 26px 18px 110px; }
  .home-inner { padding-bottom: 90px; }
  .stats { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; padding: 24px 0; }
  .p-index { padding-top: 0; }
  .term-status { display: none; }
  .term-body { padding: 14px; font-size: 13px; }
  .suite-head .when { margin-left: 0; }
  .test { grid-template-columns: 20px 1fr; }
  .test .ms { display: none; }
  .toast { bottom: 84px; }
}
@media (max-width: 380px) {
  .side-tools .tool { min-width: 32px; height: 32px; padding: 0 7px; }
  .rail-nav a { width: 37px; height: 37px; }
  .rail-glider { width: 37px; height: 37px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}

[data-theme="light"] .app, [data-theme="light"] .rail-nav, [data-theme="light"] .rail-arrows { border-color: rgba(255, 255, 255, .7); }

