/* ==========================================================================
   Fabricio Velasquez — portfolio
   Tres temas (dusk, frost, daylight). Se elige en content/site.js → theme.
   Para probar uno sin editar nada, abre el sitio con ?theme=frost al final de la dirección.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root, [data-theme="dusk"] {
  --bg: #161C25;            --bg-rgb: 22, 28, 37;
  --fg: #ECE6DA;            --fg-rgb: 236, 230, 218;
  --muted: #9AA4B1;
  --accent: #D9B382;        --accent-rgb: 217, 179, 130;
  --on-accent: #161C25;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(22, 28, 37, .5);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .14);
  --field: rgba(255, 255, 255, .04);
  --rule: rgba(255, 255, 255, .09);
  --orb-1: rgba(217, 179, 130, .16);
  --orb-2: rgba(84, 128, 160, .2);
  --blur: 20px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
  --ok: #8FCB9B; --err: #E9907A;
  color-scheme: dark;
}
/* Brand themes, built on the logo green #A9CF38 */
[data-theme="lime"] {
  --bg: #121619;            --bg-rgb: 18, 22, 25;
  --fg: #EEF1EA;            --fg-rgb: 238, 241, 234;
  --muted: #9AA39D;
  --accent: #A9CF38;        --accent-rgb: 169, 207, 56;
  --on-accent: #121619;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(18, 22, 25, .5);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .14);
  --field: rgba(255, 255, 255, .04);
  --rule: rgba(255, 255, 255, .09);
  --orb-1: rgba(169, 207, 56, .10);
  --orb-2: rgba(70, 110, 120, .16);
  --blur: 20px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
  --ok: #A9CF38; --err: #EE8F7A;
  color-scheme: dark;
}
[data-theme="moss"] {
  --bg: #0F1A15;            --bg-rgb: 15, 26, 21;
  --fg: #EDF0E4;            --fg-rgb: 237, 240, 228;
  --muted: #95A595;
  --accent: #A9CF38;        --accent-rgb: 169, 207, 56;
  --on-accent: #0F1A15;
  --glass: rgba(220, 240, 200, .06);
  --glass-strong: rgba(15, 26, 21, .5);
  --glass-border: rgba(220, 240, 200, .14);
  --glass-hi: rgba(255, 255, 255, .14);
  --field: rgba(220, 240, 200, .05);
  --rule: rgba(220, 240, 200, .10);
  --orb-1: rgba(169, 207, 56, .14);
  --orb-2: rgba(216, 190, 140, .10);
  --blur: 20px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
  --ok: #A9CF38; --err: #EE8F7A;
  color-scheme: dark;
}
[data-theme="frost"] {
  --bg: #0D131B;            --bg-rgb: 13, 19, 27;
  --fg: #EAF2F8;            --fg-rgb: 234, 242, 248;
  --muted: #8FA1B3;
  --accent: #A6DCF7;        --accent-rgb: 166, 220, 247;
  --on-accent: #0D131B;
  --glass: rgba(190, 225, 255, .07);
  --glass-strong: rgba(13, 19, 27, .42);
  --glass-border: rgba(190, 225, 255, .2);
  --glass-hi: rgba(255, 255, 255, .28);
  --field: rgba(190, 225, 255, .05);
  --rule: rgba(190, 225, 255, .12);
  --orb-1: rgba(110, 180, 255, .22);
  --orb-2: rgba(150, 130, 255, .16);
  --blur: 26px;
  --shadow: 0 24px 60px -24px rgba(0, 10, 30, .8);
  --ok: #9BE3C1; --err: #F4A1A1;
  color-scheme: dark;
}
[data-theme="daylight"] {
  --bg: #E8E5E0;            --bg-rgb: 232, 229, 224;
  --fg: #1B2028;            --fg-rgb: 27, 32, 40;
  --muted: #5D6571;
  --accent: #A8652F;        --accent-rgb: 168, 101, 47;
  --on-accent: #FFFFFF;
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .62);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-hi: rgba(255, 255, 255, .9);
  --field: rgba(255, 255, 255, .55);
  --rule: rgba(27, 32, 40, .1);
  --orb-1: rgba(214, 160, 110, .4);
  --orb-2: rgba(130, 165, 200, .4);
  --blur: 22px;
  --shadow: 0 24px 50px -28px rgba(40, 30, 20, .35);
  --ok: #2E8B57; --err: #B94A35;
  color-scheme: light;
}

