:root {
  --bg: #0d0d0d;
  --bg-soft: #161616;
  --ink: #f4f4f7;
  --ink-dim: #a0a0a0;
  --ink-faint: #6f6f6f;
  --line: rgba(255, 255, 255, 0.12);

  --code: #b96d60;
  --vfx: #b96d60;

  --font-display: "Syne", sans-serif;
  --font-body: "Space Grotesk", sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --tilt: -8deg;
  --tilt-offset: -7.03vh;

  --split: 50%;
  --code-opacity: 1;
  --vfx-opacity: 1;
  --code-bg-opacity: 1;
  --vfx-bg-opacity: 1;
  --card-shift: 0px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header (shared) ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  color: var(--vfx);
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ink);
}

.nav__link.is-active {
  border-bottom: 1px solid var(--vfx);
}

/* ---------- Landing: full viewport, no scroll ---------- */
body.landing {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Showreel background (clipped to the line) ---------- */
.showreel-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0a0a0a;
  opacity: var(--vfx-bg-opacity);
  clip-path: polygon(
    calc(var(--split) + var(--tilt-offset)) 0,
    100% 0,
    100% 100%,
    calc(var(--split) - var(--tilt-offset)) 100%
  );
}

.showreel-bg .side__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showreel-bg .side__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* ---------- Code background (mirrored clip) ---------- */
.code-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #0a0a0a;
  opacity: var(--code-bg-opacity);
  clip-path: polygon(
    0 0,
    calc(var(--split) + var(--tilt-offset)) 0,
    calc(var(--split) - var(--tilt-offset)) 100%,
    0 100%
  );
}

.code-bg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.45) contrast(1.22) brightness(0.92);
}

.code-bg__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 10, 0.82) 0%,
    rgba(10, 10, 10, 0.4) 55%,
    rgba(10, 10, 10, 0.08) 100%
  );
}

.code-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 130% at 18% 50%,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0.62) 100%
  );
}

/* ---------- Divider line ---------- */
.divider {
  position: absolute;
  top: -12%;
  bottom: -12%;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%) rotate(var(--tilt));
  transform-origin: center;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--code) 18%,
    rgba(255, 255, 255, 0.6) 50%,
    var(--vfx) 82%,
    transparent 100%
  );
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
  z-index: 10;
  transition: opacity 0.4s var(--ease);
}

/* ---------- Sides ---------- */
.side {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 2;
}

.side--code {
  width: var(--split);
}

.side--vfx {
  width: calc(100% - var(--split));
}

.side__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: clamp(96px, 14vh, 150px) clamp(28px, 6vw, 88px) clamp(36px, 7vh, 60px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 16px);
}

.side--code .side__inner {
  align-items: flex-start;
  text-align: left;
  opacity: var(--code-opacity);
}

.side--vfx .side__inner {
  align-items: flex-end;
  text-align: right;
  justify-content: space-between;
  opacity: var(--vfx-opacity);
}

.side.is-collapsed .side__inner {
  pointer-events: none;
}

.side__head {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 16px);
  align-items: flex-end;
  text-align: right;
}

.side__foot {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 16px);
  align-items: flex-end;
  text-align: right;
}

.side__index {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.side--vfx .side__index {
  color: rgba(244, 244, 247, 0.75);
}

.side__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vh, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.side__title span {
  display: block;
  font-size: clamp(1rem, 2.6vh, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 12px;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-dim);
}

.side--code .side__title {
  color: var(--ink);
  text-shadow: 0 0 40px rgba(185, 109, 96, 0.28);
}

.side--vfx .side__title {
  color: var(--ink);
  text-shadow: 0 0 40px rgba(185, 109, 96, 0.32);
}

.side--vfx .side__title span {
  -webkit-text-stroke: 1px rgba(244, 244, 247, 0.55);
}

.side__sub {
  font-size: 0.95rem;
  color: var(--ink-dim);
  max-width: 320px;
}

.side--vfx .side__sub {
  color: rgba(244, 244, 247, 0.72);
}

.side__hint {
  display: none;
  font-size: 0.74rem;
  color: var(--ink-dim);
  max-width: 320px;
}

.side__hint code {
  color: var(--vfx);
  font-family: var(--font-body);
}

body.no-video .side__hint {
  display: block;
}

/* ---------- Collage (code side) ---------- */
.collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.6vh, 14px);
  width: 100%;
  max-width: 460px;
  margin-top: clamp(8px, 1.6vh, 14px);
}

