/* ============================================================
   Ajith — static portfolio
   Theme colours live on :root and are interpolated by JS as the
   page scrolls from About into Skills (scroll-activated dark mode).
   ============================================================ */

:root {
  /* interpolated at runtime — these are the light-mode start values */
  --bg: #f4f5fa;
  --bg-elev: #ffffff;
  --fg: #12141d;
  --muted: #5c6379;
  --border: rgba(18, 20, 29, 0.10);
  --grid: rgba(18, 20, 29, 0.045);
  --shadow: 0 24px 60px -30px rgba(18, 20, 29, 0.35);

  /* constant accents */
  --pink: #ff3d81;
  --violet: #7c5cff;
  --mint: #16f2b3;
  --amber: #ffb84d;
  --cyan: #4cc9f0;

  --grad: linear-gradient(100deg, var(--violet), var(--pink));
  --shell: 76rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

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

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  overflow-x: clip;
  transition: background-color 120ms linear;
}

/* Background grid that survives the theme flip */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

::selection {
  background: var(--pink);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 6px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mint {
  color: var(--mint);
}

/* ------------------------------------------------------------
   Reveal-on-enter (used by every section heading)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   Cursor layers — animations 5 (code cursor) + 8 (fluid follower)
   ------------------------------------------------------------ */
.cursor-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
}

body.has-cursor .cursor-layer {
  display: block;
}

body.has-cursor,
body.has-cursor * {
  cursor: none !important;
}

.cursor-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
      rgba(22, 242, 179, 0.55) 0%,
      rgba(124, 92, 255, 0.35) 45%,
      transparent 70%);
  box-shadow: 0 0 26px 6px rgba(22, 242, 179, 0.25);
  will-change: transform;
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
    margin 0.25s var(--ease), opacity 0.25s var(--ease);
}

body.cursor-hot .cursor-glow {
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  opacity: 0.75;
}

.cursor-code {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 61, 129, 0.5);
  will-change: transform;
}

.cursor-bracket {
  display: inline-block;
  transition: transform 0.2s var(--ease), color 0.2s linear;
}

body.cursor-hot .cursor-bracket {
  transform: scale(1.35);
  color: var(--mint);
}

.cursor-caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--mint);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding: 0.9rem 0;
  transition: background-color 0.3s linear, box-shadow 0.3s linear,
    padding 0.3s var(--ease), border-color 0.3s linear;
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  padding: 0.55rem 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
}

.nav__brand-mark {
  font-family: var(--mono);
  color: var(--pink);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1.4rem);
  font-size: 0.85rem;
  font-weight: 500;
}

.nav__links a {
  color: var(--muted);
  padding: 0.35rem 0.2rem;
  transition: color 0.2s linear;
}

.nav__links a:hover {
  color: var(--fg);
}

.nav__cta {
  padding: 0.45rem 1rem !important;
  border-radius: 999px;
  background: var(--grad);
  color: #fff !important;
  font-weight: 600;
}

@media (max-width: 720px) {

  .nav__links a:not(.nav__cta) {
    display: none;
  }
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: gap 0.25s var(--ease), box-shadow 0.3s var(--ease),
    background-color 0.25s linear, color 0.25s linear, border-color 0.25s linear;
}

.btn:hover {
  gap: 0.95rem;
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 0.86rem;
}

.btn--solid {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 34px -16px rgba(124, 92, 255, 0.9);
}

.btn--solid:hover {
  box-shadow: 0 18px 44px -14px rgba(255, 61, 129, 0.75);
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-elev) 60%, transparent);
  transition: color 0.25s linear, border-color 0.25s linear, transform 0.25s var(--ease);
}

.iconbtn:hover {
  color: var(--pink);
  border-color: var(--pink);
}

/* Magnetic elements are moved by JS; keep the return springy */
.magnetic {
  will-change: transform;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: clamp(8rem, 16vh, 12rem) 0 clamp(4rem, 10vh, 7rem);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -10%;
  left: 50%;
  width: min(1100px, 120vw);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 40%,
      rgba(124, 92, 255, 0.28), transparent 62%),
    radial-gradient(ellipse at 78% 30%, rgba(255, 61, 129, 0.22), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  margin-right: 0.6rem;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(22, 242, 179, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 12px rgba(22, 242, 179, 0);
  }
}

