/* =========================================================
   Zhanbolot Kalbaev — Portfolio
   Түндүк мотиви · лазурит түн · күн-сары акцент
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #0e1330;
  --bg-2: #141a3d;
  --bg-3: #1b2250;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eceffa;
  --muted: #a1a9cc;
  --accent: #f5b82e;
  --on-accent: #141a3a;
  --accent-ink: var(--accent);
  --red: #e0303b;
  --shadow: 0 30px 60px -20px rgba(3, 6, 25, 0.65);
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f1f2f8;
  --bg-2: #ffffff;
  --bg-3: #e6e8f3;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: #ffffff;
  --line: rgba(20, 26, 58, 0.1);
  --text: #141a3a;
  --muted: #586085;
  --accent-ink: #a8620a;
  --shadow: 0 30px 60px -28px rgba(20, 26, 58, 0.35);
  color-scheme: light;
}

:root[data-accent="saffron"] { --accent: #f5b82e; --on-accent: #141a3a; }
:root[data-accent="red"]     { --accent: #ef4350; --on-accent: #ffffff; }
:root[data-accent="teal"]    { --accent: #2fcaa6; --on-accent: #0c1f1a; }
:root[data-accent="blue"]    { --accent: #5b86ff; --on-accent: #ffffff; }
:root[data-accent="pink"]    { --accent: #f25cbc; --on-accent: #ffffff; }
:root[data-theme="light"][data-accent="red"]  { --accent-ink: #c8202e; }
:root[data-theme="light"][data-accent="teal"] { --accent-ink: #0d8a6e; }
:root[data-theme="light"][data-accent="blue"] { --accent-ink: #2d57d8; }
:root[data-theme="light"][data-accent="pink"] { --accent-ink: #bb2785; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: clamp(15px, 0.35vw + 14px, 17px);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  overflow-x: clip;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Background: soft aurora + grain */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-fx .blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg-fx .b1 { width: 46vw; height: 46vw; left: -12vw; top: -10vw; background: color-mix(in oklab, var(--accent) 55%, transparent); opacity: 0.22; }
.bg-fx .b2 { width: 40vw; height: 40vw; right: -14vw; top: 30vh; background: #3b4cc0; opacity: 0.35; animation-delay: -8s; }
.bg-fx .b3 { width: 30vw; height: 30vw; left: 30vw; bottom: -14vw; background: var(--red); opacity: 0.14; animation-delay: -14s; }
:root[data-theme="light"] .bg-fx .b2 { opacity: 0.16; }
:root[data-theme="light"] .bg-fx .b1 { opacity: 0.25; }
.bg-fx::after {
  content: ""; position: absolute; inset: -50%;
  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)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.05; mix-blend-mode: overlay;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 4vh) scale(1.12); }
  100% { transform: translate(-4vw, -3vh) scale(0.95); }
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--bg); transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader svg { width: 110px; height: 110px; color: var(--accent); animation: spin 6s linear infinite; }
.preloader svg * { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.4s var(--ease) forwards; }
.preloader svg .rays line { animation-delay: 0.4s; }
.preloader p { margin-top: 18px; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.06em; color: var(--muted); text-align: center; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--red));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.5s var(--ease);
}
.header.is-scrolled {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}
.header.is-hidden { transform: translateY(-100%); }
.header .container { display: flex; align-items: center; gap: 18px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700;
  transition: transform 0.6s var(--ease-spring);
}
.logo:hover .logo-mark { transform: rotate(-12deg) scale(1.08); }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; }
.nav a {
  position: relative; display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; color: var(--muted); transition: color 0.3s;
}
.nav a::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%) scale(0); transition: transform 0.4s var(--ease-spring);
}
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a.is-active::after { transform: translateX(-50%) scale(1); }