.tile {
  position: relative;
  border-radius: 14px;
  background: #141414;
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tile:hover {
  border-color: rgba(185, 109, 96, 0.55);
  box-shadow: 0 20px 50px -18px rgba(185, 109, 96, 0.5);
  z-index: 3;
}

.tile__bar {
  display: flex;
  gap: 5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.tile__bar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.tile__screen {
  position: relative;
  height: clamp(96px, 16vh, 140px);
  overflow: hidden;
}

.tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s var(--ease);
}

.tile:hover .tile__img {
  transform: scale(1.06);
}

.tile__tag {
  position: absolute;
  left: 12px;
  bottom: 9px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ---------- CTA ---------- */
.side__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 40px;
  border: 1px solid var(--line);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.side__cta--code {
  color: var(--code);
  background: rgba(185, 109, 96, 0.12);
  border-color: rgba(185, 109, 96, 0.28);
  margin-top: 10px;
}

.side__cta--vfx {
  color: var(--vfx);
  background: rgba(185, 109, 96, 0.12);
  border-color: rgba(185, 109, 96, 0.28);
}

.side__cta--code:hover,
.side__cta--vfx:hover {
  background: var(--code);
  border-color: var(--code);
  color: #0d0d0d;
}

/* ---------- Favorites (vfx side) ---------- */
.favorites__label {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.favorites {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 460px;
}

.favorite {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(16, 16, 16, 0.6);
}

.favorite__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.favorite__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.favorite__name {
  padding: 8px 10px;
  font-size: 0.72rem;
  color: var(--ink);
}

/* ---------- About card ---------- */
.about {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--card-shift)), -50%);
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.about-card {
  pointer-events: auto;
  width: clamp(300px, 24vw, 380px);
  padding: clamp(26px, 4vh, 32px) clamp(22px, 3vw, 28px);
  text-align: center;
  border-radius: 22px;
  background: rgba(18, 18, 18, 0.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-card__photo {
  position: relative;
  width: clamp(80px, 10vh, 96px);
  height: clamp(80px, 10vh, 96px);
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1a1a;
  margin-bottom: clamp(14px, 2.5vh, 20px);
}

.about-card__photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-card__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--vfx);
}

.about-card__hello {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.about-card__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vh, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.about-card__role {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-dim);
}

.about-card__btn {
  margin-top: clamp(16px, 3vh, 22px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 40px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.about-card__btn:hover {
  border-color: var(--vfx);
  background: rgba(185, 109, 96, 0.1);
}

/* ---------- Split interaction ---------- */
.side__sliver {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  z-index: 1;
}

.side__sliver--code {
  left: 0;
  border-right: 1px solid var(--line);
}

.side__sliver--vfx {
  right: 0;
  border-left: 1px solid var(--line);
}

.side--code.is-collapsed .side__sliver--code,
.side--vfx.is-collapsed .side__sliver--vfx {
  opacity: 1;
}

/* ---------- About overlay ---------- */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
}

.about-overlay.is-open,
.about-overlay.is-closing {
  visibility: visible;
}

.about-overlay__surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 0;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.9s var(--ease),
    border-radius 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    background-color 0.9s var(--ease),
    border-color 0.9s var(--ease);
}

.about-overlay__scroll {
  position: absolute;
  inset: 0;
  overflow-y: hidden;
  padding: clamp(80px, 13vh, 132px) clamp(20px, 6vw, 88px) clamp(64px, 11vh, 110px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.about-overlay.is-expanded .about-overlay__scroll {
  overflow-y: auto;
}

.about-overlay__scroll::-webkit-scrollbar {
  width: 10px;
}

.about-overlay__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.about-overlay__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.about-overlay__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
}

.about-overlay__inner {
  max-width: 760px;
  margin: 0 auto;
}

.about-overlay__body {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.about-overlay.is-open .about-overlay__body {
  opacity: 1;
  transform: none;
  transition-delay: 0.6s;
}

.about-overlay.is-closing .about-overlay__body {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

body.about-open .about {
  opacity: 0;
  pointer-events: none;
}

body.about-open .about-card {
  pointer-events: none;
}

.about-overlay__close {
  position: fixed;
  top: 22px;
  right: clamp(20px, 5vw, 56px);
  z-index: 71;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.about-overlay__close:hover {
  border-color: var(--vfx);
  transform: rotate(90deg);
}

.about-overlay__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: clamp(40px, 8vh, 72px);
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.9s var(--ease);
}

.about-overlay__photo {
  position: relative;
  width: clamp(104px, 15vh, 144px);
  height: clamp(104px, 15vh, 144px);
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1a1a;
  margin-bottom: 8px;
}

.about-overlay__photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-overlay__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  color: var(--vfx);
}

.about-overlay__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.about-overlay__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vh, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.about-overlay__role {
  font-size: 0.95rem;
  color: var(--ink-dim);
}

.about-overlay__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.about-overlay__section {
  margin-top: clamp(40px, 8vh, 68px);
}

.about-overlay__section--cta {
  padding: clamp(30px, 6vh, 48px);
  border: 1px solid var(--line);
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.about-overlay__label {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

.about-overlay__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vh, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.about-overlay__text {
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 620px;
}

.about-overlay__text + .about-overlay__text {
  margin-top: 14px;
}

.about-overlay__skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.about-overlay__sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.about-overlay__sub--code {
  color: var(--code);
}

.about-overlay__sub--creative {
  color: var(--vfx);
}

.about-overlay__skills ul {
  list-style: none;
}

.about-overlay__skills li {
  padding: 11px 2px;
  font-size: 0.92rem;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}

.about-overlay__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.about-overlay__tool {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.about-overlay__tool img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.about-overlay__tool span {
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.about-overlay__projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.about-overlay__project {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.about-overlay__project h3 {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.about-overlay__project p {
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-dim);
}

.about-overlay__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 24px;
  border-radius: 40px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.about-overlay__cta:hover {
  border-color: var(--vfx);
  background: rgba(185, 109, 96, 0.1);
}

@media (max-width: 560px) {
  .about-overlay__skills,
  .about-overlay__projects {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reveal animations ---------- */
.side__inner > * {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 0.9s var(--ease) forwards;
}

.side--code .side__inner > *:nth-child(1) { animation-delay: 0.05s; }
.side--code .side__inner > *:nth-child(2) { animation-delay: 0.12s; }
.side--code .side__inner > *:nth-child(3) { animation-delay: 0.2s; }
.side--code .side__inner > *:nth-child(4) { animation-delay: 0.3s; }
.side--code .side__inner > *:nth-child(5) { animation-delay: 0.4s; }

.side--vfx .side__head { animation-delay: 0.15s; }
.side--vfx .side__foot { animation-delay: 0.3s; }

.about-card {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s var(--ease) 0.55s forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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