:root {
    --orange: #FF4800;
    --black: #0a0a0a;
    --white: #f5f0eb;
    --mid: #1a1a1a;
  }

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

  html { scroll-behavior: smooth; }

  body {
    background: var(--black);
    color: var(--white);
    font-family: 'Space Mono', monospace;
    cursor: none;
    overflow-x: hidden;
  }

  /* Custom cursor */
  #cursor {
    position: fixed;
    width: 12px; height: 12px;
    background: var(--orange);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%,-50%);
    transition: transform 0.08s ease, width 0.2s, height 0.2s;
    mix-blend-mode: difference;
  }
  #cursor.big { width: 40px; height: 40px; }

  /* ── P5 canvas background ── */
  #p5-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
  }

  /* ── NAV ── */
  nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2.5rem;
    mix-blend-mode: difference;
  }
  .nav-logo {
    width: 48px; height: 48px;
    filter: invert(1);
  }
  .nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--white);
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--orange); }

  /* ── SECTIONS ── */
  section {
    position: relative;
    z-index: 10;
  }

  /* ── HERO ── */
  #hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 2.5rem 4rem;
    overflow: hidden;
  }
  .hero-tag {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 1rem;
  }
  .hero-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 14vw, 13rem);
    line-height: 0.9;
    color: var(--white);
    letter-spacing: -0.01em;
  }
  .hero-name span { color: var(--orange); }
  .hero-sub {
    margin-top: 1.5rem;
    font-size: 0.78rem;
    max-width: 420px;
    line-height: 1.7;
    opacity: 0.6;
  }
  .scroll-hint {
    position: absolute;
    bottom: 2rem; right: 2.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.4;
    writing-mode: vertical-rl;
  }

  /* ── WORK ── */
  #work {
    padding: 8rem 2.5rem 6rem;
  }
  .section-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--orange);
    opacity: 0.3;
  }

  .projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .project-card {
    position: relative;
    overflow: hidden;
    background: var(--mid);
    aspect-ratio: 4/5;
    cursor: none;
  }
  .project-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), filter 0.4s;
    filter: saturate(0.85);
  }
  .project-card:hover img {
    transform: scale(1.07);
    filter: saturate(1.1);
  }
  .project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
  }
  .project-card:hover .project-overlay { opacity: 1; }
  .project-num {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--orange);
    margin-bottom: 0.4rem;
  }
  .project-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--white);
  }
  .project-tags {
    margin-top: 0.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    opacity: 0.6;
    text-transform: uppercase;
  }

  /* ── ABOUT ── */
  #about {
    padding: 8rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
  }
  .about-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.95;
    color: var(--white);
  }
  .about-heading em {
    color: var(--orange);
    font-style: normal;
  }
  .about-body p {
    font-size: 0.82rem;
    line-height: 1.9;
    opacity: 0.7;
    margin-bottom: 1.2rem;
  }
  .about-stats {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
  }
  .stat-val {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    color: var(--orange);
    line-height: 1;
  }
  .stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 0.3rem;
  }

  /* ── CONTACT ── */
  #contact {
    padding: 8rem 2.5rem 6rem;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .contact-inner {
    max-width: 640px;
  }
  .contact-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    color: var(--white);
    margin-bottom: 2rem;
  }
  .contact-heading em {
    color: var(--orange);
    font-style: normal;
    display: block;
  }
  .contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
  }
  .contact-link {
    font-size: 0.8rem;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
  }
  .contact-link:hover { opacity: 1; color: var(--orange); }
  .contact-link::before {
    content: '→';
    color: var(--orange);
    font-size: 0.9rem;
  }

  /* ── FOOTER ── */
  footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    opacity: 0.35;
    text-transform: uppercase;
    position: relative;
    z-index: 10;
  }

  /* ── ANIMATIONS ── */
  .reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16,1,0.3,1);
  }
  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  /* ── PHYSICS STAGE ── */
  #physics-stage {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
  }

  .pcard {
    position: absolute;
    width: 340px;
    background: #111;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    cursor: grab;
    user-select: none;
    will-change: transform;
    transition: box-shadow 0.2s;
  }
  .pcard:active { cursor: grabbing; box-shadow: 0 20px 60px rgba(0,0,0,0.9); }
  .pcard img {
    width: 100%;
    aspect-ratio: 4/5;
    display: block;
    pointer-events: none;
  }
  .pcard-info {
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(255,72,0,0.25);
  }
  .pcard-num {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--orange);
    margin-bottom: 0.2rem;
  }
  .pcard-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--white);
  }
  .pcard-tag {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    opacity: 0.45;
    text-transform: uppercase;
    margin-top: 0.25rem;
  }
  #throw-hint {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.5s;
  }

  /* ── LIGHTBOX ── */
  #lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  #lightbox.open {
    opacity: 1;
    pointer-events: all;
  }
  #lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  #lightbox-card {
    position: relative;
    z-index: 2;
    width: min(780px, 92vw);
    background: #111;
    box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,72,0,0.15);
    transform: scale(0.82) translateY(30px);
    transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
  }
  #lightbox.open #lightbox-card {
    transform: scale(1) translateY(0);
  }
  #lightbox-card img {
    width: 100%;
    display: block;
    max-height: 75vh;
    object-fit: contain;
  }
  #lightbox-card .pcard-info {
    padding: 1.2rem 1.4rem 1.4rem;
  }
  #lightbox-card .pcard-title {
    font-size: 2rem;
  }
  #lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--white);
    opacity: 0.5;
    cursor: none;
    background: none;
    border: none;
    padding: 0;
    transition: opacity 0.2s, color 0.2s;
  }
  #lightbox-close:hover { opacity: 1; color: var(--orange); }

  /* ── LIGHTBOX ARROWS ── */
  .lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
  }
  .lb-arrow:hover { border-color: var(--orange); color: var(--orange); background: rgba(255,72,0,0.08); }
  #lb-prev { right: calc(100% + 1.2rem); }
  #lb-next { left:  calc(100% + 1.2rem); }
  #lightbox-counter {
    position: absolute;
    bottom: -2.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    opacity: 0.4;
    white-space: nowrap;
  }

  /* ── FLIP WORD ── */
  #flip-word {
    display: inline-block;
    color: var(--orange);
    font-style: normal;
    animation: none;
  }
  .flip-out {
    animation: flipOut 0.25s cubic-bezier(0.4,0,1,1) forwards;
  }
  .flip-in {
    animation: flipIn 0.3s cubic-bezier(0,0,0.2,1) forwards;
  }
  @keyframes flipOut {
    0%   { opacity: 1; transform: translateY(0)     rotateX(0deg);   }
    100% { opacity: 0; transform: translateY(-18px) rotateX(-60deg); }
  }
  @keyframes flipIn {
    0%   { opacity: 0; transform: translateY(18px)  rotateX(60deg);  }
    100% { opacity: 1; transform: translateY(0)     rotateX(0deg);   }
  }