:root {
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --snap: cubic-bezier(.77, 0, .18, 1);
  --line: rgba(var(--fg-rgb), .14);
  --line-strong: rgba(var(--fg-rgb), .32);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 85% 15%, var(--orb-1), transparent 70%),
    radial-gradient(45vw 45vw at 10% 75%, var(--orb-2), transparent 70%);
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--accent); color: var(--on-accent); padding: 8px 14px; text-decoration: none; }
.skip:focus { top: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Shared glass recipes (effects, not boxes) */
.fade-blur { /* blur that dissolves toward one edge */
  position: absolute; pointer-events: none;
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); backdrop-filter: blur(var(--blur)) saturate(1.4);
}
.flute { /* smooth frosted glass */
  -webkit-backdrop-filter: blur(16px) saturate(1.35) brightness(1.05); backdrop-filter: blur(16px) saturate(1.35) brightness(1.05);
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.02) 55%, rgba(255,255,255,.06));
}

/* ---------- Load curtain ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  display: grid; place-items: center;
  background-color: rgba(var(--bg-rgb), .35);
  animation: curtain-off 1.25s var(--snap) .45s forwards;
}
.curtain { gap: 22px; align-content: center; }
.curtain img { width: 64px; height: 64px; animation: mark-in .6s var(--ease) both; }
@keyframes mark-in { from { opacity: 0; transform: scale(.8) rotate(-20deg); } }
.curtain i { width: min(240px, 40vw); height: 1px; background: rgba(var(--fg-rgb), .2); overflow: hidden; position: relative; }
.curtain i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; animation: load .5s var(--ease) forwards; }
@keyframes load { to { transform: scaleX(1); } }
@keyframes curtain-off { to { clip-path: inset(0 0 100% 0); } }
.curtain-done .curtain { display: none; }

/* ---------- Page transition: the page frosts over, then clears ---------- */
.page-veil { position: fixed; inset: 0; z-index: 95; pointer-events: none; visibility: hidden; }
.page-veil span { position: absolute; inset: 0; background-color: rgba(var(--bg-rgb), .55); }
.page-veil.in { visibility: visible; }
.page-veil.in span { animation: veil-in .52s var(--snap) both; }
.page-veil.out { visibility: visible; }
.page-veil.out span { animation: veil-out .6s var(--snap) both; }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes veil-out { from { opacity: 1; } to { opacity: 0; } }
.page-veil.out { animation: veil-hide 0s .6s forwards; }
@keyframes veil-hide { to { visibility: hidden; } }

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 10px rgba(var(--accent-rgb), .8); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 96; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; font-size: 14px; font-weight: 600; color: var(--fg); border: 0; border-radius: 999px;
  background: rgba(var(--bg-rgb), .55); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
.toast.show { animation: toast 2.2s var(--ease) both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }

/* ---------- Magnetic buttons ---------- */
[data-magnet] { translate: var(--mx, 0) var(--my, 0); transition: translate .45s var(--ease), color .35s var(--ease), background .25s, border-color .25s; }

