/* ==========================================================
   Tokens
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-subtle: #f5f5f4;
  --surface: #ffffff;
  --text: #141414;
  --card-bg: rgba(237, 237, 237, 0.64);
  --text-2: #55555a;
  --text-3: #8c8c91;
  --line: #e7e7e5;
  --accent: #0ab68b;
  --accent-text: #07855f;
  --on-accent: #0d0d0e;
  --accent-soft: rgba(10, 182, 139, 0.1);
  --point: #e66386;
  --header-bg: rgba(255, 255, 255, 0.78);
  --banner-bg: rgba(255, 255, 255, 0.55);
  --dot: rgba(17, 17, 17, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter Tight", var(--font);

  --header-h: 60px;
  --banner-h: 40px;
  --max: 1120px;
  --gutter: 24px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0d0d0e;
  --bg-subtle: #17171a;
  --surface: #121214;
  --text: #f1f1f1;
  --card-bg: rgba(40, 40, 44, 0.6);
  --text-2: #a9a9ae;
  --text-3: #6f6f75;
  --line: #26262a;
  --accent: #4fe0b6;
  --accent-text: #4fe0b6;
  --on-accent: #0d0d0e;
  --accent-soft: rgba(79, 224, 182, 0.12);
  --header-bg: rgba(13, 13, 14, 0.75);
  --banner-bg: rgba(23, 23, 26, 0.55);
  --dot: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.006em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main { padding-top: var(--header-h); }

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left,
.header-right { display: flex; align-items: center; gap: 28px; }
.header-right { gap: 4px; }

.logo { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.mobile-only-link { display: none; }
@media (max-width: 520px) {
  .header-right > .header-group:first-child,
  .header-right > .header-divider { display: none; }
  .mobile-nav .mobile-only-link { display: block; }
}

.nav { display: flex; gap: 24px; }
.nav a {
  font-size: 15px;
  color: var(--text-2);
  transition: color 0.2s;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  color: var(--text-2);
  transition: background-color 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
.icon-btn:not(.theme-btn):hover svg { transform: translateY(-1px) scale(1.08); }

.header-group { display: flex; align-items: center; gap: 4px; }
.header-group + .header-divider + .header-group { gap: 10px; }
.header-divider { width: 1px; height: 16px; background: var(--line); opacity: 0.6; margin: 0 12px; }

.hbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-2);
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.hbtn svg { width: 18px; height: 18px; flex-shrink: 0; }
.hbtn .filled {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: -1;
  background: var(--tone);
  transition: height 0.3s var(--ease);
}
.hbtn:is(:hover, :focus-visible) { color: var(--tone-on); border-color: var(--tone-line); }
.hbtn:is(:hover, :focus-visible) .filled { height: 100%; }
.social-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  transition: max-width 0.35s var(--ease), margin-left 0.35s var(--ease), opacity 0.25s;
}
.hbtn:is(:hover, :focus-visible) .social-label { max-width: 72px; margin-left: 8px; opacity: 1; }

.hbtn[data-tone="github"] { --tone: rgba(24, 23, 23, 0.07); --tone-line: rgba(24, 23, 23, 0.12); --tone-on: #181717; }
.hbtn[data-tone="linkedin"] { --tone: rgba(10, 102, 194, 0.1); --tone-line: rgba(10, 102, 194, 0.15); --tone-on: #0a66c2; }
[data-theme="dark"] .hbtn[data-tone="github"] { --tone: rgba(255, 255, 255, 0.12); --tone-line: rgba(255, 255, 255, 0.12); --tone-on: #fff; }
[data-theme="dark"] .hbtn[data-tone="linkedin"] { --tone: rgba(10, 102, 194, 0.3); --tone-line: rgba(56, 145, 235, 0.18); --tone-on: #fff; }

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s;
}
.lang-switch:is(:hover, :focus-visible) { border-color: rgba(10, 182, 139, 0.18); }
.seg {
  position: relative;
  z-index: 1;
  padding: 0 9px;
  line-height: 22px;
  color: var(--text-3);
  transition: color 0.3s var(--ease);
}
.seg.on { color: var(--text); }
.lang-switch:is(:hover, :focus-visible) .seg.on { color: var(--accent-text); }
.lang-switch:hover .seg:not(.on) { color: var(--text); }
.seg-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--seg-x, 2px);
  width: var(--seg-w, 30px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: left 0.4s var(--ease), width 0.4s var(--ease), background-color 0.3s;
}
[data-theme="dark"] .seg-indicator { background: #2a2a2f; box-shadow: none; }
.lang-switch:is(:hover, :focus-visible) .seg-indicator { background: var(--accent-soft); box-shadow: none; }

.theme-switch {
  --track: hsl(45, 90%, 88%);
  --knob: hsl(40, 95%, 55%);
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  background: var(--track);
  transition: background-color 0.4s var(--ease), box-shadow 0.2s;
}
.theme-switch .knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px var(--knob);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.theme-switch:is(:hover, :focus-visible) { box-shadow: 0 0 0 3px hsla(40, 95%, 55%, 0.2); }
.theme-switch:hover .knob { transform: scale(1.08); }

[data-theme="dark"] .theme-switch { --track: hsl(215, 45%, 18%); --knob: hsl(212, 95%, 74%); }
[data-theme="dark"] .theme-switch .knob {
  transform: translateX(20px);
  box-shadow: inset 5px -4px 0 0 var(--knob);
}
[data-theme="dark"] .theme-switch:is(:hover, :focus-visible) { box-shadow: 0 0 0 3px hsla(212, 95%, 70%, 0.22); }
[data-theme="dark"] .theme-switch:hover .knob { transform: translateX(20px) rotate(-15deg) scale(1.08); }

@media (max-width: 720px) {
  .header-divider { margin: 0 6px; }
}

.menu-btn { display: none; }
.mobile-nav { display: none; }

@media (max-width: 720px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .header-left { gap: 8px; }

  .mobile-nav {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 49;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0.2s;
  }
  .mobile-nav.open { opacity: 1; transform: none; visibility: visible; }
  .mobile-nav a {
    display: block;
    padding: 12px 0;
    font-size: 17px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav a:last-child { border-bottom: 0; }
}

/* ==========================================================
   How I built banner
   ========================================================== */