.header-tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.lang a { padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background-color 0.3s, color 0.3s; }
.lang a:hover { color: var(--text); }
.lang a.is-current { background: var(--accent); color: var(--on-accent); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: transform 0.4s var(--ease-spring), background-color 0.3s, border-color 0.3s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-btn .fa-sun { display: none; }
:root[data-theme="light"] .theme-btn .fa-sun { display: inline-block; }
:root[data-theme="light"] .theme-btn .fa-moon { display: none; }
.theme-btn i { animation: pop 0.5s var(--ease-spring); }
@keyframes pop { from { transform: rotate(-90deg) scale(0.4); opacity: 0; } }

/* Accent palette popover */
.palette { position: relative; }
.palette-pop {
  position: absolute; right: 0; top: calc(100% + 10px); padding: 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; gap: 10px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.96); transform-origin: top right;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease), visibility 0.3s;
}
.palette.is-open .palette-pop { opacity: 1; visibility: visible; transform: none; }
.swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid transparent; outline: 2px solid transparent; transition: transform 0.3s var(--ease-spring); }
.swatch:hover { transform: scale(1.15); }
.swatch[aria-pressed="true"] { outline-color: var(--c); outline-offset: 2px; border-color: var(--bg-2); }

.burger { display: none; }
.burger span, .burger span::before, .burger span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative; transition: transform 0.4s var(--ease), background-color 0.2s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
body.menu-open .burger span { background: transparent; }
body.menu-open .burger span::before { transform: translateY(6px) rotate(45deg); }
body.menu-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 28px;
  clip-path: circle(0 at calc(100% - 40px) 38px); visibility: hidden;
  transition: clip-path 0.7s var(--ease), visibility 0.7s;
}
body.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 40px) 38px); visibility: visible; }
.mobile-menu ul { list-style: none; display: grid; gap: 4px; }
.mobile-menu li { overflow: hidden; }
.mobile-menu a.m-link {
  display: flex; align-items: baseline; gap: 14px; padding: 6px 0;
  font-family: var(--font-display); font-size: clamp(28px, 8vw, 44px); font-weight: 500; letter-spacing: -0.02em;
  transform: translateY(110%); transition: transform 0.6s var(--ease), color 0.3s;
}
.mobile-menu a.m-link small { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 500; }
.mobile-menu a.m-link.is-active { color: var(--accent-ink); }
body.menu-open .mobile-menu a.m-link { transform: none; }
body.menu-open .mobile-menu li:nth-child(1) a { transition-delay: 0.12s; }
body.menu-open .mobile-menu li:nth-child(2) a { transition-delay: 0.17s; }
body.menu-open .mobile-menu li:nth-child(3) a { transition-delay: 0.22s; }
body.menu-open .mobile-menu li:nth-child(4) a { transition-delay: 0.27s; }
body.menu-open .mobile-menu li:nth-child(5) a { transition-delay: 0.32s; }
.mobile-menu .lang { align-self: flex-start; }
.mobile-menu .m-foot { margin-top: auto; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  --bx: 0px; --by: 0px;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; font-weight: 600; font-size: 15px; line-height: 1;
  background: var(--accent); color: var(--on-accent); overflow: hidden; isolation: isolate;
  transform: translate(var(--bx), var(--by));
  transition: transform 0.35s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: 0 12px 30px -12px color-mix(in oklab, var(--accent) 70%, transparent);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.8s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }
.btn:hover { box-shadow: 0 18px 40px -12px color-mix(in oklab, var(--accent) 85%, transparent); }
.btn i { transition: transform 0.4s var(--ease-spring); }
.btn:hover i { transform: translateY(2px); }
.btn.btn-ghost:hover i, .btn.btn-arrow:hover i { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(70px, 9vw, 120px) 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 60px); max-width: 720px; }
.section-head .kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.section-head .kicker svg { width: 22px; height: 22px; }
.h2 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08;
  font-size: clamp(32px, 4.6vw, 58px);
}
.lead { color: var(--muted); font-size: clamp(16px, 1vw + 12px, 19px); max-width: 60ch; }

/* ---------- Hero ---------- */
.hero { overflow: hidden; overflow: clip; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 80px; }
.hero .container { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-greet { display: inline-flex; align-items: center; gap: 12px; padding: 7px 16px 7px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.hero-greet .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, #2fcaa6 25%, transparent); }
.hero-greet .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fcaa6; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 202, 166, 0.6); } 70% { box-shadow: 0 0 0 9px rgba(47, 202, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 202, 166, 0); } }