/* ---------- Header: no box, a blur that fades out ---------- */
.topbar {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
}
.topbar .fade-blur { inset: 0 0 -40px 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--bg-rgb), .85), rgba(var(--bg-rgb), .5) 60%, rgba(var(--bg-rgb), 0));
  -webkit-mask: linear-gradient(to bottom, #000 55%, transparent); mask: linear-gradient(to bottom, #000 55%, transparent);
  opacity: 0; transition: opacity .4s;
}
.topbar.is-scrolled .fade-blur, body:not(.on-home) .topbar .fade-blur { opacity: 1; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 50px; height: 50px; flex: none; transition: transform .7s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.06); }
.brand-word { height: 20px; width: auto; display: block; }
[data-theme="daylight"] .brand-word, [data-theme="daylight"] .curtain img { filter: none; }
[data-theme="daylight"] .brand-word { filter: brightness(0) saturate(100%) invert(10%) sepia(9%) saturate(1200%) hue-rotate(180deg); }
[data-theme="daylight"] .on-home .topbar:not(.is-scrolled) .brand-word { filter: none; }
@media (max-width: 600px) { .brand { gap: 10px; } .brand-word { height: 14px; } .brand-mark { width: 38px; height: 38px; } }
.nav { display: flex; gap: clamp(14px, 2.4vw, 34px); align-items: center; }
.nav a {
  position: relative; text-decoration: none; padding: 6px 0; color: var(--muted); font-size: 15px; transition: color .2s;
}
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.on-home .topbar:not(.is-scrolled) .nav a:hover { color: #fff; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-reel, .btn {
  position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  padding: 11px 20px; font-weight: 600; font-size: 15px;
  transition: translate .45s var(--ease), color .35s var(--ease), background .3s, box-shadow .4s, transform .3s var(--ease);
}
.nav-reel::before, .btn::before { /* light sweep on hover */
  content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%); transition: transform .8s var(--ease);
}
.nav-reel:hover, .btn:hover { box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), .9); }
.nav-reel:hover::before, .btn:hover::before { transform: translateX(110%); }
.nav-reel:active, .btn:active { transform: scale(.96); }
.nav-reel svg, .btn svg { width: 11px; height: 11px; }
.btn.solid { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: rgba(var(--fg-rgb), .1); color: var(--fg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@media (max-width: 600px) {
  .nav a[href="#/about"], .nav a[href="#/work"] { display: none; }
}
@media (max-width: 440px) {
  .nav a[href="#/contact"] { display: none; }
}
body:not(.on-home) main { padding-top: 76px; }

/* ---------- Hero ---------- */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1300px; overflow: hidden; background: #0d1015; isolation: isolate; }
.stage-media { position: absolute; inset: 0; z-index: 0; transform: translate3d(0, calc(var(--sy, 0) * 1px), 0); will-change: transform; }
.stage-slide { position: absolute; inset: 0; overflow: hidden; visibility: hidden; z-index: 0; }
.stage-slide.is-active { visibility: visible; z-index: 2; }
.stage-slide.is-out { visibility: visible; z-index: 1; }
.stage-layer { position: absolute; inset: -3%; transform: translate3d(calc(var(--mx, 0) * -16px), calc(var(--my, 0) * -10px), 0); transition: transform 1.2s cubic-bezier(.2, .6, .2, 1); }
.stage-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 10s cubic-bezier(.25, .1, .25, 1), filter 1.2s; }
.stage-slide.is-active img { transform: scale(1); }
.stage-slide.is-out img { filter: brightness(.45) saturate(.6); }
.stage-slide.in-next { animation: wipe-next 1.25s var(--snap) both; }
.stage-slide.in-prev { animation: wipe-prev 1.25s var(--snap) both; }
@keyframes wipe-next { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes wipe-prev { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* Style: dissolve (blurs in through frosted glass) */
.stage-slide.in-dissolve { animation: dissolve 1.6s var(--ease) both; }
@keyframes dissolve { from { opacity: 0; filter: blur(28px) brightness(1.35) saturate(1.4); } }
/* Style: portal (opens from a window in the centre) */
.stage-slide.in-portal { animation: portal 1.35s var(--snap) both; }
.stage-slide.in-portal img { animation: portal-img 1.35s var(--snap) both; }
@keyframes portal { from { clip-path: inset(34% 40% 34% 40%); } to { clip-path: inset(0 0 0 0); } }
@keyframes portal-img { from { transform: scale(1.4); } }
[data-slider="portal"] .stage-slide.is-out img { transform: scale(1.08); transition: transform 1.4s var(--snap), filter 1.2s; }
/* Style: slices (horizontal bands open one after another, top to bottom) */
.stage-slide.in-slices { animation: hold 1.3s steps(1, end) both; }
@keyframes hold { from { opacity: 0; } to { opacity: 1; } }
[data-slider="slices"] .stage-slide img { transform: none; }
.slices { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.slice { position: absolute; left: 0; right: 0; overflow: hidden; animation: slice-in .85s var(--snap) both; animation-delay: calc(var(--k) * 65ms); }
.slice-in { position: absolute; left: 0; right: 0; animation: slice-drift .85s var(--snap) both; animation-delay: calc(var(--k) * 65ms); }
.slice-in img { width: 100%; height: 100%; object-fit: cover; }
@keyframes slice-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.slices.from-left .slice { animation-name: slice-in-l; }
@keyframes slice-in-l { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes slice-drift { from { transform: translateY(-4%); } }

/* Style: fade (soft crossfade) */
.stage-slide.in-fade { animation: fade-in 1.6s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes fade-in { from { opacity: 0; } }
[data-slider="fade"] .stage-slide.is-out img { filter: none; }

/* Style: lens (opens from a glass lens in the centre, with a light ring and colour fringe) */
.stage-slide.in-lens { animation: lens-open 1.5s var(--snap) both; }
.stage-slide.in-lens img { animation: lens-img 1.5s var(--snap) both; }
@keyframes lens-open { from { clip-path: circle(0 at 50% 50%); } to { clip-path: circle(120vmax at 50% 50%); } }
@keyframes lens-img { from { transform: scale(1.35); filter: saturate(1.6) contrast(1.15) drop-shadow(6px 0 0 rgba(255,60,60,.35)) drop-shadow(-6px 0 0 rgba(60,160,255,.35)); } 60% { filter: saturate(1.1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); } }
[data-slider="lens"] .stage-slide.is-out img { transform: scale(.94); transition: transform 1.5s var(--snap), filter 1.2s; }
.lens-ring {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 240vmax; height: 240vmax; margin: -120vmax 0 0 -120vmax;
  border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(0);
  -webkit-backdrop-filter: blur(14px) saturate(1.6) brightness(1.25); backdrop-filter: blur(14px) saturate(1.6) brightness(1.25);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 4vmax), #000 calc(50% - 3.6vmax), #000 calc(50% - .15vmax), transparent 50%);
          mask: radial-gradient(circle, transparent calc(50% - 4vmax), #000 calc(50% - 3.6vmax), #000 calc(50% - .15vmax), transparent 50%);
}
.lens-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), .9), inset 0 0 40px rgba(var(--accent-rgb), .5); }
.lens-ring.go { animation: lens-ring 1.5s var(--snap) both; }
@keyframes lens-ring { 0% { transform: scale(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* Style: wipe (a soft band of frosted glass rides the edge) */
.wipe { position: absolute; top: 0; bottom: 0; left: 100%; z-index: 3; width: clamp(120px, 16vw, 260px); opacity: 0; pointer-events: none;
  -webkit-mask: linear-gradient(to right, transparent, #000 35%, #000 65%, transparent); mask: linear-gradient(to right, transparent, #000 35%, #000 65%, transparent); }
.wipe.go-next { animation: pane-next 1.25s var(--snap) both; }
.wipe.go-prev { animation: pane-prev 1.25s var(--snap) both; }
@keyframes pane-next { 0% { left: 100%; opacity: 1; } 88% { opacity: 1; } 100% { left: 0; opacity: 0; transform: translateX(-100%); } }
@keyframes pane-prev { 0% { left: 0; opacity: 1; transform: translateX(-100%); } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; transform: translateX(0); } }
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.4) 0, transparent 20%), radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0,0,0,.35) 100%);
}
.grain {
  position: absolute; inset: -50%; z-index: 3; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } }

/* HUD: only progress lines + arrows, no text */
.stage-media { cursor: pointer; }
.hud { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; color: #fff; opacity: var(--ui-o, 1); pointer-events: none; }
.hud .fade-blur { inset: -50px 0 0 0;
  background: linear-gradient(to top, rgba(var(--bg-rgb), .55), rgba(var(--bg-rgb), 0));
  -webkit-mask: linear-gradient(to top, #000 40%, transparent); mask: linear-gradient(to top, #000 40%, transparent);
}
.hud-inner {
  position: relative; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(18px, 3vw, 30px);
  display: flex; gap: clamp(14px, 2vw, 28px); align-items: center; pointer-events: auto;
}
.hud-btns { display: flex; flex: none; gap: 10px; align-items: center; }
/* Round frosted-glass buttons, no outlines */
.rd-btn {
  position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0; color: #fff;
  background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  transition: translate .45s var(--ease), background .3s, color .3s, transform .3s var(--ease);
}
.rd-btn:hover { background: rgba(255,255,255,.95); color: #111; }
.rd-btn.timer:hover .ring circle:first-child { stroke: rgba(0,0,0,.08); }
.rd-btn:active { transform: scale(.94); }
.rd-btn > svg:not(.ring) { width: 15px; height: 15px; position: relative; z-index: 1; }
/* Timer: a ring that fills around the next button */
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 2; }
.ring .ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 154; stroke-dashoffset: 154; filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), .8)); }
.ring .ring-fill.run { animation: ring var(--dur, 6.5s) linear forwards; }
.paused .ring .ring-fill.run { animation-play-state: paused; }
@keyframes ring { to { stroke-dashoffset: 0; } }
/* Position: short dashes, the current one stretches */
.segs { flex: 1; list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; align-items: center; }
.segs li { position: relative; }
.segs button { all: unset; box-sizing: border-box; display: block; padding: 14px 0; cursor: pointer; }
.seg-bar { display: block; width: 18px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); transition: width .6s var(--ease), background .4s; }
.segs .is-active .seg-bar { width: 56px; background: #fff; }
.segs button:hover .seg-bar { background: rgba(255,255,255,.8); }
.segs button:focus-visible .seg-bar { box-shadow: 0 0 0 2px var(--accent); }
/* Image-only preview on hover */
.seg-peek {
  position: absolute; bottom: calc(100% + 2px); left: 0; width: 200px;
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none; clip-path: inset(100% 0 0 0);
  transition: opacity .2s, transform .45s var(--ease), clip-path .45s var(--ease);
}
.seg-peek img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); }
.segs button:hover .seg-peek, .segs button:focus-visible .seg-peek { opacity: 1; transform: translate(-50%, 0); clip-path: inset(0 0 0 0); }
.segs li:first-child .seg-peek { left: 0; transform: translate(0, 10px); }
.segs li:last-child .seg-peek { left: auto; right: 0; transform: translate(0, 10px); }
.segs li:first-child button:hover .seg-peek, .segs li:last-child button:hover .seg-peek { transform: translate(0, 0); }
@media (hover: none) { .seg-peek { display: none; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 130px); position: relative; }
.section + .section::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-title { margin: 0; font-size: clamp(40px, 7vw, 108px); line-height: .9; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -.03em; }
.section-title .out { color: transparent; -webkit-text-stroke: 1.2px var(--fg); }
.section-lede { margin: 16px 0 0; color: var(--muted); max-width: 56ch; display: flex; gap: 12px; align-items: baseline; }
.dot { flex: none; width: 8px; height: 8px; background: var(--ok); transform: rotate(45deg) translateY(-1px); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Filters: plain text tabs with a sliding underline */
/* Category filter: large pill buttons */
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters button {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; border: 0; border-radius: 999px;
  padding: 14px 16px 14px 24px; font-size: clamp(16px, 1.35vw, 19px); font-weight: 600; color: var(--fg);
  background: rgba(var(--fg-rgb), .07); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .3s, color .3s, transform .3s var(--ease), box-shadow .4s, translate .45s var(--ease);
}
.filters button:hover { background: rgba(var(--fg-rgb), .14); }
.filters button:active { transform: scale(.97); }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 30px -14px rgba(var(--accent-rgb), .9); }
.filters .count {
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(var(--fg-rgb), .1); color: var(--fg);
}
.filters button[aria-pressed="true"] .count { background: rgba(0,0,0,.16); color: var(--on-accent); }
@media (max-width: 640px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 12px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; padding: 12px 12px 12px 18px; font-size: 15px; }
}