.built-banner {
  --banner-tall: 56px;
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  height: var(--banner-tall);
  margin-bottom: calc(var(--banner-h) - var(--banner-tall));
  transition: height 0.35s var(--ease), margin-bottom 0.35s var(--ease);
  background: var(--banner-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.built-banner button {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  padding: 0 var(--gutter);
}
.built-banner .pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}
.built-banner .summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.built-banner .more { color: var(--text); font-weight: 550; flex-shrink: 0; }
.built-banner .more .arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.built-banner button:hover .arrow { transform: translateX(3px); }
.built-banner button { font-size: 14px; transition: font-size 0.3s var(--ease); }
.built-banner .pill { transition: font-size 0.3s var(--ease), padding 0.3s var(--ease); font-size: 13px; padding: 3px 14px; }
html.scrolled .built-banner { height: var(--banner-h); margin-bottom: 0; }

.built-banner .pill { display: inline-flex; align-items: center; gap: 8px; }
.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: live-ping 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes live-ping {
  0% { transform: scale(1); opacity: 0.6; }
  60%, 100% { transform: scale(3); opacity: 0; }
}
.built-banner button { transition: background-color 0.3s var(--ease), font-size 0.3s var(--ease); }
.built-banner button:hover { background: var(--accent-soft); }
.built-banner .more { transition: color 0.2s; }
.built-banner button:hover .more { color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; }
}
main:has(> .built-banner) { display: flex; flex-direction: column; }
html.scrolled .built-banner button { font-size: 13px; }
html.scrolled .built-banner .pill { font-size: 12px; padding: 2px 12px; }

@media (max-width: 720px) {
  .built-banner .pill { display: inline-flex; }
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  position: relative;
  z-index: 0;
  height: 100svh;
  min-height: 600px;
  margin-top: calc(-1 * (var(--header-h) + var(--banner-h)));
  overflow: hidden;
}

#hero-stage {
  position: absolute;
  inset: 0;
}

.hero-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 2;
  width: min(calc(100% - 40px), clamp(560px, 46vw, 840px));
  padding: clamp(72px, 5.5vw, 104px) 40px clamp(136px, 10vw, 184px);
  border-radius: 28px;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  transform-origin: 50% 100%;
}