.hero-name {
  margin: 22px 0 18px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.045em; line-height: 0.95;
  font-size: clamp(44px, 7.6vw, 112px);
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-name .line + .line { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero-name .ch { display: inline-block; transform: translateY(110%); animation: rise 1s var(--ease) forwards; animation-delay: calc(0.9s + var(--i) * 0.035s); }
.no-anim .hero-name .ch { transform: none; animation: none; }
@keyframes rise { to { transform: none; } }

.hero-role { font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 1.6vw + 10px, 28px); letter-spacing: -0.01em; min-height: 1.5em; }
.hero-role .typed { color: var(--accent-ink); font-weight: 600; }
.hero-role .caret { display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-text { margin: 20px 0 32px; color: var(--muted); max-width: 52ch; font-size: clamp(16px, 0.6vw + 13px, 18.5px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: clamp(18px, 3vw, 40px); margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-facts div { display: grid; }
.hero-facts b { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.03em; }
.hero-facts > div > span { color: var(--muted); font-size: 14px; }

/* Hero visual: arch photo + tunduk */
.hero-visual { position: relative; justify-self: center; width: min(100%, 440px); }
.tunduk-ring { position: absolute; inset: -18%; color: var(--accent); opacity: 0.55; pointer-events: none; }
.tunduk-ring svg { width: 100%; height: 100%; animation: spin 60s linear infinite; }
.tunduk-ring svg * { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s var(--ease) 0.6s forwards; }
.no-anim .tunduk-ring svg * { stroke-dashoffset: 0; animation: none; }
.arch {
  position: relative; aspect-ratio: 3 / 4; border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  overflow: hidden; background: var(--bg-3); box-shadow: var(--shadow);
  clip-path: inset(100% 0 0 0 round 999px 999px 28px 28px);
  animation: unveil 1.4s var(--ease) 0.5s forwards;
  transform-style: preserve-3d;
}
.no-anim .arch { clip-path: none; animation: none; }
@keyframes unveil { to { clip-path: inset(0 0 0 0 round 999px 999px 28px 28px); } }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.15); animation: settle 2s var(--ease) 0.5s forwards; }
.no-anim .arch img { transform: none; animation: none; }
@keyframes settle { to { transform: scale(1.02); } }
.arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 19, 48, 0.45), transparent 40%); pointer-events: none; }

.chip {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: color-mix(in oklab, var(--bg-2) 82%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.chip i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 13px; }
.chip-1 { left: -14%; top: 22%; }
.chip-2 { right: -10%; bottom: 16%; animation-delay: -3s; }
.chip-2 i { background: var(--red); color: #fff; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 20px; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--accent); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee { position: relative; padding: 22px 0; border-block: 1px solid var(--line); overflow: hidden; background: color-mix(in oklab, var(--bg-2) 60%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 46px; padding-right: 46px; }
.marquee-group span { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: clamp(18px, 2vw, 26px); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; color: var(--muted); transition: color 0.3s; }
.marquee-group span:hover { color: var(--text); }
.marquee-group i { color: var(--accent); font-size: 0.9em; }
.marquee-group .sep { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0.6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.portrait { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; }
.portrait .sun { position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--accent) 85%, #fff), var(--accent) 45%, color-mix(in oklab, var(--accent) 60%, var(--red))); }
.portrait .rays { position: absolute; inset: 0; color: var(--accent); opacity: 0.7; animation: spin 50s linear infinite reverse; }
.portrait .rays svg { width: 100%; height: 100%; }
.portrait .cut {
  position: absolute; inset: 0; border-radius: 0 0 50% 50% / 0 0 46% 46%; overflow: hidden;
}
.portrait .cut img { position: absolute; left: 50%; bottom: 0; width: 82%; transform: translateX(-50%); filter: drop-shadow(0 20px 30px rgba(0,0,0,.25)); }
.portrait .badge {
  position: absolute; right: 2%; top: 8%; width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.2; color: var(--muted);
}
.portrait .badge b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--text); letter-spacing: -0.03em; }

.about-title { font-family: var(--font-display); font-size: clamp(22px, 2vw + 10px, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 16px; }
.about-title em { font-style: normal; color: var(--accent-ink); }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 30px 0 34px; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.info-list dt { color: var(--muted); }
.info-list dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.info-list dd a { transition: color 0.3s; }
.info-list dd a:hover { color: var(--accent-ink); }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fcaa6; box-shadow: 0 0 0 4px color-mix(in oklab, #2fcaa6 25%, transparent); }

/* Skills */
.skills { margin-top: clamp(60px, 8vw, 100px); display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(30px, 5vw, 80px); align-items: start; }
.skill-list { display: grid; gap: 26px; }
.skill-row { display: grid; gap: 10px; }
.skill-row header { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.skill-row header span { font-family: var(--font-display); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 70%, var(--red)), var(--accent)); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease); }
.bar i::after { content: ""; position: absolute; right: 0; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 30%, transparent); }
.skill-row.is-in .bar i { transform: scaleX(1); }
.bar { overflow: visible; }