.hero__title {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.hero__lede {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  max-width: 34rem;
}

.hero__socials {
  display: flex;
  gap: 0.7rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.hero__actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Terminal card */
.terminal {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0d1224;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal__bar,
.editor__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

.dot--r {
  background: #ff5f57;
}

.dot--y {
  background: #febc2e;
}

.dot--g {
  background: #28c840;
}

.terminal__file,
.editor__file {
  margin-left: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #7f88a8;
}

.terminal__body {
  margin: 0;
  padding: 1.15rem clamp(1rem, 2.5vw, 1.6rem);
  font-family: var(--mono);
  font-size: clamp(0.66rem, 1.15vw, 0.8rem);
  line-height: 1.75;
  color: #c7cbe0;
  overflow-x: auto;
}

.t-key {
  color: #ff7ab2;
}

.t-var {
  color: #ffffff;
}

.t-prop {
  color: #e6e9f5;
}

.t-str {
  color: var(--amber);
}

.t-bool,
.t-num {
  color: #ff9d5c;
}

.t-fn {
  color: var(--mint);
}

.t-this {
  color: var(--cyan);
}

.t-op {
  color: var(--amber);
}

.t-pun {
  color: #6f7796;
}

.caret {
  color: var(--mint);
  animation: blink 1.05s steps(1) infinite;
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-content: center;
  margin-top: clamp(2rem, 6vh, 4rem);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-hint__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--muted), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-hint__line::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 14px;
  background: var(--mint);
  animation: drop 1.8s var(--ease) infinite;
}

@keyframes drop {
  0% {
    transform: translateY(-16px);
    opacity: 0;
  }

  40% {
    opacity: 1;
  }

  100% {
    transform: translateY(46px);
    opacity: 0;
  }
}

/* ------------------------------------------------------------
   Generic section furniture
   ------------------------------------------------------------ */
.section {
  padding: clamp(4.5rem, 12vh, 8rem) 0;
  position: relative;
}

.section__tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 0.9rem;
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.section__lede {
  color: var(--muted);
  max-width: 40rem;
}

/* About */
.about__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  align-items: center;
  margin-top: 1.5rem;
}

@media (min-width: 900px) {
  .about__grid {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

.about__copy p {
  color: var(--muted);
  font-size: 1.02rem;
}

.about__stats {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
}

.about__stats li {
  display: flex;
  flex-direction: column;
}

.about__stats strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
}

.about__stats span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.about__photo {
  display: flex;
  justify-content: center;
}

.about__photo-frame {
  position: relative;
  border-radius: 18px;
  padding: 6px;
  background: var(--grad);
  box-shadow: var(--shadow);
}

.about__photo-frame img {
  border-radius: 13px;
  width: min(320px, 70vw);
  height: auto;
  filter: grayscale(1);
  transition: filter 0.7s var(--ease), transform 0.7s var(--ease);
}

.about__photo-frame:hover img {
  filter: grayscale(0);
  transform: scale(1.02);
}

/* ------------------------------------------------------------
   Skills
   ------------------------------------------------------------ */
.marquee {
  margin: 2.5rem 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  border-block: 1px solid var(--border);
  padding: 1rem 0;
}

.marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: slide 34s linear infinite;
}

.marquee__track span {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2.2vw, 1.35rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.65;
  white-space: nowrap;
}

.marquee__track span:nth-child(3n) {
  color: var(--pink);
  opacity: 0.9;
}

.marquee__track span:nth-child(5n) {
  color: var(--mint);
  opacity: 0.9;
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.skillgrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.skilltile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 0.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  transition: transform 0.35s var(--ease), border-color 0.3s linear,
    background-color 0.3s linear;
  opacity: 0;
  transform: translateY(18px);
}

.skilltile.is-in {
  opacity: 1;
  transform: none;
}

.skilltile:hover {
  transform: translateY(-6px);
  border-color: var(--mint);
}

.skilltile img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.skilltile span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------
   Animation 1 — code assembling
   ------------------------------------------------------------ */
.assemble {
  height: 340vh;
  position: relative;
  margin-top: 2rem;
}

.assemble__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
}

.assemble__grid {
  display: grid;
  gap: clamp(1rem, 3vw, 2.2rem);
  grid-template-columns: 1fr;
  width: 100%;
}