.js .hero-card { left: 0; top: 0; bottom: auto; transform: none; visibility: hidden; }
.js .hero.ready .hero-card { visibility: visible; }
.hero-card { transition: backdrop-filter 0.8s var(--ease), -webkit-backdrop-filter 0.8s var(--ease); }
.hero.stacked .hero-card { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

.hero-text > * {
  display: block;
  transform-origin: 50% 50%;
  will-change: transform;
}
.hero-greet {
  font-family: var(--font);
  font-size: clamp(24px, 2vw, 36px);
  font-weight: 200;
  line-height: 1.3;
  color: var(--text-2);
}
.hero-name {
  margin-top: clamp(6px, 0.6vw, 12px);
  font-family: var(--display);
  font-size: clamp(40px, 5.4vw, 96px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.012em;
}
.hero-title {
  font-family: var(--font);
  margin-top: clamp(20px, 1.6vw, 28px);
  font-size: clamp(20px, 1.65vw, 30px);
  font-weight: 300;
  line-height: 1.3;
  color: var(--text-2);
}

.hero-cta {
  position: absolute;
  left: 0;
  right: 0;
  width: fit-content;
  margin: 0 auto;
  bottom: clamp(56px, 4.2vw, 80px);
}

.js .hero-cta {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), translate 0.45s var(--ease);
}
.js .hero.settled .hero-cta { opacity: 1; transform: none; }
.js .hero.settled .hero-cta:hover { transform: translateY(-1px); }

.js .hero:not(.settled) .hero-card { pointer-events: none; }

.stack-icon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border-radius: 22%;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform;
  visibility: hidden;
}
.stack-icon.live { visibility: visible; }
.stack-icon.dragging { cursor: grabbing; }
.stack-icon img { width: 100%; height: 100%; pointer-events: none; }

.hero.stacked .stack-icon { cursor: default; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.hero.stacked .stack-icon img { transition: transform 0.25s var(--ease); }
.hero.stacked .stack-icon:hover img { transform: scale(1.12); }

.stack-marquee {
  position: absolute;
  left: 50%;
  z-index: 1;
  width: min(calc(100% - 48px), 960px);
  padding: 12px 0;
  overflow: hidden;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.hero.marquee-on .stack-marquee { opacity: 1; }
.hero.marquee-run .stack-icon {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}
.mq-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
  animation-play-state: paused;
}
.hero.marquee-run .mq-track { animation-play-state: running; }
.mq-item {
  width: var(--mq-size, 44px);
  height: var(--mq-size, 44px);
  margin-right: 14px;
  flex-shrink: 0;
  border-radius: 22%;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s var(--ease);
}
.mq-item img { width: 100%; height: 100%; display: block; }
.hero.marquee-run .stack-marquee:hover .mq-track { animation-play-state: paused; }
.mq-item:hover { transform: translateY(-4px) scale(1.08); }
@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

@media (max-width: 600px) {
  .hero-card { padding: 52px 24px 112px; border-radius: 22px; }
  .hero-cta { bottom: 44px; }
  .hero-greet { font-size: 17px; }
  .hero-title { font-size: 16px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 550;
  transition: transform 0.2s var(--ease), translate 0.45s var(--ease), background-color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--text-3); }
.btn svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.btn:hover svg.down { transform: translateY(2px); }
.btn:hover svg.right { transform: translateX(2px); }

/* ==========================================================
   Sections
   ========================================================== */
.section { padding: 136px 0 0; }
#projects { padding-top: 32px; }
.about-placeholder { color: var(--text-3); margin-top: 16px; }
.section:last-of-type { padding-bottom: 120px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 32px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--text);
}

.page-title {
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 700;
}
.page-intro { margin-top: 16px; color: var(--text-2); max-width: 600px; font-size: 18px; }
.page-head { padding-top: 72px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 48px;
}
.split-title {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
}
.section-head .more-link { margin-top: 0; flex-shrink: 0; }

.side-block { margin-top: 88px; }
.side-block .split-title { font-size: clamp(20px, 2vw, 24px); font-weight: 650; letter-spacing: -0.015em; }

