/* ==========================================================================
   Sayka — portfolio
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #202024;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #6b6b74;
  --accent: #7c8cff;
  --accent-2: #c08cff;
  --on-accent: #0a0a0b;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 26px;
  --radius-sm: 16px;
  --gap: 16px;
  --gutter: 24px;
  --container: 1180px;
  --card-pad: 26px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

svg use, .ico { pointer-events: none; }
svg:not([fill]) { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.accent-text { color: var(--accent); transition: color .5s; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s linear infinite;
}
@keyframes gradShift { to { background-position: -200% 0; } }

.kicker {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.section-num { color: var(--accent); margin-right: 6px; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(circle 340px at var(--cx, 50%) var(--cy, 30%), #000 0%, transparent 100%), linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,0) 70%);
          mask-image: radial-gradient(circle 340px at var(--cx, 50%) var(--cy, 30%), #000 0%, transparent 100%), linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,0) 70%);
}
.bg__orb {
  position: absolute;
  width: 560px; height: 560px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .16;
  will-change: transform;
}
.bg__orb--1 { background: var(--accent); top: -180px; left: -120px; transform: translate3d(var(--ox, 0), var(--oy, 0), 0); transition: background .8s; }
.bg__orb--2 { background: var(--accent-2); bottom: -260px; right: -160px; animation: orbDrift 22s var(--ease-io) infinite alternate; transition: background .8s; }
@keyframes orbDrift { 50% { transform: translate(-30vw, -20vh) scale(1.2); } 100% { transform: translate(-10vw, -50vh) scale(.9); } }
.bg__noise {
  position: absolute; inset: -50%;
  opacity: .05;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s 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%); }
}

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; align-content: center; gap: 22px;
  background: var(--bg);
  transition: clip-path 1s var(--ease-io);
  clip-path: inset(0 0 0 0);
}
.preloader__name { display: flex; font-size: clamp(44px, 8vw, 84px); font-weight: 800; letter-spacing: -.04em; line-height: 1; overflow: hidden; padding-bottom: .08em; }
.preloader__name span { display: inline-block; transform: translateY(110%); animation: preUp .9s var(--ease) forwards; }
.preloader__name span:nth-child(2) { animation-delay: .05s; }
.preloader__name span:nth-child(3) { animation-delay: .1s; }
.preloader__name span:nth-child(4) { animation-delay: .15s; }
.preloader__name span:nth-child(5) { animation-delay: .2s; }
.preloader__name span:nth-child(6) { animation-delay: .25s; }
@keyframes preUp { to { transform: translateY(0); } }
.preloader__bar { width: 180px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.preloader__bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(var(--p, 0)); }
.preloader__count { font: 500 12px var(--mono); color: var(--dim); letter-spacing: .1em; }
.is-loaded .preloader { clip-path: inset(0 0 100% 0); }
.is-loaded .preloader > * { opacity: 0; transform: translateY(-30px); transition: opacity .5s, transform .6s var(--ease); }

/* ---------- Cursor ---------- */
.cursor, .cursor-ring { display: none; }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor .cursor, .has-cursor .cursor-ring {
  display: block;
  position: fixed; top: 0; left: 0; z-index: 90;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s;
}
.has-cursor.cursor-visible .cursor, .has-cursor.cursor-visible .cursor-ring { opacity: 1; }
.cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(255,255,255,.35);
  display: grid !important; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s, opacity .3s;
}
.cursor-ring__label { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--on-accent); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.cursor-ring.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cursor-ring.is-label { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: var(--accent); border-color: var(--accent); }
.cursor-ring.is-label .cursor-ring__label { opacity: 1; }
.cursor-ring.is-text { width: 3px; height: 26px; margin: -13px 0 0 -1px; border-radius: 2px; background: var(--accent); border-color: transparent; }
.cursor-ring.is-down { transform: scale(.8); }