/* ---------- Work: toolbar ---------- */
.work-bar { margin-bottom: clamp(24px, 3vw, 40px); }

/* ---------- Work: even square grid (layout: "grid") ---------- */
.sqgrid { display: grid; gap: clamp(28px, 3vw, 44px) clamp(14px, 1.8vw, 26px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .sqgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sqgrid { gap: 22px 10px; } }
.gcard { display: block; text-decoration: none; }
.gtile { display: block; aspect-ratio: 1; }
.gview {
  position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -40%); opacity: 0; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  transition: opacity .35s, transform .5s var(--ease);
}
.gview svg { width: 11px; height: 11px; }
.gcard:hover .gview, .gcard:focus-visible .gview { opacity: 1; transform: translate(-50%, -50%); }
.gcard:hover .gtile img { transform: scale(1.06); }
.sqgrid:hover .gcard:not(:hover) img { filter: saturate(.75) brightness(.8); }
.gmeta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding-top: 14px; }
.gmeta b { font-size: clamp(16px, 1.4vw, 20px); font-weight: 700; line-height: 1.25; transition: color .3s; }
.gcard:hover .gmeta b { color: var(--accent); }
.gmeta span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.gmeta small { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
@media (hover: none) { .gview { display: none; } }

/* ---------- Work: square mosaic ---------- */
[data-grid] { container-type: inline-size; }
.mosaic {
  --cols: 4; --gap: 6px;
  display: grid; gap: var(--gap); grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-flow: dense;
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));   /* rows as tall as columns are wide */
}
.tile { position: relative; display: block; overflow: hidden; isolation: isolate; text-decoration: none; background: rgba(var(--fg-rgb), .06); }
.tile.l { grid-column: span 2; grid-row: span 2; }
@supports not (width: 1cqw) { .mosaic { grid-auto-rows: auto; } .tile { aspect-ratio: 1; } .tile.l { aspect-ratio: auto; } }
.tile.l.r { grid-column: calc(var(--cols) - 1) / span 2; }
@media (max-width: 900px) { .mosaic { --cols: 2; } .tile.l.r { grid-column: span 2; } }
.tile { perspective: 900px; }
.tile-tilt { position: absolute; inset: 0; display: block; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.04); transition: transform .5s var(--ease); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; }
.tile-sheen {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.28), rgba(255,255,255,.06) 28%, transparent 55%);
  mix-blend-mode: soft-light;
}
.tile:hover .tile-sheen { opacity: 1; }
.mosaic.refilter .tile, .sqgrid.refilter .gcard { animation: refilter .5s var(--ease) both; animation-delay: calc(min(var(--i), 12) * 25ms); }
@keyframes refilter { from { opacity: 0; transform: scale(.96); } }
.mosaic:hover .tile img { filter: saturate(.75) brightness(.8); }
.mosaic .tile:hover img, .mosaic .tile:focus-visible img { transform: scale(1.05); filter: none; }
.tile-badge {
  position: absolute; top: 0; right: 0; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; color: #fff;
  background: rgba(10,13,17,.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tile-badge svg { width: 9px; height: 9px; }
/* Smooth frosted glass that sweeps up from the bottom with the title */
.tile-glass {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%; min-height: 96px; z-index: 2; color: #fff;
  background: rgba(12, 15, 20, .18); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(12px, 1.6vw, 22px);
  clip-path: inset(100% 0 0 0); transition: clip-path .75s var(--snap);
}
.tile-glass::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.4), rgba(0,0,0,0)); }
.tile-glass b { font-size: clamp(16px, 1.5vw, 24px); line-height: 1.1; font-weight: 800; font-variation-settings: "wdth" 115; transform: translateY(14px); opacity: 0; transition: transform .7s var(--ease) .12s, opacity .5s .12s; }
.tile.l .tile-glass b { font-size: clamp(22px, 2.4vw, 36px); }
.tile-glass small { margin-top: 6px; font-size: 13px; opacity: 0; transform: translateY(10px); transition: transform .7s var(--ease) .2s, opacity .5s .2s; }
.tile:hover .tile-glass, .tile:focus-visible .tile-glass { clip-path: inset(0 0 0 0); }
.tile:hover .tile-glass b, .tile:focus-visible .tile-glass b, .tile:hover .tile-glass small, .tile:focus-visible .tile-glass small { opacity: 1; transform: none; }
@media (hover: none) {
  .tile-glass { clip-path: none; height: auto; min-height: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; }
  .tile-glass::before { inset: -40px 0 0 0; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); }
  .tile-glass b { opacity: 1; transform: none; font-size: 14px; }
  .tile-glass small { display: none; }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: clamp(32px, 6vw, 96px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.portrait { display: flex; gap: 18px; align-items: center; margin-bottom: 28px; }
.portrait img { width: 84px; height: 84px; object-fit: cover; filter: grayscale(.2); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.portrait p { margin: 0; color: var(--muted); font-size: 15px; }
.portrait strong { display: block; color: var(--fg); font-size: 18px; }
.prose p { margin: 0 0 1em; max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }
.about-grid .prose p:first-child { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; }
/* Credential (Unreal Fellowship) */
.credential { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 18px; align-items: center; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.credential img { grid-row: span 3; width: 72px; height: 72px; object-fit: contain; padding: 16px; border-radius: 50%; background: #0E1116; }
.credential b { font-size: 17px; font-weight: 700; line-height: 1.3; }
.credential span { font-size: 14px; color: var(--muted); }
.credential .btn { justify-self: start; margin-top: 8px; padding: 8px 16px; font-size: 13px; }
.cert-view { display: block; max-height: 88vh; width: auto; margin: 0 auto; }
.cert-frame { width: min(92vw, 1100px); height: 86vh; border: 0; background: #fff; display: block; margin: 0 auto; }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.timeline > li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); position: relative; }
.timeline > li::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--accent); transition: width .8s var(--ease); }
.timeline > li:hover::before { width: 100%; }
@media (max-width: 560px) { .timeline > li { grid-template-columns: 1fr; gap: 4px; } }
.tl-dates { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.tl-role { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.tl-company { margin: 2px 0 10px; color: var(--accent); font-size: 15px; }
.tl-points { margin: 0; padding-left: 16px; color: var(--muted); font-size: 15px; }
.tl-points li { margin-bottom: 4px; }
.tl-points li::marker { content: "– "; }
.skills { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px 32px; }
@media (max-width: 700px) { .skills { grid-template-columns: 1fr; } }
.skills h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.skills { row-gap: 26px; }
.softlist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.softlist li {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border-radius: 999px;
  font-size: 13px; color: var(--fg); background: rgba(var(--fg-rgb), .06); transition: background .25s;
}
.softlist li:hover { background: rgba(var(--fg-rgb), .12); }
.softlist img { width: 22px; height: 22px; object-fit: contain; border-radius: 5px; }
.softlist li:not(:has(img)) { padding-left: 12px; }
.taglist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.taglist li { font-size: 14px; color: var(--muted); }
.taglist li:not(:last-child)::after { content: "/"; color: var(--accent); margin: 0 12px; opacity: .8; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: clamp(32px, 6vw, 96px); grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-copy { color: var(--muted); max-width: 46ch; margin: 18px 0 0; }
.contact-mail {
  position: relative; display: inline-block; text-decoration: none; word-break: break-all;
  font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; line-height: 1.3;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 1px no-repeat;
  transition: color .3s, background-size .5s var(--ease);
}
.contact-mail:hover { color: var(--accent); background-size: 0 2px; background-position: right bottom; }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 24px 0 18px; }
.mail-row .contact-mail { margin: 0; }
.contact-socials { margin-top: 4px; }
/* Small round icon button (copy) */
.icon-round {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--fg); background: rgba(var(--fg-rgb), .09); transition: translate .45s var(--ease), background .3s, color .3s;
}
.icon-round:hover { background: var(--fg); color: var(--bg); }
.icon-round svg { width: 15px; height: 15px; }
.icon-round:hover .tip, .icon-round:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.form { display: grid; gap: 26px; padding-top: 6px; }
.field { position: relative; display: block; }
.field input, .field textarea {
  font: inherit; font-size: 18px; color: var(--fg); background: transparent; width: 100%;
  border: 0; border-bottom: 1px solid var(--line-strong); padding: 24px 0 10px; resize: vertical;
}
.field textarea { min-height: 120px; }
.field span { position: absolute; left: 0; top: 24px; color: var(--muted); font-size: 18px; pointer-events: none; transform-origin: left top; transition: transform .35s var(--ease), color .2s; }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { transform: translateY(-24px) scale(.72); color: var(--accent); }
.field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.field:focus-within::after { transform: scaleX(1); }
.field input:focus, .field textarea:focus { outline: none; }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-size: 15px; min-height: 1.5em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }

/* ---------- Project page ---------- */
.project-head { padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 3vw, 40px); }
.back { color: var(--muted); text-decoration: none; font-size: 15px; display: inline-flex; gap: 10px; align-items: center; }
.back:hover { color: var(--accent); }
.back svg { transition: transform .4s var(--ease); }
.back:hover svg { transform: translateX(-4px); }
.project-title { margin: 22px 0 0; font-size: clamp(42px, 8vw, 128px); line-height: .9; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -.03em; max-width: 14ch; }
.project-body { display: grid; gap: 24px 56px; padding-bottom: clamp(32px, 5vw, 56px); grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } }
.facts { margin: 0; border-top: 1px solid var(--line-strong); }
.facts div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.gallery { display: grid; gap: clamp(10px, 1.4vw, 18px); padding-bottom: clamp(48px, 7vw, 96px); }
.media { margin: 0; }
.media img { width: 100%; height: auto; cursor: zoom-in; background: rgba(var(--fg-rgb), .05); }
.media figcaption { color: var(--muted); font-size: 14px; padding-top: 8px; }

.embed { position: relative; aspect-ratio: 16 / 9; background: #0d1015; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media video { width: 100%; height: auto; background: #0d1015; }
.poster { position: relative; display: block; text-decoration: none; cursor: pointer; border: 0; padding: 0; width: 100%; background: none; overflow: hidden; }
.poster img { cursor: pointer; transition: transform 1s var(--ease); }
.poster:hover img { transform: scale(1.03); }
.poster-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; gap: 10px; align-items: center; white-space: nowrap;
  padding: 14px 22px; font-weight: 600; font-size: 15px; color: #fff;
  border: 1px solid rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); background: rgba(10,13,17,.2);
  transition: background .3s, color .3s, border-color .3s;
}
.poster-label svg { width: 11px; height: 11px; }
.poster:hover .poster-label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.back-cta { display: flex; justify-content: center; padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 110px); }
.back-cta .btn { padding: 15px 28px; font-size: 16px; }
.back-cta .btn svg { width: 13px; height: 13px; transition: transform .4s var(--ease); }
.back-cta .btn:hover svg { transform: translateX(-4px); }