/* ==========================================================
   Project cards (main)
   ========================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 24px;
}
@media (max-width: 720px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card { display: block; }

.thumb {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6%;
  transition: transform 0.5s var(--ease);
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 10px;
  padding: 10%;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 18px 18px;
  transition: transform 0.5s var(--ease);
}
/* Service flow inside the placeholder */
.thumb.tinted {
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--tint) 9%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--tint) 6%, transparent), transparent 55%),
    var(--bg-subtle);
}
.flow {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 18px; /* room for captions */
  --node: clamp(34px, 10cqw, 56px);
}
.flow.is-grouped { --node: clamp(30px, 8.5cqw, 46px); }
.flow-node {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: var(--node);
  aspect-ratio: 1;
  opacity: 0;
  transform: translateY(10px) scale(0.85);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(450ms + var(--i) * 160ms);
}
.flow-node img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18%;
}
.flow-cap {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(10px, 2.3cqw, 12px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-2);
  white-space: nowrap;
}
.flow-link {
  position: relative;
  flex: 0 0 auto;
  width: clamp(14px, 4.5cqw, 32px);
  height: 1.5px;
  margin: 0 6px;
  background: color-mix(in srgb, var(--text-3) 45%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
  transition-delay: calc(350ms + var(--i) * 160ms);
}
.flow-group {
  display: grid;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  transition-delay: calc(350ms + var(--i) * 160ms);
}
.flow-zone {
  position: relative;
  padding: 26px 14px 28px;
  border: 1px dashed color-mix(in srgb, var(--text-3) 55%, transparent);
  border-radius: 5px;
}
.flow-zone-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: clamp(9px, 2cqw, 11px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-3);
}
.flow-row { display: flex; align-items: center; }
.flow.is-grouped { padding-bottom: 0; }
.flow.in :is(.flow-node, .flow-group) { opacity: 1; transform: none; }
.flow.in .flow-link { transform: scaleX(1); }
.flow-lead { position: relative; display: flex; align-items: center; }
.flow-dot {
  position: absolute;
  top: calc(50% - 9px);
  left: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}
.flow-lead .flow-dot { top: 50%; }
.project-card:hover .flow.in .flow-dot { animation: flow-run 1.3s var(--ease); }
.project-card:hover .flow.in .flow-lead .flow-dot { animation: flow-stop 0.9s var(--ease) forwards; }
@keyframes flow-run {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes flow-stop {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
}
@media (prefers-reduced-motion: reduce) {
  .flow-node, .flow-group, .flow-link { opacity: 1; transform: none; transition: none; }
  .project-card:hover .flow-dot { animation: none; }
}

.project-card:hover .thumb img,
.project-card:hover .thumb-placeholder { transform: scale(1.025); }

.card-body { padding: 18px 4px 0; }

.project-card.is-draft { cursor: default; }
.project-card.is-draft .thumb { border-style: dashed; background: transparent; }
.project-card.is-draft .thumb-placeholder { opacity: 0.5; }
.project-card.is-draft .card-title,
.project-card.is-draft .card-summary { color: var(--text-3); }
.project-card.is-draft:hover .thumb-placeholder { transform: none; }
.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 18px;
  font-weight: 650;
}
.card-title .year { font-size: 14px; font-weight: 450; color: var(--text-3); flex-shrink: 0; }
.card-summary { margin-top: 8px; color: var(--text-2); font-size: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 13px;
  line-height: 1;
  color: var(--text-2);
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 99px;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--text-3); color: var(--text); }
.project-card .tag:hover { border-color: var(--line); color: var(--text-2); }

/* ==========================================================
   Side projects
   ========================================================== */

.side-item:first-child { padding-top: 4px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  text-align: left;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.side-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
  transition: transform 0.35s var(--ease);
}
.side-thumb img { width: 60%; height: 60%; object-fit: contain; }
.side-thumb:has(img.fill) { overflow: hidden; }
.side-thumb img.fill { width: 100%; height: 100%; object-fit: cover; }
.side-item:hover .side-thumb { transform: rotate(-4deg) scale(1.04); }
.side-text { flex: 1; min-width: 0; }
.side-title { font-weight: 600; }
.side-desc { font-size: 15px; color: var(--text-2); }
.side-meta { padding-right: 4px; font-size: 14px; color: var(--text-3); flex-shrink: 0; }