/* ---------- Progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(var(--progress, 0)); }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 18px 0;
  transition: transform .5s var(--ease), padding .4s var(--ease), background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled { padding: 10px 0; background: rgba(10, 10, 11, .72); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-color: var(--border); }
.header.is-hidden { transform: translateY(-100%); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.logo--lg { font-size: 40px; }

.nav { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: 999px; }
.nav__link { position: relative; z-index: 1; padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--muted); border-radius: 999px; transition: color .3s; }
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  width: var(--w, 0); transform: translateX(var(--x, 0));
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s;
}

.header__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-btn { font: 600 12px var(--mono); letter-spacing: .04em; }
.accent-dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); box-shadow: 0 0 14px var(--accent); transition: transform .5s var(--ease); }
#accentBtn:hover .accent-dot { transform: rotate(180deg) scale(1.15); }

.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px;
  transition: background .3s, color .3s, transform .4s var(--ease);
}
.btn--pill { padding: 10px 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); overflow: hidden; }
.btn--pill::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn--pill span { position: relative; z-index: 1; display: inline-block; transition: color .3s; }
.btn--pill:hover::before { transform: translateY(0); }
.btn--pill:hover span { color: var(--on-accent); }

.burger { display: none; }
.burger span { position: absolute; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease); }
.burger span:first-child { transform: translateY(-3px); }
.burger span:last-child { transform: translateY(3px); }
.burger[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; align-items: center;
  padding: 100px 24px 40px;
  background: rgba(10, 10, 11, .96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  clip-path: circle(0 at calc(100% - 44px) 38px);
  transition: clip-path .7s var(--ease-io);
}
.mobile-menu.is-open { clip-path: circle(150% at calc(100% - 44px) 38px); }
.mobile-menu[hidden] { display: none; }
.mobile-menu__nav { display: grid; gap: 8px; width: 100%; }
.mobile-menu__nav a {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(40px, 12vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1.15;
  opacity: 0; transform: translateY(30px);
  transition: opacity .5s, transform .6s var(--ease), color .3s;
}
.mobile-menu__nav a small { font: 500 12px var(--mono); color: var(--accent); letter-spacing: .1em; }
.mobile-menu.is-open .mobile-menu__nav a { opacity: 1; transform: none; transition-delay: calc(.2s + var(--i) * .07s); }
.mobile-menu__nav a:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.section { position: relative; padding: 64px 0; scroll-margin-top: 40px; }
.hero { padding-top: 112px; }
.section-head { margin-bottom: 36px; display: grid; gap: 14px; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.section-head__main { display: grid; gap: 14px; }
.filters { flex: none; }
.section-title { font-size: clamp(36px, 6vw, 72px); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; max-width: 16ch; }
.section-title em { font-style: normal; color: var(--accent); transition: color .5s; }

/* Word split reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.w__i { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.is-in .w__i { transform: translateY(0); }

/* Reveal */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { animation: reveal 1s var(--ease) var(--d, 0s) both; }
@keyframes reveal {
  from { opacity: 0; translate: 0 40px; scale: .97; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}

/* ---------- Bento ---------- */
.bento { display: grid; gap: var(--gap); }
.bento--hero {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 58px minmax(230px, auto) minmax(230px, auto) minmax(230px, auto);
  grid-template-areas:
    "profile profile marquee marquee"
    "profile profile cred proj"
    "stack services services profiles"
    "stats stats cta cta";
}

/* ---------- Card ---------- */
.card {
  --mx: -500px; --my: -500px;
  position: relative;
  isolation: isolate;
  display: flex; flex-direction: column;
  min-width: 0;
  padding: var(--card-pad);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 55%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 30px 60px -40px rgba(0,0,0,.9);
  transform-style: preserve-3d;
  transition: transform .7s var(--ease), border-color .4s;
}
.card.is-tilting { transition: transform .15s linear, border-color .4s; }
/* inner spotlight */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 13%, transparent), transparent 45%);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
/* border glow (lights up neighbours too) */
.card::after {
  content: ""; position: absolute; inset: -1px; z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 75%, transparent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
[data-glow]:hover .card::after, .card:hover::after { opacity: 1; }

.card__visual { position: relative; flex: 1; display: grid; place-items: center; min-height: 110px; }
.card__foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; }
.card__head { display: grid; gap: 8px; }
.card__title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 6px; }
.card__text { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* Arrow button (circle with tail) */
.arrow-btn {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  transition: background .4s var(--ease), border-color .4s, color .3s, transform .5s var(--ease);
}
.arrow-btn::before {
  content: ""; position: absolute; right: calc(100% - 8px); top: 50%;
  width: 22px; height: 1px; background: var(--border-strong);
  transition: width .5s var(--ease), background .4s;
}
.arrow-btn svg { width: 16px; height: 16px; transition: transform .5s var(--ease); }
.card:hover .arrow-btn, .arrow-btn:hover, .arrow-btn:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card:hover .arrow-btn svg, .arrow-btn:hover svg { transform: rotate(-45deg); }
.card:hover .arrow-btn::before { width: 32px; background: var(--accent); }
.arrow-btn--corner { position: absolute; right: var(--card-pad); bottom: var(--card-pad); }

/* ---------- Profile card ---------- */
.card--profile { grid-area: profile; flex-direction: row; align-items: center; gap: 28px; }
.profile__photo {
  position: relative; flex: none;
  width: clamp(150px, 17vw, 210px); aspect-ratio: 1;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 20px 50px -20px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateZ(30px);
}
.profile__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); transition: filter .7s var(--ease), transform 1s var(--ease); }
.profile__photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  mix-blend-mode: color; opacity: .65;
  transition: opacity .7s var(--ease);
}
.card--profile:hover .profile__photo img { filter: grayscale(0) contrast(1); transform: scale(1.06); }
.card--profile:hover .profile__photo::after { opacity: 0; }