/* ---------- Resume / timeline ---------- */
.resume-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 70px); }
.resume-col h3 { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 26px; }
.resume-col h3 i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 16px; }
.timeline { position: relative; display: grid; gap: 18px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline::after { content: ""; position: absolute; left: 7px; top: 8px; width: 2px; height: calc((100% - 16px) * var(--p, 0)); background: linear-gradient(var(--accent), var(--red)); transition: height 0.2s linear; }
.t-item { position: relative; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform 0.5s var(--ease), border-color 0.4s; }
.t-item:hover { transform: translateX(6px); border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.t-item::before { content: ""; position: absolute; left: -30px; top: 28px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); z-index: 1; transition: transform 0.4s var(--ease-spring); }
.t-item:hover::before { transform: scale(1.3); }
.t-date { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 8px; }
.t-item h4 { font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 8px; }
.t-item p { color: var(--muted); font-size: 15px; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.service {
  --mx: 50%; --my: 50%;
  position: relative; padding: 32px 28px 30px; border-radius: var(--radius-lg); overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.service::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
}
.service:hover { transform: translateY(-6px); border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.service:hover::before { opacity: 1; }
.service .ico {
  width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 26px;
  font-size: 22px; color: var(--accent-ink); background: color-mix(in oklab, var(--accent) 14%, transparent);
  transition: transform 0.6s var(--ease-spring), background-color 0.4s, color 0.4s;
}
.service:hover .ico { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: var(--on-accent); }
.service h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: 15px; }

/* ---------- Portfolio ---------- */
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 60px); }
.work-head .section-head { margin-bottom: 0; }
.work-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.work { grid-column: span 2; perspective: 1000px; }
.work-card {
  position: relative; display: block; width: 100%; text-align: left; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.6s var(--ease), border-color 0.4s;
  will-change: transform;
}
.work-card:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.browser-bar i:nth-child(1) { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: 10px; padding: 3px 12px; border-radius: 99px; background: var(--surface-2); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3); }
.shot img { position: absolute; left: 0; top: 0; width: 100%; height: auto; min-height: 100%; object-fit: cover; object-position: top; transition: transform 3.5s cubic-bezier(0.45, 0, 0.25, 1); }
.work-card:hover .shot img, .work-card:focus-visible .shot img { transform: translateY(var(--shift, 0px)); }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 13, 35, 0.85), transparent 55%); opacity: 0; transition: opacity 0.5s var(--ease); }
.work-card:hover .shot::after { opacity: 1; }
.work-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.work-meta h3 { font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.work-meta p { color: var(--muted); font-size: 14px; }
.work-meta .go { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); transition: background-color 0.4s, color 0.4s, transform 0.5s var(--ease-spring); }
.work-card:hover .go { background: var(--accent); color: var(--on-accent); transform: rotate(-45deg); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(6, 8, 24, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lb-inner { width: min(1100px, 100%); max-height: calc(100svh - 40px); display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); transform: translateY(30px) scale(0.96); transition: transform 0.6s var(--ease); }
.lightbox.is-open .lb-inner { transform: none; }
.lb-scroll { overflow: auto; overscroll-behavior: contain; }
.lb-scroll img { width: 100%; }
.lb-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lb-foot h3 { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.lb-foot p { color: var(--muted); font-size: 14px; }
.lb-actions { display: flex; gap: 8px; align-items: center; }
.lb-actions .btn { padding: 12px 20px; font-size: 14px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
.contact-list { display: grid; gap: 12px; }
.c-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform 0.5s var(--ease), border-color 0.4s; }
a.c-item:hover { transform: translateX(6px); border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.c-item .ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent-ink); font-size: 18px; transition: background-color 0.4s, color 0.4s; }
a.c-item:hover .ico { background: var(--accent); color: var(--on-accent); }
.c-item small { display: block; color: var(--muted); font-size: 13px; }
.c-item b { font-weight: 600; overflow-wrap: anywhere; }

.form { padding: clamp(22px, 3vw, 36px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { position: relative; display: grid; }
.field.full { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; padding: 22px 16px 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); outline: none; font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field label { position: absolute; left: 17px; top: 16px; color: var(--muted); font-size: 15.5px; pointer-events: none; transform-origin: left top; transition: transform 0.3s var(--ease), color 0.3s; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-9px) scale(0.78); color: var(--accent-ink); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--red); }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-foot p { color: var(--muted); font-size: 13.5px; max-width: 34ch; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.socials { display: flex; gap: 8px; }

/* ---------- Floating: to-top, toast, cursor ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none; transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-spring); }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.to-top circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: calc(151 - 151 * var(--p, 0)); stroke-linecap: round; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 400; max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 15px; box-shadow: var(--shadow); transform: translate(-50%, calc(100% + 40px)); visibility: hidden; transition: transform 0.6s var(--ease-spring), visibility 0.6s; }
.toast.is-show { transform: translate(-50%, 0); visibility: visible; }

.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity 0.3s; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1.5px solid color-mix(in oklab, var(--accent) 70%, transparent); transition: opacity 0.3s, width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.35s; }
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }
body.cursor-hover .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in oklab, var(--accent) 12%, transparent); }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
[data-reveal="up"] { transform: translateY(46px); }
[data-reveal="left"] { transform: translateX(-50px); }
[data-reveal="right"] { transform: translateX(50px); }
[data-reveal="scale"] { transform: scale(0.9); filter: blur(6px); }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* split heading words */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 0.9s var(--ease); transition-delay: calc(var(--wi) * 60ms); }
.split.is-in .w > span { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .header-tools { margin-left: auto; }
  .burger { display: grid; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work { grid-column: span 3; }
}
@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 36px); }
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { width: min(64vw, 320px); margin-top: 8px; order: -1; }
  .hero-copy { text-align: left; }
  .scroll-cue { display: none; }
  .about-grid, .skills, .resume-grid, .contact-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 380px; }
}
@media (max-width: 700px) {
  .header-tools .lang, .header-tools .palette { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .work { grid-column: auto; }
  .info-list { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .chip { font-size: 12.5px; padding: 8px 12px 8px 8px; }
  .chip i { width: 26px; height: 26px; font-size: 11px; }
  .chip-1 { left: -6%; top: 14%; }
  .chip-2 { right: -6%; bottom: 10%; }
  .hero-name .line + .line { -webkit-text-stroke-width: 1px; }
  .btn { padding: 14px 22px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .portrait .badge { width: 88px; height: 88px; font-size: 11px; }
  .portrait .badge b { font-size: 21px; }
  .to-top { right: 14px; bottom: 14px; width: 46px; height: 46px; }
}
@media (max-width: 380px) {
  .logo-text { display: none; }
  .hero-facts { gap: 16px; }
}
@media (hover: none) {
  .work-card .shot::after { opacity: 0.6; }
}

/* mobile palette inside menu */
.m-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.m-tools .swatches { display: flex; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal], .split .w > span { opacity: 1; transform: none; filter: none; }
  .hero-name .ch { transform: none; }
  .arch { clip-path: none; }
  .marquee-track { animation: none; }
}

main { overflow-x: hidden; overflow-x: clip; }