/* ==========================================================
   Experience list
   ========================================================== */
.exp-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.exp-item:first-child { padding-top: 4px; }
.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.exp-org { font-size: 18px; font-weight: 600; }
.exp-role { margin-top: 2px; font-size: 14px; color: var(--text-3); }
#education .exp-role { margin-top: 4px; font-size: 16px; color: var(--text-2); }
.exp-period { padding-right: 4px; font-size: 15px; color: var(--text-3); flex-shrink: 0; }
.exp-desc { margin-top: 8px; font-size: 16px; color: var(--text-2); }

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 550;
}
.more-link:hover { color: var(--accent-text); }

/* ==========================================================
   Skills & Certifications
   ========================================================== */
.skill-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.skill-row:first-child { padding-top: 4px; }
.skill-label { font-size: 15px; color: var(--text-3); padding-top: 3px; }
.skill-row .tags { margin-top: 0; }
@media (max-width: 520px) {
  .skill-row { grid-template-columns: 1fr; gap: 10px; }
}

.sub-label {
  margin-top: 56px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-3);
}
.cert-list { margin-top: 4px; }
.cert-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cert-item { align-items: center; }
.cert-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  background-clip: padding-box; /* keep the white fill from showing through the border */
  object-fit: contain;
}
[data-theme="dark"] .cert-icon { border-color: rgba(255, 255, 255, 0.06); }
.cert-date { align-self: flex-start; }
.cert-text { flex: 1; min-width: 0; }
.cert-name { font-weight: 550; }
.cert-issuer { font-size: 15px; color: var(--text-2); }
.cert-date { padding-right: 4px; font-size: 15px; color: var(--text-3); }

/* ==========================================================
   Resume CTA
   ========================================================== */
.resume-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.resume-cta p { color: var(--text-2); font-size: 16px; margin-top: 4px; }
.resume-cta h3 { font-size: 20px; letter-spacing: -0.01em; }
@media (max-width: 600px) {
  .resume-cta { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================
   Projects page
   ========================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}
.filter-bar[hidden] { display: none; }
.filter-bar { align-items: center; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-divider { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
@media (max-width: 600px) { .filter-divider { flex-basis: 100%; height: 0; margin: 0; } }
.filter-btn {
  font-size: 15px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-2);
}
.filter-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter-btn[data-group="type"]:is([data-key="main"], [data-key="side"])[aria-pressed="true"] {
  background: var(--accent-text);
  border-color: var(--accent-text);
  color: #fff;
}
[data-theme="dark"] .filter-btn[data-group="type"]:is([data-key="main"], [data-key="side"])[aria-pressed="true"] { color: #0d0d0e; }

.detail-list { margin-top: 56px; }
.empty-note { color: var(--text-3); padding: 24px 0; }
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.detail:first-child { border-top: 0; padding-top: 0; }
.detail .thumb { align-self: start; }
.detail-kind {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}
.detail h2 {
  margin-top: 10px;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-3);
}
.detail-summary { margin-top: 18px; color: var(--text-2); }
.detail-points { margin-top: 18px; display: grid; gap: 8px; }
.detail-points li {
  position: relative;
  padding-left: 18px;
  font-size: 16px;
  color: var(--text-2);
}
.detail-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--text-3);
}
.detail-links { display: flex; gap: 8px; margin-top: 24px; }
.detail-links .btn { height: 38px; font-size: 14px; padding: 0 16px; border-radius: 7px; }
.detail-links .btn-icon { width: 38px; padding: 0; justify-content: center; }
.detail-links .btn-icon svg { width: 18px; height: 18px; }

.detail-side { align-self: start; min-width: 0; }
.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 4px 32px;
  margin: 20px 0 0;
  padding-left: 4px;
}
.detail-facts dt { font-size: 13px; color: var(--text-3); }
.detail-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 550; }
.detail h2 + .tags { margin-top: 14px; }
.detail-side .detail-links { margin-top: 24px; padding-left: 4px; }
@media (max-width: 520px) {
  .detail-facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
}

/* ==========================================================
   Project detail page (project.html)
   ========================================================== */