@media (min-width: 900px) {
  .assemble__grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
  }
}

.editor {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0b0f21;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(62vh, 480px);
}

.editor__pct {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mint);
}

.editor__body {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding: 1rem 0;
}

.editor__gutter {
  flex: none;
  width: 3rem;
  will-change: transform;
  text-align: right;
  padding-right: 0.9rem;
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1vw, 0.72rem);
  line-height: 1.85;
  color: #3e4665;
  user-select: none;
}

.editor__code {
  margin: 0;
  flex: 1;
  overflow: hidden;
  will-change: transform;
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.05vw, 0.78rem);
  line-height: 1.85;
  color: #c7cbe0;
  padding-right: 1rem;
  white-space: pre;
}

.editor__code .ln {
  display: block;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.28s linear, transform 0.28s var(--ease);
}

.editor__code .ln.on {
  opacity: 1;
  transform: none;
}

.editor__code .ln.typing::after {
  content: "▌";
  color: var(--mint);
  animation: blink 0.7s steps(1) infinite;
}

.preview {
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--bg-elev) 45%, transparent);
  display: flex;
  flex-direction: column;
  min-height: min(62vh, 480px);
  overflow: hidden;
}

.preview__label {
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.preview__stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  position: relative;
}

.preview__empty {
  position: absolute;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  transition: opacity 0.4s linear;
}

.pv-card {
  width: min(260px, 100%);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: linear-gradient(160deg, #151b34, #0d1224);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  color: #fff;
  opacity: 0;
  transform: translateY(24px) scale(0.94);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}

.pv-card.on {
  opacity: 1;
  transform: none;
}

.pv-card > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.pv-card > *.on {
  opacity: 1;
  transform: none;
}

.pv-card__avatar {
  width: 68px;
  height: 68px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.2);
}

.pv-card__name {
  font-weight: 700;
  font-size: 1.15rem;
}

.pv-card__role {
  font-size: 0.78rem;
  color: #9aa3bd;
  margin-bottom: 0.9rem;
}

.pv-card__tags {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.pv-card__tags span {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--mint);
}

.pv-card__btn {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--grad);
}

/* ------------------------------------------------------------
   Animation 3 — wireframe to UI diagonal reveal
   ------------------------------------------------------------ */
.reveal-scene {
  height: 300vh;
  position: relative;
  margin-top: 2rem;
}

.reveal-scene__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
}

.phone {
  width: min(330px, 74vw);
  margin: 0 auto;
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #2a3050, #11162b);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border);
}

.phone__screen {
  position: relative;
  aspect-ratio: 375 / 720;
  border-radius: 31px;
  overflow: hidden;
  background: #0b0f1f;
  isolation: isolate;
}

.layer {
  position: absolute;
  inset: 0;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.7rem;
}

/* --- polished UI --- */
.layer--ui {
  background: linear-gradient(170deg, #16204a 0%, #0b0f1f 45%);
  color: #eef1fb;
}

.ui-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6rem;
  color: #aeb6d4;
}

.ui-status__r {
  width: 34px;
  height: 8px;
  border-radius: 3px;
  background: #aeb6d4;
  opacity: 0.5;
}

.ui-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ui-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad);
  flex: none;
}

.ui-hello {
  font-size: 0.58rem;
  color: #98a1c2;
}

.ui-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.ui-bell {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.ui-balance {
  border-radius: 16px;
  padding: 0.9rem;
  background: linear-gradient(120deg, var(--violet), var(--pink));
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 18px 34px -20px rgba(124, 92, 255, 0.9);
}

.ui-balance span {
  font-size: 0.58rem;
  opacity: 0.85;
}

.ui-balance strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.ui-spark {
  height: 26px;
  margin-top: 0.35rem;
  border-radius: 6px;
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.22), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 9px);
  mask-image: linear-gradient(180deg, transparent, #000);
}

.ui-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.ui-actions>div {
  border-radius: 12px;
  padding: 0.6rem 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.56rem;
  color: #c3cae4;
}

.ui-actions i {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--mint);
  opacity: 0.85;
}

.ui-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.ui-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.ui-row i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(124, 92, 255, 0.55);
  flex: none;
}

.ui-row b {
  display: block;
  font-size: 0.66rem;
}

.ui-row small {
  font-size: 0.54rem;
  color: #8f98ba;
}

