/* =========================================================
   Aathan A — fluid liquid-glass portfolio
   ========================================================= */

/* ---------- tokens ---------- */
:root {
  --sky-1: #cddff4;
  --sky-2: #e6e2f2;
  --sky-3: #f7dccb;
  --sky-4: #d8e6f5;

  --ink:        #16161d;
  --ink-soft:   #4a4a58;
  --ink-softer: #7b7b8c;

  --glass:        rgba(255, 255, 255, 0.46);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-brd:    rgba(255, 255, 255, 0.62);
  --glass-hi:     rgba(255, 255, 255, 0.85);
  --glass-sh:     0 26px 60px -26px rgba(26, 30, 74, 0.42);

  --accent:  #241b6e;
  --accent-2:#ff8a4c;
  --on-accent: #ffffff;

  --pane:     rgba(255, 255, 255, 0.58);
  --pane-hi:  rgba(255, 255, 255, 0.74);
  --shell-bg: rgba(255, 255, 255, 0.16);
  --page-bg:  #d9dfe6;

  --r-shell: 46px;
  --r-lg: 34px;
  --r-md: 24px;
  --r-sm: 16px;

  --blur: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-fluid: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --vel: 0;          /* scroll velocity, set from JS */
  --pointer: 0;      /* 1 when a fine pointer is present */
}