.status {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  font: 500 10px/1.2 var(--mono); letter-spacing: .04em;
  background: rgba(10,10,11,.75);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.1);
}
.status i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.status i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80; animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 70%, 100% { transform: scale(2.6); opacity: 0; } }
.status[hidden] { display: none; }

.profile__info { display: grid; gap: 10px; min-width: 0; padding-right: 30px; transform: translateZ(20px); }
.profile__name { font-size: clamp(38px, 4.4vw, 56px); font-weight: 800; letter-spacing: -.05em; line-height: .95; }
.profile__text { color: var(--muted); font-size: 15px; min-height: 1.6em; }
.typed { color: var(--text); font-weight: 600; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.profile__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--dim); font-size: 13px; }
.profile__meta li { display: inline-flex; align-items: center; gap: 6px; }
.ico { width: 15px; height: 15px; }

/* ---------- Marquee ---------- */
.card--marquee { grid-area: marquee; padding: 0; justify-content: center; border-radius: 20px; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--reverse .marquee__track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee__item {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 0 14px;
  font: 500 11px/58px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.marquee__item b { color: var(--text); font-weight: 600; }
.marquee__item i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---------- Credentials (signature) ---------- */
.card--cred { grid-area: cred; }
.signature { width: 88%; max-width: 210px; color: var(--text); }
.signature path { stroke: currentColor; stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.signature__under { stroke: var(--accent) !important; stroke-width: 1.6 !important; }
.is-in .signature path { animation: draw 2.4s var(--ease-io) .4s forwards; }
.is-in .signature .signature__under { animation-delay: 1.9s; animation-duration: 1s; }
.signature.redraw path { animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Projects mini window ---------- */
.card--proj { grid-area: proj; }
.proj__bg {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  font-size: 28px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.14);
  transition: -webkit-text-stroke-color .5s, letter-spacing .7s var(--ease);
}
.card--proj:hover .proj__bg { -webkit-text-stroke-color: color-mix(in srgb, var(--accent) 60%, transparent); letter-spacing: .04em; }
.mini-window {
  position: relative; z-index: 1;
  width: min(100%, 176px);
  margin-top: 26px;
  border-radius: 10px;
  background: #0d0d0f;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 40px -20px rgba(0,0,0,.9), 0 0 0 4px rgba(255,255,255,.02);
  overflow: hidden;
  transform: rotate(-4deg) translateZ(40px);
  transition: transform .7s var(--ease);
}
.card--proj:hover .mini-window { transform: rotate(0) scale(1.06) translateZ(40px); }
.mini-window__bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mini-window__bar i { width: 6px; height: 6px; border-radius: 50%; background: #ff5f57; }
.mini-window__bar i:nth-child(2) { background: #febc2e; }
.mini-window__bar i:nth-child(3) { background: #28c840; }
.mini-window__title { margin-left: 6px; font: 500 8px var(--mono); color: var(--dim); }
.mini-window__screens { position: relative; height: 92px; }
.screen {
  position: absolute; inset: 0; padding: 8px 10px;
  font: 500 8.5px/1.55 var(--mono); color: var(--muted);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s, transform .6s var(--ease);
}
.screen.is-active { opacity: 1; transform: none; }
.screen b { color: var(--accent); }
.screen .dim { color: var(--dim); }
.screen em { font-style: normal; color: #28c840; }
.screen .blink { animation: blink 1s steps(1) infinite; color: var(--accent); }
.screen--grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.screen--grid i { border-radius: 4px; background: linear-gradient(145deg, var(--surface-3), #141418); position: relative; overflow: hidden; }
.screen--grid i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.09), transparent 70%); animation: shimmer 1.6s infinite; }
.screen--grid i:nth-child(2) { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 50%, #111), #141418); }
.screen--grid i:nth-child(6) { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-2) 45%, #111), #141418); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.screen--json s { text-decoration: none; color: #febc2e; }
.screen--json u { text-decoration: none; color: var(--accent); }

/* ---------- Stack shapes ---------- */
.card--stack { grid-area: stack; }
.shapes { width: 120px; overflow: visible; }
.shape { transform-box: fill-box; transform-origin: center; transition: transform .8s var(--ease), fill .5s; stroke: none; }
.shape--1 { fill: #ef4444; animation: float 5s ease-in-out infinite; }
.shape--2 { fill: #facc15; animation: float 6s ease-in-out -1s infinite; }
.shape--3 { fill: var(--accent); }
.shape--4 { fill: color-mix(in srgb, var(--accent) 80%, #3b82f6); }
.shape--5 { fill: #f87171; mix-blend-mode: multiply; opacity: .9; animation: float 7s ease-in-out -2s infinite; }
@keyframes float { 50% { translate: 0 -5px; } }
.card--stack:hover .shape--1 { transform: translate(60px, 36px) scale(1.2); }
.card--stack:hover .shape--2 { transform: rotate(-20deg) translate(4px, -6px); }
.card--stack:hover .shape--3 { transform: translateX(-34px) rotate(-8deg); }
.card--stack:hover .shape--4 { transform: translateX(-14px) rotate(6deg); }
.card--stack:hover .shape--5 { transform: translate(-56px, -38px) scale(.6); }

/* ---------- Services ---------- */
.card--services { grid-area: services; }
.services { display: flex; justify-content: center; align-items: center; gap: clamp(14px, 4vw, 44px); }
.service {
  position: relative;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 18px;
  color: var(--text);
  transition: transform .5s var(--ease), background .4s, color .3s, box-shadow .4s;
}
.service > svg { width: 28px; height: 28px; stroke-width: 1.5; }
.service:hover, .service:focus-visible, .service.is-hot {
  transform: translateY(-6px);
  background: var(--surface-3);
  color: var(--accent);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 0 0 1px var(--border-strong);
}
.tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  padding: 6px 10px; border-radius: 8px;
  font: 500 11px var(--mono); white-space: nowrap; color: var(--on-accent);
  background: var(--accent);
  opacity: 0; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease);
}
.tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--accent); }
.service:hover .tip, .service:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Profiles ---------- */
.card--profiles { grid-area: profiles; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.social {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1d1d21, #131316);
  box-shadow: 6px 6px 16px rgba(0,0,0,.55), -4px -4px 12px rgba(255,255,255,.025), inset 0 1px 0 rgba(255,255,255,.05);
  color: var(--text);
  transition: color .3s, box-shadow .4s, transform .5s var(--ease);
}
.social svg { width: 24px; height: 24px; }
.social:hover { color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------- Stats ---------- */
.card--stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.stat {
  display: grid; place-items: center; align-content: center; gap: 10px;
  padding: 24px 8px; text-align: center;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: transform .5s var(--ease), border-color .4s, background .4s;
}
.stat:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--surface-3); }
.stat__num { font-size: clamp(32px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { font: 500 10px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

/* ---------- CTA ---------- */
.card--cta { grid-area: cta; justify-content: flex-end; padding: 30px; }
.cta__spark { position: absolute; top: 0; left: 40px; display: grid; justify-items: center; color: var(--muted); }
.cta__spark::before { content: ""; width: 1px; height: 34px; background: linear-gradient(transparent, var(--border-strong)); }
.cta__spark svg { width: 26px; height: 26px; margin-top: -2px; stroke-width: 1.2; animation: spin 12s linear infinite; transition: color .4s; }
.card--cta:hover .cta__spark svg { color: var(--accent); animation-duration: 2.5s; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta__title { font-size: clamp(36px, 4.2vw, 54px); font-weight: 600; letter-spacing: -.04em; line-height: 1.04; margin-top: 50px; padding-right: 60px; }
.card--cta .arrow-btn { position: absolute; right: 30px; bottom: 30px; }

/* ---------- About bento ---------- */
.bento--about {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "bio bio term term"
    "tech tech term term"
    "s1 s2 s3 s4"
    "time time time time";
}
.card--bio { grid-area: bio; gap: 14px; padding: 32px; }
.bio__lead { font-size: clamp(19px, 1.9vw, 23px); font-weight: 500; line-height: 1.45; letter-spacing: -.015em; }
.bio__text { color: var(--muted); font-size: 15px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; width: fit-content; font-weight: 600; font-size: 14px; color: var(--accent); }
.link-arrow svg { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.link-arrow:hover svg { transform: translate(3px, -3px); }
.link-arrow span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.link-arrow:hover span { background-size: 100% 1px; }

.card--techstack { grid-area: tech; gap: 22px; padding: 28px 0; }
.card--techstack .card__head { padding: 0 28px; }
.pills { display: grid; gap: 10px; }
.marquee--pills .marquee__track { gap: 10px; padding-right: 10px; --dur: 30s; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .3s, color .3s, background .3s;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.pill:hover { border-color: var(--accent); color: var(--accent); }

.card--svc { gap: 10px; padding: 24px; }
.card--svc:nth-of-type(4) { grid-area: s1; }
.card--svc:nth-of-type(5) { grid-area: s2; }
.card--svc:nth-of-type(6) { grid-area: s3; }
.card--svc:nth-of-type(7) { grid-area: s4; }
.svc__icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-bottom: 8px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--accent);
  transition: transform .6s var(--ease), background .4s, color .4s;
}
.svc__icon svg { width: 24px; height: 24px; }
.card--svc:hover .svc__icon { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: var(--on-accent); }
.card--svc .card__title { font-size: 18px; margin: 0; }

/* Terminal */
.card--terminal { grid-area: term; padding: 0; overflow: hidden; background: #0c0c0e; min-height: 440px; }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.term__bar > i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar > i:nth-child(2) { background: #febc2e; }
.term__bar > i:nth-child(3) { background: #28c840; }
.term__title { margin-left: 10px; font: 500 12px var(--mono); color: var(--dim); }
.term__hint { margin-left: auto; font: 500 11px var(--mono); color: var(--dim); }
kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; font: 500 11px var(--mono); text-align: center; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-strong); }
.term__body { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px 18px 18px; font: 400 13px/1.7 var(--mono); cursor: text; }
.term__out { flex: 0 1 auto; min-height: 0; max-height: 380px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.t-line { white-space: pre-wrap; word-break: break-word; color: var(--muted); animation: tIn .35s var(--ease) both; }
@keyframes tIn { from { opacity: 0; transform: translateY(4px); } }
.t-line b { color: var(--text); font-weight: 500; }
.t-cmd { color: var(--text); }
.t-cmd::before { content: "➜ ~ "; color: var(--accent); }
.t-accent { color: var(--accent); }
.t-ok { color: #4ade80; }
.t-err { color: #f87171; }
.t-dim { color: var(--dim); }
.t-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0 18px; }
.t-neo { display: flex; gap: 22px; flex-wrap: wrap; }
.t-neo pre { color: var(--accent); font: inherit; line-height: 1.25; margin-top: 4px; }
.t-swatch { display: inline-block; width: 18px; height: 10px; margin-right: 3px; border-radius: 2px; }
.t-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.term__line { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.term__prompt { color: var(--accent); white-space: nowrap; }
.term__prompt b { color: #4ade80; font-weight: 500; }
.term__line input { flex: 1; min-width: 0; outline: none; caret-color: var(--accent); font: inherit; color: var(--text); }

/* Timeline */
.card--timeline { grid-area: time; gap: 30px; padding: 32px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--border-strong); }
.timeline::after { background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(0); transition: transform 2s var(--ease-io) .3s; }
.is-in .timeline::after { transform: scaleX(1); }
.timeline li { position: relative; display: grid; gap: 6px; padding-top: 32px; }
.timeline li::before {
  content: ""; position: absolute; top: 0; left: 0; z-index: 1;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
  transition: border-color .4s, background .4s, transform .5s var(--ease);
  transition-delay: calc(.4s + var(--i) * .35s);
}
.is-in .timeline li::before { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 30%, var(--bg)); }
.timeline li:hover::before { transform: scale(1.4); transition-delay: 0s; }
.tl__year { font: 600 13px var(--mono); color: var(--accent); letter-spacing: .06em; }
.tl__title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.tl__text { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ---------- Works ---------- */
.filters {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.filters__indicator {
  position: absolute; top: 0; left: 0; height: var(--h, 0);
  width: var(--w, 0); transform: translate(var(--x, 0), var(--y, 0));
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform .5s var(--ease), width .5s var(--ease);
}
.filter { position: relative; z-index: 1; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .3s; }
.filter:hover { color: var(--text); }
.filter.is-active { color: var(--on-accent); }

.works-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); grid-auto-flow: dense; }
.project { padding: 0; overflow: hidden; }
.project[hidden] { display: none; }
.project--featured { grid-column: span 2; }
.project__visual {
  position: relative;
  height: 210px;
  margin: 10px 10px 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    #0e0e11;
  border: 1px solid var(--border);
}
.project__visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
          mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
  pointer-events: none;
}
.project__badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  padding: 4px 10px; border-radius: 999px;
  font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent);
}
.project__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px 22px 22px; }
.project__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 500 12px var(--mono); color: var(--dim); }
.lang { display: inline-flex; align-items: center; gap: 7px; }
.lang i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.stars { display: inline-flex; align-items: center; gap: 5px; }
.stars svg { width: 13px; height: 13px; }
.stars[hidden] { display: none; }
.project__title { font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.project__desc { color: var(--muted); font-size: 14px; line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 4px 10px; border-radius: 999px; font: 500 11px var(--mono); color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); }
.project__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong);
  transition: background .3s, color .3s, border-color .3s;
}
.chip-link svg { width: 14px; height: 14px; transition: transform .4s var(--ease); }
.chip-link:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-link:hover svg { transform: translate(2px, -2px); }
.chip-link--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-link--accent:hover { background: var(--text); border-color: var(--text); }

/* Project "more" card */
.project--more { justify-content: center; align-items: flex-start; gap: 14px; padding: 30px 30px 80px; min-height: 260px; }
.project--more .arrow-btn { position: absolute; right: 26px; bottom: 26px; }
.project--more .more__icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); transition: transform .6s var(--ease), background .4s, color .4s; }
.project--more .more__icon svg { width: 26px; height: 26px; }
.project--more:hover .more__icon { transform: rotate(360deg); background: var(--accent); color: var(--on-accent); }
.project--more .project__title { font-size: 26px; }

/* Visual: terminal */
.v-term { position: absolute; inset: 18px 18px 0; padding: 14px 16px; border-radius: 12px 12px 0 0; background: rgba(8,8,10,.9); border: 1px solid var(--border-strong); border-bottom: 0; font: 500 12px/1.75 var(--mono); color: var(--muted); z-index: 1; transform: translateY(14px); transition: transform .7s var(--ease); }
.project:hover .v-term { transform: translateY(0); }
.v-term p { white-space: pre; overflow: hidden; width: 0; animation: typeLine .7s steps(24) forwards; animation-delay: calc(var(--i) * .55s); animation-play-state: paused; }
.is-in .v-term p { animation-play-state: running; }
.v-term p:first-child, .v-term p.cmd { color: var(--text); }
.v-term p .p { color: var(--accent); }
@keyframes typeLine { to { width: 100%; } }

/* Visual: grid */
.v-grid { position: absolute; inset: 22px; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 10px; z-index: 1; transform: perspective(700px) rotateX(18deg) rotateZ(-6deg) scale(1.05); transition: transform .9s var(--ease); }
.project:hover .v-grid { transform: perspective(700px) rotateX(0) rotateZ(0) scale(1); }
.v-grid i { position: relative; border-radius: 10px; background: linear-gradient(160deg, var(--surface-3), #121215); border: 1px solid var(--border); overflow: hidden; animation: tilePop .6s var(--ease) both; animation-delay: calc(var(--i) * 60ms); animation-play-state: paused; }
.is-in .v-grid i { animation-play-state: running; }
.v-grid i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.07), transparent 70%); animation: shimmer 2.2s infinite; animation-delay: calc(var(--i) * 120ms); }
.v-grid i.a { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 65%, #111), #15151a); }
.v-grid i.b { background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 55%, #111), #15151a); }
@keyframes tilePop { from { opacity: 0; transform: scale(.6); } }

/* Visual: chat */
.v-chat { position: absolute; inset: 20px 22px; display: flex; flex-direction: column; justify-content: center; gap: 10px; z-index: 1; }
.v-chat span { max-width: 80%; padding: 9px 14px; border-radius: 16px; font: 500 12.5px var(--mono); width: fit-content; opacity: 0; animation: bubble .6s var(--ease) both; animation-delay: calc(.3s + var(--i) * .7s); animation-play-state: paused; }
.is-in .v-chat span { animation-play-state: running; }
.v-chat span:nth-child(odd) { background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-left-radius: 4px; }
.v-chat span:nth-child(even) { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.v-chat .typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.v-chat .typing b { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.v-chat .typing b:nth-child(2) { animation-delay: .15s; }
.v-chat .typing b:nth-child(3) { animation-delay: .3s; }
@keyframes bubble { from { opacity: 0; transform: translateY(12px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes typing { 30% { transform: translateY(-4px); opacity: 1; } 0%, 60%, 100% { opacity: .4; } }

/* Visual: scan */
.v-scan { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 16px; padding: 22px; z-index: 1; }
.v-scan__frame { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 35%, #101014), color-mix(in srgb, var(--accent-2) 25%, #0c0c0f)); border: 1px solid var(--border-strong); }
.v-scan__frame::before { content: ""; position: absolute; left: 14%; bottom: 0; width: 34%; height: 70%; border-radius: 50% 50% 0 0; background: rgba(0,0,0,.35); }
.v-scan__frame::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; top: 0; background: var(--accent); box-shadow: 0 0 16px 2px var(--accent); animation: scan 2.2s var(--ease-io) infinite alternate; }
@keyframes scan { to { top: calc(100% - 2px); } }
.v-scan__json { font: 500 11.5px/1.7 var(--mono); color: var(--muted); }
.v-scan__json u { text-decoration: none; color: var(--accent); }
.v-scan__json s { text-decoration: none; color: #febc2e; }

/* Visual: chart */
.v-chart { position: absolute; inset: 26px 26px 20px; display: flex; align-items: flex-end; gap: 8px; z-index: 1; }
.v-chart i { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 25%, transparent), var(--accent)); transform-origin: bottom; transform: scaleY(0); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.v-chart i:nth-child(3n) { background: linear-gradient(to top, color-mix(in srgb, var(--accent-2) 25%, transparent), var(--accent-2)); }
.is-in .v-chart i { transform: scaleY(1); }
.project:hover .v-chart i { animation: bars 1.4s var(--ease-io) infinite alternate; animation-delay: calc(var(--i) * -.2s); }
@keyframes bars { to { transform: scaleY(.55); } }

/* Visual: links */
.v-links { position: absolute; inset: 0; display: grid; place-content: center; gap: 9px; z-index: 1; }
.v-links .ava { width: 42px; height: 42px; margin: 0 auto 4px; border-radius: 50%; background: linear-gradient(145deg, var(--accent), var(--accent-2)); }
.v-links span { width: 190px; height: 28px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: transform .5s var(--ease), background .4s; transition-delay: calc(var(--i) * 60ms); }
.project:hover .v-links span { transform: translateX(8px); }
.project:hover .v-links span:nth-child(odd) { transform: translateX(-8px); }
.v-links span:nth-of-type(2) { background: color-mix(in srgb, var(--accent) 35%, var(--surface-3)); }

/* ---------- Contact ---------- */
.card--contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main orb" "meta meta";
  gap: 40px;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
}
.card--contact::before { opacity: 1; background: radial-gradient(600px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 12%, transparent), transparent 50%); }
.contact__main { grid-area: main; display: grid; gap: 22px; align-content: start; }
.contact__title { font-size: clamp(40px, 7vw, 92px); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.contact__text { max-width: 52ch; color: var(--muted); font-size: 16px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 10px; }
.contact__links a { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border-strong); transition: background .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.contact__links a svg { width: 18px; height: 18px; }
.contact__links a:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-3px); }
.contact__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 16px 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.contact__meta div { display: grid; gap: 6px; }
.contact__meta b { font: 500 20px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.orb-btn { grid-area: orb; position: relative; align-self: center; width: 210px; height: 210px; display: grid; place-items: center; border-radius: 50%; transition: transform .6s var(--ease); }
.orb-btn__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 18s linear infinite; }
.orb-btn__ring text { fill: var(--muted); stroke: none; font: 500 11px var(--mono); }
.orb-btn__core {
  position: relative;
  display: grid; place-items: center; align-content: center; gap: 6px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 700; font-size: 15px;
  box-shadow: 0 20px 60px -15px var(--accent);
  transition: transform .6s var(--ease), box-shadow .5s;
}
.orb-btn__core svg { width: 20px; height: 20px; stroke-width: 2; transition: transform .5s var(--ease); }
.orb-btn:hover .orb-btn__core { transform: scale(1.1); box-shadow: 0 24px 80px -10px var(--accent); }
.orb-btn:hover .orb-btn__core svg { transform: rotate(45deg); }
.orb-btn:hover .orb-btn__ring { animation-duration: 6s; }

/* ---------- Footer ---------- */
.footer { padding: 72px 0 48px; }
.footer__inner { position: relative; display: grid; justify-items: center; gap: 22px; text-align: center; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.footer__nav a { font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.footer__nav a:hover { color: var(--accent); }
.footer__copy { font-size: 13px; color: var(--dim); }
.to-top { position: absolute; right: var(--gutter); top: 0; }
.to-top:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  background: var(--text); color: var(--bg);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.6);
  transform: translate(-50%, 120px); opacity: 0;
  transition: transform .6s var(--ease), opacity .4s;
  pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.noscript { color: var(--muted); }
.noscript a { color: var(--accent); }

/* Accent flash when switching colour */
.accent-flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle at var(--fx, 50%) var(--fy, 0%), var(--accent), transparent 60%); opacity: 0; animation: flash .9s var(--ease) forwards; }
@keyframes flash { 20% { opacity: .22; } 100% { opacity: 0; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .nav__link { padding: 8px 12px; }
  .card--profile { flex-direction: column; align-items: flex-start; }
  .profile__info { padding-right: 50px; }
}

@media (max-width: 900px) {
  .nav, .header__cta { display: none; }
  .burger { display: grid; }

  .bento--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-template-areas:
      "profile profile"
      "marquee marquee"
      "cred proj"
      "stack profiles"
      "services services"
      "stats stats"
      "cta cta";
  }
  .card--profile { flex-direction: row; align-items: center; }
  .card--marquee { height: 58px; }
  .card--cred, .card--proj, .card--stack, .card--profiles, .card--services { min-height: 230px; }
  .card--cta { min-height: 240px; }

  .bento--about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "bio bio"
      "term term"
      "tech tech"
      "s1 s2"
      "s3 s4"
      "time time";
  }
  .card--terminal { min-height: 420px; }
  .timeline { grid-template-columns: 1fr; gap: 22px; padding-left: 32px; }
  .timeline::before, .timeline::after { left: 7px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .timeline::after { transform-origin: top; transform: scaleY(0); }
  .is-in .timeline::after { transform: scaleY(1); }
  .timeline li { padding-top: 0; }
  .timeline li::before { left: -32px; top: 2px; }

  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .card--contact { grid-template-columns: 1fr; grid-template-areas: "main" "orb" "meta"; }
  .orb-btn { justify-self: start; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --gap: 12px; --radius: 22px; }
  .section { padding: 48px 0; }
  .hero { padding-top: 88px; }
  .logo { font-size: 22px; }
  .icon-btn { width: 38px; height: 38px; }

  .bento--hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "profile" "marquee" "cred" "proj" "stack" "profiles" "services" "stats" "cta";
  }
  :root { --card-pad: 22px; }
  .card--profile { flex-direction: column; align-items: flex-start; gap: 22px; }
  .profile__photo { width: 100%; max-width: none; aspect-ratio: 4 / 3; }
  .profile__info { padding-right: 0; }
  .card--cred, .card--proj, .card--stack, .card--profiles, .card--services { min-height: 210px; }
  .services { gap: 6px; }
  .service { width: 54px; height: 54px; }
  .card--stats { gap: 8px; padding: 12px; }
  .stat { padding: 20px 4px; }
  .stat__label { font-size: 9px; letter-spacing: .08em; }
  .cta__title { padding-right: 48px; }
  .card--cta .arrow-btn { right: 22px; bottom: 22px; }

  .bento--about { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bio" "term" "tech" "s1" "s2" "s3" "s4" "time"; }
  .card--bio, .card--timeline { padding: 24px; }
  .card--techstack { padding: 24px 0; }
  .card--techstack .card__head { padding: 0 24px; }
  .term__hint { display: none; }
  .term__body { font-size: 12.5px; padding: 14px; }
  .term__line input { font-size: 16px; }

  .section-head--row { align-items: flex-start; }
  .filters { width: 100%; justify-content: space-between; }
  .filter { padding: 8px 12px; font-size: 13px; }
  .works-grid { grid-template-columns: minmax(0, 1fr); }
  .project--featured { grid-column: auto; }
  .project__visual { height: 190px; }

  .orb-btn { width: 180px; height: 180px; justify-self: center; }
  .orb-btn__core { width: 104px; height: 104px; }
  .contact__meta { gap: 16px 32px; }
  .to-top { position: static; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; }
  .w__i { transform: none; }
  .marquee__track { animation: none !important; }
  .bg__noise { animation: none; }
}