.ui-row em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.66rem;
  color: #ff8fb3;
}

.ui-row em.pos {
  color: var(--mint);
}

.ui-tabs {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.6rem 0.2rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ui-tabs div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.5rem;
  color: #6d769a;
}

.ui-tabs div i {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: currentColor;
  opacity: 0.6;
}

.ui-tabs div.on {
  color: var(--mint);
}

.ui-tabs div.on i {
  opacity: 1;
}

.wf-tabs {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding-top: 0.5rem;
}

.wf-tabs .wf {
  height: 26px;
}

/* --- wireframe layer, clipped diagonally by JS --- */
.layer--wire {
  background: #0a1020;
  color: #4d7dff;
  /* the clip-path polygon is written by JS */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.wf-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(77, 125, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 125, 255, 0.16) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.wf {
  border: 1px dashed rgba(122, 162, 255, 0.75);
  border-radius: 6px;
  background: rgba(77, 125, 255, 0.07);
}

.wf-status {
  height: 12px;
}

.wf-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.wf-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
}

.wf-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.wf-line {
  height: 7px;
}

.wf-line.s {
  width: 45%;
}

.wf-line.m {
  width: 70%;
}

.wf-sq {
  width: 28px;
  height: 28px;
  flex: none;
}

.wf-sq.lg {
  width: 100%;
  height: 44px;
}

.wf-block {
  height: 40px;
  position: relative;
}

.wf-block.tall {
  height: 92px;
  display: grid;
  place-items: center;
}

.wf-note {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(150, 185, 255, 0.85);
}

.wf-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.wf-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wf-dim {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(150, 185, 255, 0.7);
}

/* the glowing diagonal seam that rides along the wipe.
   Position + rotation are written by JS so it sits exactly on the clip edge. */
.reveal-edge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 260%;
  margin-left: -1.5px;
  background: linear-gradient(to bottom,
      transparent,
      rgba(22, 242, 179, 0.95) 22%,
      rgba(255, 255, 255, 0.95) 50%,
      rgba(22, 242, 179, 0.95) 78%,
      transparent);
  box-shadow: 0 0 18px 3px rgba(22, 242, 179, 0.55);
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.reveal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.reveal-legend .on {
  color: var(--mint);
}

.reveal-legend__bar {
  width: min(180px, 32vw);
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.reveal-legend__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
}

/* ------------------------------------------------------------
   Animation 2 — horizontal scroll timeline
   ------------------------------------------------------------ */
.hscroll {
  position: relative;
  /* height is set by JS to match the track width */
  height: 400vh;
}

.hscroll__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1rem, 3vh, 2rem);
  overflow: hidden;
}

.hscroll__head {
  flex: none;
}

.hscroll__head .section__title {
  margin-bottom: 1rem;
}

.hscroll__progress {
  width: min(260px, 50vw);
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.hscroll__progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
}

.hscroll__track {
  display: flex;
  align-items: stretch;
  gap: clamp(1rem, 2.4vw, 1.8rem);
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  width: max-content;
  will-change: transform;
}

.tcard {
  flex: none;
  width: min(340px, 76vw);
  border-radius: 18px;
  padding: 1.6rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s linear, transform 0.4s var(--ease);
}

.tcard::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.tcard.is-active::before {
  transform: scaleX(1);
}

.tcard.is-active {
  border-color: color-mix(in srgb, var(--violet) 55%, transparent);
}

.tcard__year {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}

.tcard h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.tcard__org {
  font-size: 0.85rem;
  color: var(--pink);
  margin: 0;
  font-weight: 600;
}