:root[data-theme="dark"] body { background-blend-mode: luminosity; background-color: #0c0e1a; }

:root[data-theme="dark"] {
  --sky-1: #131a33;
  --sky-2: #1d1740;
  --sky-3: #33203c;
  --sky-4: #101728;

  --ink:        #f2f3fb;
  --ink-soft:   #bcbfd6;
  --ink-softer: #9296b4;

  --glass:        rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-brd:    rgba(255, 255, 255, 0.14);
  --glass-hi:     rgba(255, 255, 255, 0.22);
  --glass-sh:     0 30px 70px -30px rgba(0, 0, 0, 0.75);

  --accent:  #b9b2ff;
  --accent-2:#ffab7a;
  --on-accent: #14102e;

  --pane:     rgba(255, 255, 255, 0.075);
  --pane-hi:  rgba(255, 255, 255, 0.13);
  --shell-bg: rgba(255, 255, 255, 0.04);
  --page-bg:  #080a16;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
  min-height: 100svh;
  background: var(--page-bg) url("../img/stone.webp") center / cover no-repeat;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.9s var(--ease), color 0.6s var(--ease);
}

::selection { background: var(--accent); color: var(--on-accent); }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- ambient backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.aurora {
  position: absolute; inset: -20%;
  background: linear-gradient(160deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 68%, var(--sky-4) 100%);
  transition: background 0.9s var(--ease);
}

.blob {
  position: absolute;
  filter: blur(18px);
  opacity: 0.62;
  will-change: transform;
}
.blob-1 { width: 52vw; height: 52vw; left: -8vw;  top: -12vw;   border-radius: 58% 42% 44% 56% / 46% 52% 48% 54%; background: radial-gradient(circle at 32% 32%, #bcd3f7, transparent 70%); animation: driftA 26s var(--ease) infinite; }
.blob-2 { width: 46vw; height: 46vw; right: -6vw; top: 2vw;      border-radius: 44% 56% 62% 38% / 58% 44% 56% 42%; background: radial-gradient(circle at 60% 40%, #ffcaa8, transparent 70%); animation: driftB 31s var(--ease) infinite; }
.blob-3 { width: 60vw; height: 44vw; left: 12vw;  bottom: -18vw; border-radius: 62% 38% 36% 64% / 38% 62% 38% 62%; background: radial-gradient(circle at 40% 60%, #ded1ff, transparent 70%); animation: driftA 37s var(--ease) infinite reverse; }
.blob-4 { width: 34vw; height: 34vw; right: 16vw; bottom: -8vw;  border-radius: 50%; background: radial-gradient(circle at 50% 50%, #a8d8ff, transparent 70%); animation: driftB 23s var(--ease) infinite; }

:root[data-theme="dark"] .blob { opacity: 0.5; }
:root[data-theme="dark"] .blob-1 { background: radial-gradient(circle at 32% 32%, #2c3ea8, transparent 70%); }
:root[data-theme="dark"] .blob-2 { background: radial-gradient(circle at 60% 40%, #7b2f74, transparent 70%); }
:root[data-theme="dark"] .blob-3 { background: radial-gradient(circle at 40% 60%, #3b2a94, transparent 70%); }
:root[data-theme="dark"] .blob-4 { background: radial-gradient(circle at 50% 50%, #13617f, transparent 70%); }

/* Translate and opacity only. Both are composited, so a blurred blob keeps
   its cached raster while it drifts. Adding scale or rotate here forces the
   blur to be recomputed every frame — it measured ~30% of total frame time
   for a "breathing" effect the opacity fade gives away for free. */
@keyframes driftA {
  0%,100% { transform: translate3d(0,0,0);       opacity: .62; }
  33%     { transform: translate3d(4vw,3vh,0);   opacity: .72; }
  66%     { transform: translate3d(-3vw,5vh,0);  opacity: .54; }
}
@keyframes driftB {
  0%,100% { transform: translate3d(0,0,0);       opacity: .62; }
  40%     { transform: translate3d(-5vw,-4vh,0); opacity: .74; }
  75%     { transform: translate3d(3vw,4vh,0);   opacity: .52; }
}

.grain {
  position: absolute; inset: 0;
  opacity: 0.05; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- glass primitive ---------- */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 1px rgba(255,255,255,.25),
    var(--glass-sh);
  transition: background .5s var(--ease), border-color .5s var(--ease),
              box-shadow .5s var(--ease), transform .6s var(--ease-fluid);
}
/* A tinted panel with no backdrop blur.
   Real backdrop-filter is reserved for the floating chrome that sits over
   the orbs. Content panels sit over a smooth gradient, where a blur is
   visually almost indistinguishable from a tint — but every blurred panel
   has to re-rasterise whenever anything beneath it moves, so a grid of
   them is what makes an otherwise cheap page stutter. */
.pane {
  position: relative;
  background: var(--pane);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-sh);
  transition: background .45s var(--ease), border-color .45s var(--ease),
              transform .5s var(--ease-fluid);
}
.pane::after, .glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.4), rgba(255,255,255,0) 42%);
  opacity: .7;
}
.pane::after { opacity: .5; }

/* ---------- app shell ---------- */
.app {
  position: fixed;
  inset: clamp(10px, 1.6vmin, 22px);
  z-index: 2;
  border-radius: var(--r-shell);
  overflow: hidden;
  background: var(--shell-bg);
  border: 1px solid var(--glass-brd);
  box-shadow: 0 40px 110px -40px rgba(20, 24, 60, .55), inset 0 1px 0 var(--glass-hi);
  animation: shellIn 1.5s var(--ease-fluid) both;
}
@keyframes shellIn {
  from { opacity: 0; transform: scale(.965); border-radius: 90px; }
  to   { opacity: 1; transform: scale(1);    border-radius: var(--r-shell); }
}

/* liquid art inside the shell */
.stage-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.art-blob { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .55; will-change: transform; }
.art-1 { width: 46%; height: 62%; right: 2%;  top: 12%;  background: radial-gradient(circle at 40% 40%, rgba(255,190,150,.85), rgba(255,190,150,0) 68%); animation: driftArt 29s var(--ease) infinite; }
.art-2 { width: 52%; height: 58%; left: 8%;   bottom: -8%; background: radial-gradient(circle at 50% 50%, rgba(150,185,255,.8), rgba(150,185,255,0) 68%); animation: driftArt 34s var(--ease) infinite reverse; }
@keyframes driftArt {
  0%,100% { transform: translate3d(0,0,0);       opacity: .55; }
  40%     { transform: translate3d(-4%, -5%, 0); opacity: .66; }
  75%     { transform: translate3d(3%, 4%, 0);   opacity: .46; }
}
:root[data-theme="dark"] .art-1 { background: radial-gradient(circle at 40% 40%, rgba(160,60,120,.55), transparent 68%); }
:root[data-theme="dark"] .art-2 { background: radial-gradient(circle at 50% 50%, rgba(50,70,190,.55), transparent 68%); }
:root[data-theme="dark"] .art-3 { background: radial-gradient(circle at 50% 50%, rgba(90,50,180,.5), transparent 68%); }
.art-sheen {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 34%, rgba(255,255,255,0) 66%, rgba(255,255,255,.16) 100%);
}

/* ---------- top bar ---------- */
.topbar {
  position: absolute; z-index: 30;
  top: clamp(12px, 1.6vmin, 22px);
  left: clamp(12px, 1.6vmin, 22px);
  right: clamp(12px, 1.6vmin, 22px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  animation: dropIn 1.1s .25s var(--ease-fluid) both;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

.pill {
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .9rem 1.5rem;
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem; font-weight: 500;
  white-space: nowrap;
  will-change: transform;
}
.pill:hover { background: var(--glass-hi); }
:root[data-theme="dark"] .pill:hover { background: rgba(255,255,255,.16); }
.pill-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.5); color: var(--accent); flex: none; transition: transform .5s var(--spring), background .4s; }
:root[data-theme="dark"] .pill-icon { background: rgba(255,255,255,.12); }
.pill-icon svg { width: 12px; height: 12px; }
.pill-brand .pill-icon { transform: rotate(-90deg); }
.pill:hover .pill-icon { transform: rotate(0deg) scale(1.12); }
.pill-brand .pill-text { font-family: 'Instrument Serif', serif; font-style: italic; font-size: 1.3rem; letter-spacing: .01em; }
.pill-brand em { color: var(--accent-2); font-style: normal; }
.pill-cta { padding-right: .55rem; }

.meta-bar {
  display: flex; align-items: center; gap: 1.4rem;
  padding: .75rem 1.7rem;
  border-radius: 999px;
  background: var(--glass);
}
.meta { display: flex; flex-direction: column; gap: .1rem; line-height: 1.25; }
.meta-label { display: flex; align-items: center; gap: .35rem; font-size: .68rem; letter-spacing: .04em; color: var(--ink-softer); }
.meta-label svg { width: 11px; height: 11px; }
.meta-value { font-size: .85rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.meta-chev { width: 10px; height: 6px; margin-left: .1rem; color: var(--ink-softer); flex: none; transition: transform .4s var(--spring); }
.meta:hover .meta-chev { transform: translateY(2px); }
.meta-sep { width: 1px; height: 26px; background: linear-gradient(transparent, var(--glass-brd), transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #35c07a; box-shadow: 0 0 0 0 rgba(53,192,122,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(53,192,122,0); } 100% { box-shadow: 0 0 0 0 rgba(53,192,122,0); } }

/* ---------- rail ---------- */
.rail {
  position: absolute; z-index: 30;
  left: clamp(12px, 1.6vmin, 22px);
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: .35rem;
  padding: .7rem .55rem;
  border-radius: 999px;
  animation: railIn 1.1s .4s var(--ease-fluid) both;
}
@keyframes railIn { from { opacity: 0; transform: translate(-40px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }

.rail-fluid {
  position: absolute;
  left: .55rem; top: 0;
  width: 46px; height: 46px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 75%, transparent);
  transform: translateY(0) scale(1);
  transition: transform .62s var(--ease-fluid);
  will-change: transform;
  pointer-events: none;
}

.rail-btn {
  position: relative; z-index: 1;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  transition: color .45s var(--ease), transform .5s var(--spring);
  will-change: transform;
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { color: var(--ink); }
.rail-btn.is-active { color: var(--on-accent); }
.rail-btn::before {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translate(-8px, -50%) scale(.9);
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-brd);
  color: var(--ink);
  font-size: .72rem; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease), transform .5s var(--spring);
}
@media (hover: hover) {
  .rail-btn:hover::before { opacity: 1; transform: translate(0, -50%) scale(1); }
}
.rail-div { width: 22px; height: 1px; background: var(--glass-brd); margin: .4rem 0; }
.rail-avatar { color: var(--ink-soft); }
.avatar-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #6f8cff, #2b1d7a 60%, #ff9a5c);
  color: #fff;
  font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  font-family: 'Instrument Serif', serif; font-style: italic;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.rail-theme .ico-moon { display: none; }
:root[data-theme="dark"] .rail-theme .ico-sun { display: none; }
:root[data-theme="dark"] .rail-theme .ico-moon { display: block; }

/* ---------- stage / views ---------- */
.stage { position: absolute; inset: 0; z-index: 10; }
.stage-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.stage-scroll::-webkit-scrollbar { width: 0; height: 0; }

.view { display: none; }
.view.is-active { display: flex; flex-direction: column; min-height: 100%; }

.view-inner {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(6.5rem, 13vh, 9rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 10vh, 7rem) clamp(5.5rem, 8vw, 7.5rem);
}

/* enter / leave choreography */
.view.is-entering { animation: viewIn .95s var(--ease-fluid) both; }
.view.is-leaving  { animation: viewOut .5s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(34px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes viewOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-22px) scale(.99); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-softer);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }

.view-head { margin-bottom: clamp(2rem, 5vh, 3.4rem); }
.view-title {
  margin-top: 1.1rem;
  font-size: clamp(1.9rem, 4.6vw, 3.15rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.view-title em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--accent); letter-spacing: -0.01em; }

/* split text animation */
[data-split] .w, [data-split-lines] .w { display: inline-block; will-change: transform, filter; }
.split-in .w { animation: wordIn .95s var(--ease-fluid) both; animation-delay: var(--d); }
@keyframes wordIn {
  from { opacity: 0; transform: translateY(.6em) rotate(2deg) scale(.96); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

[data-reveal] { opacity: 0; transform: translateY(28px) scale(.985); }
[data-reveal].in { animation: revealIn 1s var(--ease-fluid) both; animation-delay: var(--d, 0ms); }
[data-reveal].rv-done { animation: none; opacity: 1; transform: none; }
@keyframes revealIn { to { opacity: 1; transform: none; } }

/* Idle drift, on the two hero cards only. Every moving translucent panel
   forces the compositor to redo the work beneath it, so this is a luxury
   spent where the page is quietest — not on every card in a grid. */
[data-drift] { animation: drift var(--fdur, 14s) ease-in-out var(--fdelay, 0s) infinite; }
@keyframes drift {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -7px; }
}

/* ================= HOME ================= */
.hero {
  position: relative;
  overflow: clip;
  flex: 1;
  padding: clamp(5.25rem, 10.5vh, 7.5rem) clamp(1.25rem, 3vw, 2.4rem) clamp(1.25rem, 2.5vh, 2rem) clamp(5.5rem, 7vw, 7rem);
  display: flex; flex-direction: column;
}
.hero-title {
  position: relative;
  z-index: 0;
  font-size: clamp(2.6rem, min(9.6vw, 17vh), 8.5rem);
  font-weight: 200;
  line-height: .93;
  letter-spacing: -0.05em;
  text-align: center;
  color: rgba(255,255,255,.92);
  text-shadow: 0 6px 34px rgba(52, 62, 118, .32), 0 1px 0 rgba(255,255,255,.35);
  margin-bottom: -.1em;
}
:root[data-theme="dark"] .hero-title { color: rgba(255,255,255,.58); text-shadow: 0 6px 40px rgba(0,0,0,.5); }

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 30ch;
  margin-top: clamp(.6rem, 1.8vh, 1.4rem);
  font-size: clamp(.92rem, min(1.15vw, 2vh), 1.08rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(22, 24, 46, .82);
  text-shadow: 0 1px 16px rgba(255,255,255,.55);
}
:root[data-theme="dark"] .hero-copy { color: rgba(255,255,255,.78); }

.card { border-radius: var(--r-lg); padding: 1.7rem 1.8rem; will-change: transform; }
.hero-bottom {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding-top: clamp(.75rem, 2vh, 1.5rem);
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr minmax(0, 400px);
  align-items: end;
  gap: 1rem;
}

.card-stat {
  background: var(--glass-strong);
  --fdur: 11s;
}
.card-title { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: .55rem; }
.card-body { font-size: .82rem; line-height: 1.55; color: var(--ink-soft); }
.stat-row { display: flex; align-items: flex-end; gap: .9rem; margin-top: 1.4rem; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 3rem; font-weight: 300; letter-spacing: -0.05em; line-height: 1; }
.stat-label { font-size: .66rem; letter-spacing: .06em; color: var(--ink-softer); margin-top: .3rem; }
.avatar-stack { display: flex; margin-left: auto; }
.av {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .62rem; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  border: 2px solid rgba(255,255,255,.7);
  margin-left: -12px;
  transition: transform .5s var(--spring);
}
.av-1 { background: linear-gradient(140deg, #4b6cf5, #2b1d7a); }
.av-2 { background: linear-gradient(140deg, #ffb37a, #e8631f); }
.av-3 { background: linear-gradient(140deg, #9a7bff, #4a2ea8); }
.card-stat:hover .av-1 { transform: translateX(-6px) scale(1.06); }
.card-stat:hover .av-3 { transform: translateX(6px) scale(1.06); }

.round-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  transition: transform .5s var(--spring), box-shadow .4s var(--ease);
  will-change: transform;
}
.round-btn svg { width: 13px; height: 13px; }
.round-btn:hover { transform: scale(1.12) rotate(8deg); box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.round-btn-lg { width: 54px; height: 54px; background: var(--glass-hi); color: var(--ink); }
.round-btn-lg svg { width: 16px; height: 16px; }
:root[data-theme="dark"] .round-btn-lg { background: rgba(255,255,255,.16); }

.card-feature { --fdur: 13s; --fdelay: -3s; }
.feat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.feat-title { font-size: 1.5rem; font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.feat-sub { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--ink-soft); margin-top: .35rem; }
.feat-sub svg { width: 13px; height: 13px; flex: none; }
.feat-desc { font-size: .78rem; line-height: 1.6; color: var(--ink-soft); margin-top: 1.05rem; }
.feat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .74rem; color: var(--ink-soft); margin-top: 1.05rem; }
.feat-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.feat-meta svg { width: 13px; height: 13px; opacity: .75; }
.feat-meta i { opacity: .4; font-style: normal; }
.meta-break { display: none; }

.feat-actions { display: flex; gap: .6rem; margin-top: 1.3rem; }
.act {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .7rem .4rem;
  border: 1px solid var(--glass-brd); border-radius: var(--r-sm);
  background: rgba(255,255,255,.28);
  color: var(--ink); text-decoration: none;
  transition: background .4s var(--ease), transform .5s var(--spring), border-color .4s;
  will-change: transform;
}
:root[data-theme="dark"] .act { background: rgba(255,255,255,.06); }
.act svg { width: 17px; height: 17px; }
.act-count { font-size: .62rem; letter-spacing: .05em; color: var(--ink-softer); }
.act:hover { background: rgba(255,255,255,.5); transform: translateY(-3px); }
:root[data-theme="dark"] .act:hover { background: rgba(255,255,255,.13); }

.mark {
  justify-self: center;
  margin-bottom: clamp(.5rem, 2vh, 1.6rem);
  width: clamp(74px, 8vw, 108px); height: clamp(74px, 8vw, 108px);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 24px 50px -18px color-mix(in srgb, var(--accent) 65%, transparent);
  animation: markMorph 14s var(--ease) infinite;
}
.mark svg { width: 52%; height: 52%; }
@keyframes markMorph {
  0%,100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; }
  33%     { border-radius: 58% 42% 46% 54% / 44% 58% 42% 56%; }
  66%     { border-radius: 42% 58% 56% 44% / 58% 42% 56% 44%; }
}

.scroll-hint {
  position: absolute; z-index: 20;
  right: clamp(1.2rem, 2.4vw, 2rem); bottom: clamp(1.2rem, 2.4vw, 2rem);
  display: none; align-items: center; gap: .55rem;
  font-family: 'JetBrains Mono', monospace; font-size: .64rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
  pointer-events: none;
  opacity: 0; transition: opacity .5s var(--ease);
}
.scroll-hint.on { opacity: .8; }
.scroll-hint-line { width: 34px; height: 1px; background: currentColor; transform-origin: right; animation: hintLine 2.2s var(--ease) infinite; }
@keyframes hintLine { 0%,100% { transform: scaleX(.3); } 50% { transform: scaleX(1); } }

/* ---------- the hero object ----------
   Layered the way the reference layers its photograph: the headline passes
   behind the object, the copy and cards sit on top of it. That overlap is
   what makes the composition read as one scene instead of parts on a page. */
.hero-visual {
  position: absolute;
  z-index: 1;
  right: -4%;
  bottom: -5%;
  width: min(70%, 860px);
  height: auto;
  max-height: 68%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  /* no CSS filter here on purpose: the grade and the contact shadow are
     baked into the asset, so the float animation stays pure compositing */
  animation: heroIn 1.8s .35s var(--ease-fluid) both, heroFloat 17s 2s ease-in-out infinite;
  will-change: transform;
}
@keyframes heroIn {
  from { opacity: 0; transform: translate3d(40px, 46px, 0) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%      { transform: translate3d(0, -14px, 0) rotate(-1.1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual { animation: none; }
}

/* ================= WORK ================= */
.about-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 1rem; margin-bottom: 1.4rem; }
.about-copy { border-radius: var(--r-lg); padding: 1.8rem; display: flex; flex-direction: column; gap: 1rem; --fdur: 12s; }
.about-copy p { font-size: .92rem; line-height: 1.7; color: var(--ink-soft); }
.about-copy strong { color: var(--ink); font-weight: 500; }
.about-stats { display: grid; gap: 1rem; }
.mini { border-radius: var(--r-md); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; --fdur: 10s; --fdelay: -2s; }
.mini-num { font-size: 1.9rem; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.mini-label { font-size: .68rem; letter-spacing: .05em; color: var(--ink-softer); margin-top: .35rem; }

.timeline { list-style: none; display: grid; gap: 1rem; }
.exp {
  display: grid; grid-template-columns: 150px 1fr 40px;
  align-items: start; gap: 1.4rem;
  border-radius: var(--r-lg); padding: 1.6rem 1.8rem;
  animation: none;
}
.exp:hover { transform: translateY(-4px); background: var(--pane-hi); }
.exp-date { font-family: 'JetBrains Mono', monospace; font-size: .72rem; letter-spacing: .04em; color: var(--ink-softer); padding-top: .3rem; }
.exp-role { font-size: 1.22rem; font-weight: 500; letter-spacing: -0.02em; }
.exp-co { display: inline-block; font-size: .8rem; color: var(--accent); margin-top: .1rem; }
:root[data-theme="dark"] .exp-co { color: var(--accent-2); }
.exp-desc { font-size: .86rem; line-height: 1.65; color: var(--ink-soft); margin-top: .7rem; max-width: 62ch; }
.exp-arrow { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--glass-brd); color: var(--ink-soft); transition: transform .55s var(--spring), background .4s, color .4s; }
.exp-arrow svg { width: 14px; height: 14px; }
.exp:hover .exp-arrow { background: var(--accent); color: var(--on-accent); transform: rotate(45deg) scale(1.08); }

/* ================= PROJECTS ================= */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.proj {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 1.9rem;
  display: flex; flex-direction: column; gap: .7rem;
  min-height: 280px;
  will-change: transform;
}
.proj::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--accent) 26%, transparent), transparent 68%);
  opacity: 0; transition: opacity .6s var(--ease);
  pointer-events: none;
}
.proj:hover::before { opacity: 1; }
.proj:hover { background: var(--pane-hi); }
.proj-num { font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-softer); }
.proj-title { font-size: 1.55rem; font-weight: 400; letter-spacing: -0.03em; line-height: 1.12; }
.proj-desc { font-size: .85rem; line-height: 1.65; color: var(--ink-soft); flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .68rem; letter-spacing: .02em;
  padding: .34rem .75rem; border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,.26);
  color: var(--ink-soft);
  transition: transform .45s var(--spring), background .35s, color .35s;
}
:root[data-theme="dark"] .tag { background: rgba(255,255,255,.06); }
.tag:hover { transform: translateY(-2px) scale(1.05); background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* ================= SKILLS ================= */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.skill-group { border-radius: var(--r-lg); padding: 1.6rem 1.7rem; --fdur: 11s; }
.skill-label { font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-softer); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.chip {
  font-size: .8rem; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,.3);
  transition: transform .5s var(--spring), background .35s, color .35s, border-color .35s;
  will-change: transform;
}
:root[data-theme="dark"] .chip { background: rgba(255,255,255,.06); }
.chip:hover { transform: translateY(-3px) scale(1.06); background: var(--accent); color: var(--on-accent); border-color: transparent; }

.recognition { margin-top: 2.6rem; }
.marquee {
  margin-top: 1.2rem;
  overflow: hidden;
  border-radius: 999px;
  padding: .9rem 0;
  background: var(--pane);
  border: 1px solid var(--glass-brd);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 1.6rem; width: max-content; will-change: transform; }
.mq { font-family: 'JetBrains Mono', monospace; font-size: .78rem; letter-spacing: .03em; color: var(--ink-soft); white-space: nowrap; }
.mq-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); flex: none; }

/* ================= CONTACT ================= */
.view-inner-contact { display: flex; flex-direction: column; }
.mail {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.5rem, 3vw, 2.6rem);
  font-size: clamp(1.6rem, 5.4vw, 3.6rem);
  font-weight: 300; letter-spacing: -0.04em;
  color: var(--ink); text-decoration: none;
  --fdur: 12s;
  will-change: transform;
}
.mail svg { width: clamp(24px, 3vw, 40px); height: clamp(24px, 3vw, 40px); flex: none; transition: transform .6s var(--spring); }
.mail:hover { background: var(--pane-hi); }
.mail:hover svg { transform: translate(6px, -6px) scale(1.1); }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.cell { border-radius: var(--r-md); padding: 1.3rem 1.5rem; display: flex; flex-direction: column; gap: .4rem; --fdur: 10s; --fdelay: -4s; }
.cell-label { font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-softer); }
.cell a, .cell-val { font-size: .9rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; }
.cell a { border-bottom: 1px solid transparent; transition: border-color .4s; width: fit-content; }
.cell a:hover { border-bottom-color: var(--accent); }

.foot {
  margin-top: auto; padding-top: 2.6rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
  font-size: .72rem; color: var(--ink-softer);
}

/* ---------- cursor ----------
   The dot sits exactly on the pointer so clicking never feels off; the
   ring trails it. Both are plain transforms on their own layer — the old
   version pushed five blobs through an SVG goo filter every frame, which
   is why it smeared and lagged behind the hand. */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
:root.cursor-visible .cursor-dot,
:root.cursor-visible .cursor-ring { opacity: 1; }

.cursor-dot {
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--accent);
  transition: opacity .25s var(--ease);
}
.cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, transparent);
  transition: opacity .3s var(--ease), width .45s var(--spring), height .45s var(--spring),
              margin .45s var(--spring), background .35s var(--ease), border-color .35s var(--ease);
}
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
}
.cursor-ring.is-press {
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}
/* the native cursor is hidden only once the custom one is actually live */
:root.has-cursor,
:root.has-cursor a,
:root.has-cursor button,
:root.has-cursor .exp,
:root.has-cursor .proj { cursor: none; }

/* click ripple */
.ripple {
  position: fixed; z-index: 899;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
  animation: rip .85s var(--ease-fluid) forwards;
}
@keyframes rip {
  from { transform: scale(1); opacity: .8; }
  to   { transform: scale(22); opacity: 0; }
}

/* toast */
.toast {
  position: fixed; z-index: 950;
  left: 50%; bottom: 2.4rem;
  transform: translate(-50%, 30px) scale(.94);
  padding: .8rem 1.5rem;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  color: var(--ink); font-size: .82rem;
  opacity: 0; pointer-events: none;
  transition: opacity .45s var(--ease), transform .65s var(--spring);
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Short-but-wide windows (laptops at 720p, split screens). The hero is a
   fixed set of parts, so the only way to keep it on one screen is to tighten
   the rhythm rather than let it scroll. */
@media (min-width: 861px) and (max-height: 840px) {
  .hero { padding-top: clamp(4.5rem, 9vh, 5.5rem); }
  .hero-title { font-size: clamp(2.4rem, min(9.6vw, 14vh), 8.5rem); }
  .hero-copy { font-size: .88rem; line-height: 1.45; margin-top: .6rem; }
  .card { padding: 1.25rem 1.4rem; }
  .card-title { font-size: 1.18rem; margin-bottom: .35rem; }
  .card-body, .feat-desc { font-size: .76rem; line-height: 1.5; }
  .stat-row { margin-top: .9rem; }
  .stat-num { font-size: 2.35rem; }
  .av { width: 32px; height: 32px; }
  .round-btn { width: 36px; height: 36px; }
  .round-btn-lg { width: 46px; height: 46px; }
  .feat-title { font-size: 1.3rem; }
  .feat-desc { margin-top: .75rem; }
  .feat-meta { margin-top: .75rem; row-gap: .3rem; }
  .feat-actions { margin-top: .9rem; }
  .act { padding: .55rem .4rem; }
  .mark { width: clamp(64px, 6.5vw, 84px); height: clamp(64px, 6.5vw, 84px); }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .meta-bar { display: none; }
  .proj-grid, .skill-grid, .about-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-bottom { grid-template-columns: 1fr 1fr; }
  .hero-bottom .mark { display: none; }
  .hero-visual { width: min(70%, 520px); bottom: -8%; }
}

@media (max-width: 860px) {
  :root { --r-shell: 34px; --r-lg: 26px; --blur: 20px; }
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }

  .app { inset: 8px; }
  .topbar { top: 10px; left: 10px; right: 10px; }
  .pill { padding: .7rem 1.1rem; font-size: .84rem; }
  .pill-brand .pill-text { font-size: 1.1rem; }
  .pill-cta .pill-text { display: none; }
  .pill-cta { padding: .55rem; }

  /* rail becomes a floating bottom dock */
  .rail {
    left: 50%; right: auto; top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    flex-direction: row;
    padding: .5rem .55rem;
    animation: dockIn 1s .4s var(--ease-fluid) both;
  }
  @keyframes dockIn { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .rail-fluid { left: .55rem; top: .5rem; width: 44px; height: 44px; }
  .rail-btn { width: 44px; height: 44px; }
  .rail-btn::before { left: 50%; top: auto; bottom: calc(100% + 12px); transform: translate(-50%, 6px) scale(.9); }
  @media (hover: hover) {
    .rail-btn:hover::before { transform: translate(-50%, 0) scale(1); }
  }
  .rail-div { width: 1px; height: 22px; margin: 0 .3rem; }
  .rail-avatar, .rail-theme { }

  .blob-3, .blob-4 { display: none; }
  .view-inner { padding: 6rem 1.15rem 8.5rem; }
  .hero { padding: 5.5rem 1.15rem 8.5rem; }
  .hero-title { font-size: clamp(2.6rem, 14vw, 5rem); }
  .hero-copy { max-width: none; }

  .hero-bottom { grid-template-columns: 1fr; gap: 1rem; padding-top: 1.8rem; }
  /* the object is first in the DOM so it can sit behind the headline on
     desktop; stacked, it belongs after the copy */
  .hero-title  { order: 1; }
  .hero-copy   { order: 2; }
  .hero-visual { order: 3; }
  .hero-bottom { order: 4; }
  .hero-visual {
    position: static;
    width: 94%;
    margin: 1.4rem auto -1rem;
    max-height: none;
    animation: heroIn 1.4s .3s var(--ease-fluid) both;
  }
  .mark { display: none; }
  .scroll-hint { display: none !important; }
  .meta-break { display: block; }

  .exp { grid-template-columns: 1fr; gap: .6rem; padding: 1.4rem 1.5rem; }
  .exp-arrow { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .foot { padding-top: 2rem; }
}

@media (max-width: 420px) {
  .rail { gap: .1rem; padding: .45rem; }
  .rail-btn { width: 40px; height: 40px; }
  .rail-fluid { width: 40px; height: 40px; left: .45rem; top: .45rem; }
  .rail-btn svg { width: 18px; height: 18px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .cursor-dot, .cursor-ring { display: none; }
  html { scroll-behavior: auto; }
}