/* ---------- Overlay ---------- */
.overlay { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; background: rgba(var(--bg-rgb), .5); color: var(--fg); -webkit-backdrop-filter: blur(26px) saturate(1.3); backdrop-filter: blur(26px) saturate(1.3); }
.overlay::backdrop { background: transparent; }
.overlay[open] { display: grid; place-items: center; animation: ov-in .5s var(--ease); }
@keyframes ov-in { from { opacity: 0; } }
.overlay-body { width: min(92vw, 1500px); }
.overlay-body img { max-height: 88vh; width: auto; margin: 0 auto; }
.overlay-close { position: fixed; top: 18px; right: 18px; z-index: 2; padding: 10px 18px; cursor: pointer; border: 0; border-radius: 999px; background: rgba(var(--fg-rgb), .12); color: var(--fg); font-weight: 600; }
.overlay-close:hover { background: var(--fg); color: var(--bg); }

/* ---------- Footer ---------- */
.footer { position: relative; padding: clamp(36px, 5vw, 56px) var(--gutter) 22px; color: var(--muted); font-size: 14px; }
.footer::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: linear-gradient(90deg, var(--line), rgba(var(--accent-rgb), .8) 50%, var(--line)); }
.footer-row { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
@media (max-width: 760px) { .footer-row { grid-template-columns: 1fr; justify-items: start; } }
.footer-name { color: var(--fg); font-weight: 800; font-size: 18px; font-variation-settings: "wdth" 120; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.footer-name .brand-mark { width: 28px; height: 28px; }
.footer-name:hover { color: var(--accent); }
.footer-id p { margin: 2px 0 0; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.socials a {
  position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; text-decoration: none; overflow: hidden; isolation: isolate;
  color: var(--fg); font-size: 14px; font-weight: 700; letter-spacing: .02em; background: rgba(var(--fg-rgb), .09);
  transition: translate .45s var(--ease), color .35s var(--ease), background .3s, box-shadow .4s;
}
.socials a::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .45s var(--snap); }
.socials a:hover, .socials a:focus-visible { color: var(--on-accent); box-shadow: 0 10px 26px -10px rgba(var(--accent-rgb), .9); }
.socials a:hover::before, .socials a:focus-visible::before { transform: scale(1); }
.socials a svg { width: 18px; height: 18px; }
.socials a .txt { font-size: 14px; font-weight: 700; }
.tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; white-space: nowrap; transform: translate(-50%, 6px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 700; padding: 5px 9px; transition: opacity .2s, transform .3s var(--ease);
}
.socials li { position: relative; }
.socials li:hover .tip, .socials li:focus-within .tip { opacity: 1; transform: translate(-50%, 0); }
.socials li:last-child .tip { left: auto; right: 0; transform: translate(0, 6px); }
.socials li:last-child:hover .tip, .socials li:last-child:focus-within .tip { transform: none; }
.to-top { justify-self: end; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; }
.to-top svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.to-top:hover { color: var(--accent); }
.to-top:hover svg { transform: translateY(-4px); }
@media (max-width: 760px) { .to-top { justify-self: start; } }
/* Footer option "minimal": one quiet bar, no giant name */
[data-footer="minimal"] .footer { padding-top: 26px; padding-bottom: 26px; }
[data-footer="minimal"] .footer-row { grid-template-columns: 1fr auto; gap: 18px 36px; }
[data-footer="minimal"] .footer-id p { display: none; }
[data-footer="minimal"] .footer-legal { margin-top: 18px; text-align: left; }
@media (max-width: 760px) { [data-footer="minimal"] .footer-row { grid-template-columns: 1fr; } }
.footer-legal { max-width: var(--max); margin: 26px auto 0; font-size: 13px; opacity: .7; }

/* Plain-text version of the page (read by Google; replaced by the app when JavaScript runs) */
.seo-static { max-width: 900px; margin: 0 auto; padding: 110px var(--gutter) 60px; }
.seo-static ul { list-style: none; padding: 0; display: grid; gap: 14px; }
.seo-static li a { display: flex; gap: 14px; align-items: center; text-decoration: none; }
.seo-static img { width: 96px; height: 96px; object-fit: cover; }
.seo-static .seo-static img, .seo-static > img { width: 100%; height: auto; margin: 10px 0; }
.noscript { padding: 100px var(--gutter); }
.empty { color: var(--muted); padding: 40px 0; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .flute { background-color: rgba(var(--bg-rgb), .55); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .stage-slide img, .stage-layer, .stage-media { transform: none !important; }
  .ring .ring-fill.run { animation: none !important; stroke-dashoffset: 0; }
  .grain, .wipe, .curtain, .slices, .lens-ring, .page-veil { display: none !important; }
  .tile-tilt { transform: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
