  :root{
    --bg: #0b0b0c;
    --bg-raised: #141416;
    --ink: #f3efe7;
    --muted: #8a857d;
    --hairline: #2a2a2c;
    --red: #e8998d;
    --red-dim: #4a2b27;
    --blue: #9db4e8;
    --blue-dim: #262f47;
    --green: #a8dcc0;
    --lavender: #c6b8e0;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  *,*::before,*::after{ box-sizing: inherit; }
  html{ scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; overflow-x: hidden; }
  body{ overflow-x: hidden; }

  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
    *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  }

  body{
    margin:0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1,h2,h3{
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.015em;
  }

  a{ color: inherit; }
  a:focus-visible, button:focus-visible{
    outline: 2px solid var(--red);
    outline-offset: 4px;
  }

  ::selection{ background: var(--red); color: #0b0b0c; }

  .wrap{
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
  }
  @media (max-width: 640px){ .wrap{ padding: 0 20px; } }

  /* film grain overlay */
  .grain{
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    opacity: 0.05;
    mix-blend-mode: overlay;
  }

  /* ---------- custom cursor + contrail ---------- */
  @media (hover: hover) and (pointer: fine){
    html.has-cursor, html.has-cursor *{ cursor: none !important; }
  }
  .cursor-dot, .cursor-trail{
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 950;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot{
    width: 12px; height: 12px;
    background: var(--red);
    opacity: 0;
    transition: opacity .25s ease, width .25s ease, height .25s ease, background-color .18s ease;
  }
  .cursor-trail{
    width: 34px; height: 34px;
    background: radial-gradient(circle, var(--blue) 0%, transparent 70%);
    opacity: 0;
    filter: blur(1px);
    transition: opacity .3s ease, width .3s ease, height .3s ease;
  }
  html.has-cursor .cursor-dot,
  html.has-cursor .cursor-trail{ opacity: 1; }
  html.cursor-active .cursor-dot{ width: 20px; height: 20px; background: var(--ink); }
  html.cursor-active .cursor-trail{ width: 60px; height: 60px; opacity: .85; }

  /* over the nav: the dot itself inverts whatever it's covering, letter by letter,
     instead of sitting on top as a solid shape */
  html.cursor-invert .cursor-dot{
    width: 26px; height: 26px;
    background: #ffffff;
    mix-blend-mode: difference;
  }
  html.cursor-invert .cursor-trail{ opacity: 0; }

  /* ---------- word-level hover inversion ---------- */
  .word{
    display: inline-block;
    border-radius: 3px;
    padding: 0 0.05em;
    margin: 0 -0.05em;
    transition: background-color .15s ease, color .15s ease;
  }
  .word-plain:hover{ background: var(--lavender); color: var(--bg); }
  .word-click{ text-decoration: inherit; }
  .word-click:hover{ background: var(--green); color: var(--bg); }

  /* ---------- scroll reveals ---------- */
  .reveal{
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  }
  .reveal.in-view{ opacity: 1; transform: translateY(0); }

  .frame .develop{
    position: absolute; inset: 0;
    background: var(--bg);
    z-index: 2;
    transform-origin: left;
    transition: transform 1.1s cubic-bezier(.65,0,.35,1);
  }
  .frame.in-view .develop{ transform: scaleX(0); }

  /* ---------- flash / nav ---------- */
  .flash{
    position: fixed;
    inset: 0;
    background: var(--ink);
    z-index: 900;
    animation: flashOut 1.15s cubic-bezier(.2,.7,.2,1) forwards;
    pointer-events: none;
  }
  @keyframes flashOut{
    0%{ opacity: 1; }
    40%{ opacity: 1; }
    100%{ opacity: 0; }
  }

  nav{
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0; right: 0;
    z-index: 300;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 32px;
    font-size: 14px;
    letter-spacing: 0;
    mix-blend-mode: difference;
  }
  @media (max-width: 640px){ nav{ padding: 18px 20px; } }
  nav .mark{ font-weight: 600; }
  nav .links{ display:flex; gap: 24px; }
  nav .links a{ text-decoration: none; opacity: 0.85; transition: opacity .2s; }
  nav .links a:hover{ opacity: 1; }
  @media (max-width: 560px){ nav .links{ gap: 16px; } nav .links span{ display:none; } }

  /* ---------- hero ---------- */
  .hero{
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 90px;
    position: relative;
    overflow: hidden;
  }
  /* a faint duotone bloom that drifts behind the hero text, following the
     cursor — like light leaking through film. desktop/fine-pointer only. */
  .hero-glow{
    position: absolute;
    top: 50%; left: 50%;
    width: 560px; height: 560px;
    background: radial-gradient(circle, var(--red) 0%, var(--blue) 55%, transparent 72%);
    filter: blur(80px);
    opacity: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity .6s ease;
    z-index: 0;
  }
  html.has-cursor .hero-glow.is-active{ opacity: 0.4; }
  .hero-kicker,
  .hero h1,
  .hero-sub,
  .hero-foot{
    position: relative;
    z-index: 1;
  }
  .hero-kicker{
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 18px;
  }
  .hero h1{
    font-size: clamp(48px, 9.5vw, 122px);
    max-width: 16ch;
    letter-spacing: -0.03em;
  }
  .hero h1 em{
    font-style: normal;
    color: var(--red);
  }
  .hero-sub{
    max-width: 46ch;
    margin-top: 28px;
    font-size: 18px;
    color: var(--muted);
  }
  .hero-foot{
    position: absolute;
    bottom: 40px;
    left: 32px;
    right: 32px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
  }
  @media (max-width: 640px){ .hero-foot{ left: 20px; right: 20px; font-size: 11px; } }

  /* ---------- page hero (category pages) ---------- */
  .page-hero{
    padding-top: 150px;
    padding-bottom: 70px;
    position: relative;
  }
  .page-hero h1{
    font-size: clamp(42px, 7.5vw, 88px);
    max-width: 16ch;
    letter-spacing: -0.02em;
  }
  .back-link{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 30px;
    transition: color .2s ease, gap .2s ease;
  }
  .back-link:hover{ color: var(--ink); gap: 10px; }

  /* ---------- statement ---------- */
  .statement{
    padding-top: 140px;
    padding-bottom: 140px;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
  }
  .statement p{
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(26px, 3.8vw, 44px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    max-width: 19ch;
    margin: 0;
  }
  .statement p span{ color: var(--muted); }

  /* ---------- marquee ---------- */
  .marquee{
    border-bottom: 1px solid var(--hairline);
    padding: 26px 0;
    overflow: hidden;
    white-space: nowrap;
  }
  .marquee-track{
    display: inline-flex;
    align-items: center;
    will-change: transform;
  }
  .marquee-track span{
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.005em;
    padding: 0 22px;
    color: var(--muted);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
  }
  .marquee-track span.sep{ color: var(--blue); }

  /* pieces fade in one at a time as the strip scrolls into view, instead of
     popping in as one solid block */
  .marquee.in-view .marquee-track span{ opacity: 1; transform: none; }
  .marquee-track span:nth-child(1){ transition-delay: 0ms; }
  .marquee-track span:nth-child(2){ transition-delay: 60ms; }
  .marquee-track span:nth-child(3){ transition-delay: 120ms; }
  .marquee-track span:nth-child(4){ transition-delay: 180ms; }
  .marquee-track span:nth-child(5){ transition-delay: 240ms; }
  .marquee-track span:nth-child(6){ transition-delay: 300ms; }
  .marquee-track span:nth-child(7){ transition-delay: 360ms; }
  .marquee-track span:nth-child(8){ transition-delay: 420ms; }
  .marquee-track span:nth-child(9){ transition-delay: 480ms; }
  .marquee-track span:nth-child(10){ transition-delay: 540ms; }
  .marquee-track span:nth-child(11){ transition-delay: 600ms; }
  .marquee-track span:nth-child(12){ transition-delay: 660ms; }

  /* ---------- work (homepage alternating rows) ---------- */
  .work{
    padding-top: 130px;
    padding-bottom: 130px;
  }
  .work-item{
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
    padding: 90px 0;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none;
  }
  .work-item:first-child{ padding-top: 0; }
  .work-item.reverse{ direction: rtl; }
  .work-item.reverse > *{ direction: ltr; }
  @media (max-width: 860px){
    .work-item, .work-item.reverse{ grid-template-columns: 1fr; direction: ltr; gap: 32px; padding: 60px 0; }
  }

  /* ---------- project grid (category pages): clean thumbnails, title on hover ---------- */
  .project-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding-top: 20px;
    padding-bottom: 150px;
  }
  @media (max-width: 980px){ .project-grid{ grid-template-columns: 1fr 1fr; gap: 24px; } }
  @media (max-width: 640px){ .project-grid{ grid-template-columns: 1fr; gap: 24px; } }
  .project-card{
    display: block;
    text-decoration: none;
  }
  /* the tag/index corner marks stay put; title + meta live in an overlay that
     only appears on hover, alongside the same lift the homepage rows get */
  .project-card .frame .tag,
  .project-card .frame .idx{
    z-index: 3;
  }
  .project-card .card-title{
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    background: linear-gradient(to top, rgba(11,11,12,.85), rgba(11,11,12,.2) 55%, transparent 85%);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
  }
  .project-card .frame:hover .card-title,
  .project-card .frame.is-hover .card-title{
    opacity: 1;
    transform: none;
  }
  .project-card .card-meta{
    color: var(--red);
    font-size: 13px;
    margin-bottom: 6px;
  }
  .project-card .card-title h3{
    font-size: clamp(20px, 2.4vw, 26px);
    color: var(--ink);
  }

  /* ---------- shared: image/media frame + its hover lift ---------- */
  .frame{
    position: relative;
    aspect-ratio: 4/3;
    background: var(--bg-raised);
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 22px;
    box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 16px 34px -22px rgba(0,0,0,.6);
    transition: border-color .4s ease, transform .5s cubic-bezier(.22,1,.36,1), box-shadow .5s cubic-bezier(.22,1,.36,1);
  }
  .frame .fill{
    position: absolute; inset: 0;
    background: linear-gradient(150deg, var(--red-dim), var(--bg-raised) 45%, var(--blue-dim) 100%);
    opacity: 0.9;
  }
  .frame .thumb{
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  /* once a real photo/video still is in place, drop the placeholder wash and
     let the duotone .ghost layer do the hover accent on top of the image instead */
  .frame.has-photo .fill{ opacity: 0; }
  .frame .ghost{
    position: absolute; inset: 0;
    background: linear-gradient(150deg, var(--red), transparent 45%, var(--blue) 100%);
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1.4s ease, transform 1.4s ease;
    mix-blend-mode: screen;
  }
  /* the lift is scoped to the .frame (the image) itself, not the whole row/card
     it sits in — so it only fires when the cursor is actually over the thumbnail.
     the same lift applies whether native :hover caught it or our scroll-aware
     JS check did (.is-hover) — see script.js for why both exist. */
  .frame:hover,
  .frame.is-hover{
    border-color: var(--red-dim);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 34px 60px -22px rgba(0,0,0,.7), 0 14px 30px -12px rgba(232,153,141,.22);
  }
  .frame:hover .ghost,
  .frame.is-hover .ghost{
    opacity: 0.75;
    transform: scale(1.16);
    transition: opacity .12s ease, transform 2s ease;
  }
  .frame:hover ~ .work-text h3::after,
  .frame.is-hover ~ .work-text h3::after,
  .work-text h3:hover::after{
    opacity: 1;
    transform: translateX(0);
  }
  .frame .tag{
    position: absolute;
    top: 16px; left: 16px;
    font-size: 13px;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 1px 12px rgba(0,0,0,.5);
  }
  .frame .idx{
    position: absolute;
    bottom: 16px; right: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    color: var(--ink);
    text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 1px 12px rgba(0,0,0,.5);
  }

  .work-text .discipline{
    color: var(--red);
    font-size: 14px;
    letter-spacing: 0;
    margin-bottom: 14px;
  }
  .work-text h3{
    font-size: clamp(30px, 4vw, 48px);
    margin-bottom: 18px;
  }
  .work-text h3::after{
    content: '→';
    display: inline-block;
    margin-left: 10px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .3s ease, transform .3s ease;
    color: var(--green);
  }
  .work-text p{
    color: var(--muted);
    max-width: 42ch;
    font-size: 16px;
  }

  /* ---------- about ---------- */
  .about{
    padding-top: 130px;
    padding-bottom: 130px;
    border-top: 1px solid var(--hairline);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  @media (max-width: 860px){ .about{ grid-template-columns: 1fr; gap: 36px; } }
  .about h2{
    font-size: clamp(36px, 5vw, 60px);
  }
  .about-body{ color: var(--muted); max-width: 48ch; }
  .about-body p + p{ margin-top: 16px; }

  /* ---------- footer ---------- */
  footer{
    padding: 70px 0 60px;
    border-top: 1px solid var(--hairline);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
  }
  footer .get-in-touch h2{
    font-size: clamp(38px, 7vw, 84px);
  }
  footer a.mail{
    text-decoration: none;
    border-bottom: 1px solid var(--red-dim);
    padding-bottom: 4px;
    transition: border-color .2s;
  }
  footer a.mail:hover{ border-color: var(--red); }
  footer .meta{
    text-align: right;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
  }
  footer .meta a{
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--red-dim);
    text-underline-offset: 3px;
    transition: color .2s ease, text-decoration-color .2s ease;
  }
  footer .meta a:hover{ color: var(--ink); text-decoration-color: var(--red); }
  @media (max-width: 560px){ footer .meta{ text-align: left; } }

  /* pure blank space after the footer, so the contact links land closer to
     natural gaze instead of right at the bottom edge of the screen */
  .page-end{
    height: 30vh;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 100%, rgba(232,153,141,0.10) 0%, rgba(38,42,71,0.08) 45%, transparent 75%);
  }
  .ember-field{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
  }