.tcard p:not(.tcard__org) {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.tcard[data-year]::after {
  content: attr(data-year);
  position: absolute;
  right: -0.4rem;
  bottom: -1.6rem;
  font-size: 5rem;
  font-weight: 800;
  color: var(--fg);
  opacity: 0.05;
  pointer-events: none;
}

.tcard--intro,
.tcard--end {
  justify-content: center;
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.tcard--intro p,
.tcard--end p {
  color: rgba(255, 255, 255, 0.85);
}

.tcard--intro h3,
.tcard--end h3 {
  font-size: 1.5rem;
}

.tcard__hint {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.6rem;
  animation: nudge 1.6s var(--ease) infinite;
}

@keyframes nudge {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(8px);
  }
}

.tcard--end .btn {
  align-self: flex-start;
  margin-top: 0.8rem;
  background: #fff;
  color: #14162b;
  box-shadow: none;
}

.tcard--now .tcard__year {
  color: var(--amber);
}

/* Fallback for small screens / reduced motion: normal horizontal swipe */
.hscroll.is-native {
  height: auto !important;
}

.hscroll.is-native .hscroll__sticky {
  position: static;
  height: auto;
  padding: clamp(4rem, 10vh, 7rem) 0;
  overflow: visible;
}

.hscroll.is-native .hscroll__track {
  transform: none !important;
  overflow-x: auto;
  width: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.hscroll.is-native .tcard {
  scroll-snap-align: center;
}

/* ------------------------------------------------------------
   Animation 7 — projects with magnifying lens
   ------------------------------------------------------------ */
.projgrid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.8rem);
  grid-template-columns: 1fr;
  margin-top: 2.5rem;
}

@media (min-width: 760px) {
  .projgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pcard {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
    border-color 0.3s linear;
}

.pcard.is-in {
  opacity: 1;
  transform: none;
}

.pcard:hover {
  border-color: color-mix(in srgb, var(--violet) 60%, transparent);
}

.lens-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b0f21;
}

.lens-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s linear;
}

.lens-wrap:hover img {
  transform: scale(1.04);
}

/* the hidden layer the lens reveals */
.lens-under {
  position: absolute;
  inset: 0;
  padding: 1rem;
  background: #060a18;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.7;
  color: #7fe7c4;
  overflow: hidden;
  /* clipped to a circle at the pointer by JS */
  clip-path: circle(0px at 50% 50%);
  transition: clip-path 0.18s linear;
}

.lens-under::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(127, 231, 196, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 231, 196, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}

.lens-under__code {
  position: relative;
  white-space: pre;
}

.lens-under__tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}

.lens-under__tags span {
  border: 1px solid rgba(127, 231, 196, 0.4);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.58rem;
  color: #b8f5e0;
}

/* the visible ring around the lens */
.lens-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(22, 242, 179, 0.9);
  box-shadow: 0 0 26px 4px rgba(22, 242, 179, 0.45),
    inset 0 0 30px rgba(22, 242, 179, 0.22);
  opacity: 0;
  transition: opacity 0.2s linear, width 0.18s var(--ease), height 0.18s var(--ease);
}

.lens-hint {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cfd6ee;
  background: rgba(6, 10, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: opacity 0.25s linear;
}

.lens-wrap:hover .lens-hint {
  opacity: 0;
}

.pcard__body {
  padding: 1.3rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.pcard__role {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
}

.pcard__name {
  font-size: 1.15rem;
  font-weight: 700;
}

.pcard__desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.pcard__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.8rem;
}

.pcard__tools span {
  font-size: 0.66rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ------------------------------------------------------------
   Contact + footer
   ------------------------------------------------------------ */
.contact__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  margin-top: 2.5rem;
  align-items: start;
}

@media (min-width: 860px) {
  .contact__grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.contact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.contact__list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.contact__list span {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__list a {
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  width: fit-content;
  transition: color 0.25s linear;
}

.contact__list a:hover {
  color: var(--pink);
}

.contact__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 1.1rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Small screens: the pinned build scene has to fit one viewport */
@media (max-width: 899px) {
  .assemble__grid {
    gap: 0.9rem;
  }

  .editor {
    min-height: 0;
    height: 40vh;
  }

  .preview {
    min-height: 0;
    height: 34vh;
  }

  .pv-card {
    padding: 1rem;
  }

  .pv-card__avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 0.6rem;
  }
}


/* ------------------------------------------------------------
   Reduced motion — keep the content, drop the choreography
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .skilltile,
  .pcard {
    opacity: 1 !important;
    transform: none !important;
  }

  .assemble,
  .reveal-scene {
    height: auto !important;
  }

  .assemble__sticky,
  .reveal-scene__sticky {
    position: static;
    height: auto;
    padding: 2rem 0;
  }

  .editor__code .ln {
    opacity: 1;
    transform: none;
  }

  .pv-card,
  .pv-card > * {
    opacity: 1;
    transform: none;
  }

  .layer--wire {
    display: none;
  }

  .cursor-layer {
    display: none !important;
  }
}