.container.narrow { max-width: 880px; }
.project-page { padding-top: 56px; }
.back-link { display: inline-flex; font-size: 15px; font-weight: 550; color: var(--text-2); transition: color 0.2s; }
.back-link:hover { color: var(--text); }
.project-head { margin-top: 40px; }
.project-title {
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.project-summary { margin-top: 20px; font-size: 18px; color: var(--text-2); }
.project-figure { margin: 48px 0 0; }
.project-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
[data-theme="dark"] .project-figure img { filter: brightness(0.92); }
.project-figure.is-narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.project-body { margin-top: 56px; display: grid; gap: 48px; }
.project-body h2 { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 12px; }
.project-body p { color: var(--text-2); }
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 88px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager-link { display: grid; gap: 4px; }
.pager-link.next { text-align: right; }
.pager-label { font-size: 14px; color: var(--text-3); }
.pager-title { font-weight: 600; transition: color 0.2s; }
.pager-link:hover .pager-title { color: var(--accent-text); }
.detail-main { display: block; color: inherit; }
.detail-main h2 { transition: color 0.2s; }
.detail-main:hover h2 { color: var(--accent-text); }

.thumb-wrap { position: relative; }
.view-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.08);
  color: #141414;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), background-color 0.25s, color 0.25s;
  pointer-events: none;
}
.view-chip svg { width: 15px; height: 15px; transition: transform 0.3s var(--ease); }
.kind-chip {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  color: #55555a;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
[data-theme="dark"] .kind-chip { background: rgba(23, 23, 26, 0.5); border-color: rgba(255, 255, 255, 0.08); color: #a9a9ae; }
.project-card:is(:hover, :focus-visible) .view-chip { opacity: 1; transform: none; }
.project-card:hover .view-chip svg { transform: translateX(2px); }
[data-theme="dark"] .view-chip { background: rgba(23, 23, 26, 0.5); border-color: rgba(255, 255, 255, 0.08); color: #f1f1f1; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
@media (hover: none) { .view-chip { opacity: 1; transform: none; } }

/* ==========================================================
   Modal (How I built)
   ========================================================== */
.modal {
  width: min(980px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}
.modal[open] { animation: modal-in 0.35s var(--ease); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}
.modal-inner { padding: 0 40px 40px; }
.modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 32px 0 16px;
  background: var(--surface);
}
.modal-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.modal-full { height: 36px; font-size: 14px; padding: 0 14px; }
.modal h2 { font-size: 24px; letter-spacing: -0.02em; }
.modal .thumb { margin-top: 24px; }
.modal-sections { display: grid; gap: 20px; margin-top: 28px; }
.modal-sections h3 { font-size: 16px; font-weight: 650; }
.modal-sections p { margin-top: 4px; font-size: 16px; color: var(--text-2); }
@media (max-width: 520px) {
  .modal-inner { padding: 0 20px 24px; }
  .modal-head { padding-top: 20px; }
  .modal-full span { display: none; }
  .modal-full { width: 36px; padding: 0; justify-content: center; }
}

/* ==========================================================
   Scroll reveal
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), filter 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .modal[open] { animation: none; }
}

/* ==========================================================
   Motion (js/motion.js)
   ========================================================== */
:root {
  --glow: rgba(10, 182, 139, 0.14);
  --stick-top: calc(var(--header-h) + 32px);
}
[data-theme="dark"] { --glow: rgba(79, 224, 182, 0.14); }
html:has(.built-banner) { --stick-top: calc(var(--header-h) + var(--banner-h) + 32px); }

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-position: center;
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 55%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 55%, #000 30%, transparent 85%);
}
.hero::before { background-image: var(--cross-img); }
:root {
  --cross-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 19.5v9M19.5 24h9' stroke='%23111' stroke-opacity='.16'/%3E%3C/svg%3E");
  --cross-img-glow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 19.5v9M19.5 24h9' stroke='%230ab68b' stroke-width='1.4'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --cross-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 19.5v9M19.5 24h9' stroke='%23fff' stroke-opacity='.14'/%3E%3C/svg%3E");
  --cross-img-glow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 19.5v9M19.5 24h9' stroke='%234fe0b6' stroke-width='1.4'/%3E%3C/svg%3E");
}

/* --- crossGlow --- */
.fx-crossGlow .hero::after {
  background-image: var(--cross-img-glow);
  -webkit-mask-image: radial-gradient(160px circle at var(--hx, -999px) var(--hy, -999px), #000, transparent 75%);
  mask-image: radial-gradient(160px circle at var(--hx, -999px) var(--hy, -999px), #000, transparent 75%);
  opacity: 0;
  transition: opacity 0.4s;
}
.fx-crossGlow .hero.glow::after { opacity: 0.9; }

/* --- progress --- */
.scroll-progress {
  position: fixed;
  top: calc(var(--header-h) - 2px);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 51;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* --- blur --- */
.fx-blur .reveal:not(.in) { filter: blur(8px); }

/* --- wipe --- */
.fx-wipe :is(.split-title, .page-title).reveal {
  opacity: 1;
  filter: none;
  transform: translateY(0.45em);
  clip-path: inset(100% -5% -30% -5%);
  transition: clip-path 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.fx-wipe :is(.split-title, .page-title).reveal.in {
  transform: none;
  clip-path: inset(-20% -5% -30% -5%);
}

/* --- eyebrow --- */
.fx-eyebrow .eyebrow.reveal {
  transform: none;
  letter-spacing: 0.32em;
  transition: opacity 0.8s var(--ease), letter-spacing 1.1s var(--ease), filter 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.fx-eyebrow .eyebrow.reveal.in { letter-spacing: 0.08em; }
.fx-eyebrow .eyebrow::before { transition: transform 0.9s var(--ease) calc(var(--d, 0ms) + 120ms); }
.fx-eyebrow .eyebrow.reveal:not(.in)::before { transform: rotate(-180deg) scale(0); }

/* --- stagger --- */
.fx-stagger .reveal .tag {
  transition: opacity 0.5s var(--ease), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s, color 0.2s;
}
.fx-stagger .reveal:not(.in) .tag { opacity: 0; transform: translateY(8px) scale(0.9); }
.fx-stagger .reveal.in .tag {
  transition-delay: calc(var(--d, 0ms) + 260ms + var(--t, 0) * 45ms),
    calc(var(--d, 0ms) + 260ms + var(--t, 0) * 45ms), 0s, 0s;
}
.tag:nth-child(2) { --t: 1; }
.tag:nth-child(3) { --t: 2; }
.tag:nth-child(4) { --t: 3; }
.tag:nth-child(5) { --t: 4; }
.tag:nth-child(6) { --t: 5; }
.tag:nth-child(7) { --t: 6; }
.tag:nth-child(n + 8) { --t: 7; }

/* --- lines --- */
.fx-lines :is(.exp-item, .skill-row, .cert-item, .side-item) {
  position: relative;
  border-bottom-color: transparent;
}
.fx-lines :is(.exp-item, .skill-row, .cert-item, .side-item)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.2s var(--ease) calc(var(--d, 0ms) + 150ms);
}
.fx-lines :is(.exp-item, .skill-row, .cert-item, .side-item).in::after { transform: none; }

.side-text { transition: transform 0.35s var(--ease); }
.side-title { font-size: 18px; transition: color 0.2s; }
.side-item:hover .side-text { transform: translateX(4px); }
.side-item:hover .side-title { color: var(--accent-text); }

.exp-period { transition: color 0.2s; }
.exp-item:hover .exp-period { color: var(--text); }

/* --- cards --- */
.fx-cards .project-card.reveal .thumb {
  clip-path: inset(100% 0 0 0 round var(--radius));
}
.fx-cards .project-card.reveal.in .thumb {
  clip-path: inset(0 round var(--radius));
}
.fx-cards .project-card :is(.thumb img, .thumb-placeholder) { transition: transform 1.1s var(--ease); }
.fx-cards .project-card.reveal:not(.in) :is(.thumb img, .thumb-placeholder) { transform: scale(1.18); }

.thumb {
  transition: clip-path 1.1s var(--ease) var(--d, 0ms), transform 0.6s var(--ease);
}

/* --- tilt --- */
.fx-tilt :is(.project-card, .detail) .thumb {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* --- spotlight --- */
.fx-spotlight .resume-cta { position: relative; }
.fx-spotlight .resume-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
}
.fx-spotlight .resume-cta.lit::after { opacity: 1; }
.fx-spotlight .resume-cta > * { position: relative; z-index: 2; }

.fx-ctaFill .btn-fill {
  overflow: hidden;
  isolation: isolate;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.15s ease 0s;
}
.fx-ctaFill .btn-fill:not(.hero-cta) { position: relative; }
.fx-ctaFill .btn-fill:hover {
  background-color: var(--accent);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.1s ease 0.3s;
}
.fx-ctaFill .btn-fill::before {
  content: "";
  position: absolute;
  left: var(--bx, 50%);
  top: var(--by, 50%);
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.55s var(--ease);
  z-index: -1;
}
.fx-ctaFill .btn-fill:hover::before { transform: scale(1); }

.cta-arrow {
  display: inline-flex;
  width: 16px;
  height: 16px;
  overflow: hidden;
}
.fx-ctaFill .hero-cta:hover .cta-arrow svg { animation: arrow-loop 0.6s var(--ease); }
@keyframes arrow-loop {
  0% { transform: translateX(0); }
  45% { transform: translateX(130%); }
  46% { transform: translateX(-130%); }
  100% { transform: translateX(0); }
}

/* --- hop --- */
.fx-hop .stack-icon.hop { animation: icon-hop 0.7s cubic-bezier(0.3, 0.6, 0.35, 1) both; }
@keyframes icon-hop {
  0%, 100% { translate: 0 0; }
  35% { translate: 0 var(--hop, -12px); }
  62% { translate: 0 calc(var(--hop, -12px) * -0.12); }
  80% { translate: 0 calc(var(--hop, -12px) * 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { filter: none; clip-path: none; }
}

html:has(.built-banner) { scroll-padding-top: calc(var(--header-h) + var(--banner-h) + 16px); }

/* ==========================================================
   Mobile
   ========================================================== */
@media (max-width: 720px) {
  .section { padding-top: 96px; }
  .page-head { padding-top: 8px; }
  .built-banner .summary { display: none; }

  /* The whole card is a link, so the floating button only covers the diagram */
  .view-chip { display: none; }
  .kind-chip { top: 10px; left: 10px; height: 24px; padding: 0 8px; font-size: 11px; }

  /* Keep the two AZ boxes inside the thumbnail */
  .flow.is-grouped { --node: 30px; margin-top: 18px; }
  .flow-zone { padding: 20px 10px 22px; }
  .flow-zone-label { top: 4px; left: 6px; }
  .flow-group { gap: 6px; }
  .flow-link { margin: 0 4px; }
}

/* ==========================================================
   Project cards: one reveal, no inner pop-ins
   ========================================================== */
.project-card.reveal { --d: 0ms !important; }
:is(.project-card, .detail) :is(.flow-node, .flow-group, .flow-link) {
  opacity: 1;
  transform: none;
  transition: none;
}
.fx-stagger :is(.project-card, .detail).reveal .tag {
  opacity: 1;
  transform: none;
  transition: border-color 0.2s, color 0.2s;
}

/* Touch screens: no sticky hover effects */
@media (hover: none) {
  .project-card:hover .thumb img,
  .project-card:hover .thumb-placeholder { transform: none; }
  .project-card:hover .flow.in .flow-dot,
  .project-card:hover .flow.in .flow-lead .flow-dot { animation: none; }
  .side-item:hover .side-thumb,
  .side-item:hover .side-text { transform: none; }
  .side-item:hover .side-title,
  .detail-main:hover h2 { color: inherit; }
}

/* ==========================================================
   Diagram in project body + lightbox
   ========================================================== */
.project-body .project-figure { margin: 24px 0 0; }
.figure-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.lightbox {
  width: min(1400px, calc(100vw - 32px), calc((100svh - 48px) * var(--ar, 1.74)));
  max-width: none;
  max-height: calc(100svh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.lightbox[open] { animation: modal-in 0.3s var(--ease); }
.lightbox-body {
  max-height: calc(100svh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
}
.lightbox-body img { display: block; width: 100%; height: auto; }
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
@media (max-width: 720px) {
  .lightbox { width: calc(100vw - 16px); }
  .lightbox-body img { width: 880px; max-width: none; }
}
