/* ==========================================================================
   Duyio Haiphane — portfolio
   Tokens measured from the live Framer site (1440px desktop / 1024px tablet).
   ========================================================================== */

@font-face { font-family: "Inter Display"; src: url("/fonts/inter-display-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/inter-display-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/inter-display-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #05020f;
  --fg: #fff;
  --accent: #c72a09;   /* rust — shader palette stop */
  --blue: #1b0bb3;     /* blue — shader palette stop */
  --pad: 32px;
  --nav-h: 67px;
  --font: "Inter Display", "Inter", system-ui, -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, canvas { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }

/* ---------- Roll label (hover swap) ---------- */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.2; }
.roll__a, .roll__b { display: block; transition: transform .45s var(--ease); }
.roll__b { position: absolute; inset: 0; transform: translateY(105%); }
a:hover .roll__a, a:focus-visible .roll__a { transform: translateY(-105%); }
a:hover .roll__b, a:focus-visible .roll__b { transform: translateY(0); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); padding: 12px 28px;
  font-size: 16px;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
/* soft blurred veil behind the bar */
.nav::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 90px; z-index: -1; pointer-events: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(#000 0%, transparent 100%);
          mask-image: linear-gradient(#000 0%, transparent 100%);
  opacity: .9;
}
.nav__logo { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.nav__links { position: absolute; left: calc(50% - 112px); top: 50%; transform: translateY(-50%); display: flex; gap: 32px; }
.nav__link { position: relative; display: inline-block; }
.nav__link sup { position: absolute; top: -6px; right: -14px; font-size: 10px; font-weight: 400; line-height: 12px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 999px;
  color: var(--fg); background: transparent;
  transition: background-color .35s var(--ease), color .35s var(--ease), padding .35s var(--ease);
}
.cta .icon { color: currentColor; transition: color .3s; }
.is-scrolled .cta { background: #fff; color: var(--bg); }
.is-scrolled .cta .icon { color: var(--accent); }

/* ---------- Reveal (hero entrance) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(.35em); filter: blur(6px); }
.js.is-ready [data-reveal] {
  opacity: 1; transform: none; filter: none;
  transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 120ms);
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 720px; height: 100svh; overflow: hidden; background: var(--bg); }
.hero__shader { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: var(--grain, none); background-size: 220px 220px;
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.hero__content {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: var(--nav-h) var(--pad) 0;
}
.hero__title {
  font-weight: 700; font-size: min(15.28vw, 270px); line-height: .8; letter-spacing: -0.02em; text-transform: uppercase;
}
.hero__row { display: flex; }
.hero__row--first { justify-content: space-between; align-items: flex-end; }
.hero__row--second { justify-content: flex-end; }
.hero__meta { padding-bottom: 12px; font-size: 14px; }
.hero__services li { position: relative; padding-left: 18px; margin-bottom: 15px; text-transform: uppercase; }
.hero__services li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.hero__time { display: flex; align-items: center; gap: 8px; margin-top: 21px; }
.hero__based { color: var(--accent); }
.clock {
  display: inline-block; min-width: 95px; padding: 3px 8px; text-align: center;
  background: #fff; color: var(--blue); font-size: 16px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.hero__intro { margin-top: 48px; max-width: 400px; font-size: 20px; line-height: 1.2; }

/* ---------- Video ---------- */
.video { padding: var(--pad); }
.video__frame {
  aspect-ratio: 1376 / 751; width: 100%; overflow: hidden; background: #000;
  transform: scale(var(--s, .35)); transform-origin: 50% 50%; will-change: transform;
}
.video__frame video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Works ---------- */
.works { padding: 96px var(--pad) 0; }
.fit { display: block; white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: -0.02em; line-height: .8; overflow: visible; font-size: 9.4vw; }
.fit > span { display: inline-block; }
.works__heading { margin-bottom: 80px; }
.works__list { display: flex; flex-direction: column; gap: 20px; }
.work { height: 420px; }
.work__link { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: 100%; }
.work__text { max-width: 520px; display: flex; flex-direction: column; gap: 24px; align-self: start; }
.work__summary { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; }
.tags li { position: relative; padding-left: 18px; }
.tags li::before { content: ""; position: absolute; left: 5px; top: .5em; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.work__media { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.work__img { height: 374px; overflow: hidden; background: #0c0818; }
.work__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.work__link:hover .work__img img { transform: scale(1.04); }
.work figcaption { font-size: 18px; line-height: 1.2; }

/* scroll-linked dimming (value set from JS: --o) */
.js [data-dim] { opacity: var(--o, .2); }

/* ---------- Footer ---------- */
.footer { display: flex; flex-direction: column; justify-content: space-between; gap: 120px; min-height: 617px; padding: 60px var(--pad) 28px; background: var(--bg); margin-top: 120px; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-start; }
.footer__social { display: flex; gap: 24px; font-size: 14px; }
.footer__top-link { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 18px; transition: transform .4s var(--ease); }
.footer__top-link:hover { transform: translateY(-4px); }
.footer__mail { display: inline-block; font-size: 32px; line-height: 1.2; margin-bottom: 24px; }
.footer__mail:hover { color: var(--accent); }
.footer__legal { margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); font-size: 14px; }
.footer__name { font-size: 9.7vw; }

/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 10px 32px rgba(27, 11, 179, .18), inset 0 0 18px rgba(255, 255, 255, .12);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  pointer-events: none; opacity: 0; transition: opacity .3s, width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease);
  will-change: transform;
}
.cursor.is-on { opacity: 1; }
.cursor.is-big { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- About ---------- */
.about-hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--nav-h) + 120px) var(--pad) 48px; }
.about-hero__title { max-width: 14ch; font-weight: 700; font-size: min(8.2vw, 130px); line-height: .92; letter-spacing: -0.03em; }
.about-hero__scroll { font-size: 14px; text-transform: uppercase; }
.about-media { padding: 0 var(--pad); }
.about-media__frame { width: min(100%, 62vh * 1.0); aspect-ratio: 1 / 1.18; margin-inline: auto; overflow: hidden; background: #000; transform: scale(var(--s, .28)); will-change: transform; }
.about-media__frame img { width: 100%; height: 100%; object-fit: cover; }
.about-list { padding: 160px var(--pad) 0; display: flex; flex-direction: column; gap: 140px; }
.about-item { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.about-item__no { font-size: 14px; }
.about-item__label { font-size: 14px; color: var(--accent); margin-bottom: 20px; }
.about-item__title { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 20px; font-weight: 500; }
.about-item__text { font-size: 20px; line-height: 1.3; max-width: 560px; opacity: .85; }

/* ---------- Project ---------- */
.project { padding: calc(var(--nav-h) + 40px) var(--pad) 0; }
.project__back { display: inline-block; font-size: 14px; margin-bottom: 40px; }
.project__head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: 48px; }
.project__title { font-weight: 700; font-size: min(7.6vw, 120px); line-height: .9; letter-spacing: -0.03em; text-transform: uppercase; }
.project__intro { display: flex; flex-direction: column; gap: 20px; font-size: 20px; line-height: 1.25; max-width: 560px; }
.project__meta { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 14px; opacity: .75; }
.project__cover { overflow: hidden; background: #0c0818; }
.project__cover img { width: 100%; max-height: 80vh; object-fit: cover; }
.project__info { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 96px 0; }
.label { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 14px; }
.project__overview p { font-size: 20px; line-height: 1.3; max-width: 640px; }
.project__credit-title { margin: 24px 0 8px; opacity: .7; }
.project__credits { font-size: 16px; display: grid; gap: 6px; }
.project__facts { display: grid; gap: 32px; align-content: start; }
.project__facts dd { font-size: 24px; letter-spacing: -0.02em; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gallery__item { overflow: hidden; background: #0c0818; aspect-ratio: 16 / 10; }
.gallery__item--wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.more { padding: 120px 0 0; }
.more__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.more__item { display: flex; flex-direction: column; gap: 14px; font-size: 18px; }
.more__item .work__img { height: auto; aspect-ratio: 16 / 10; }
.more__item:hover .work__img img { transform: scale(1.04); }

/* ---------- Tablet (<1200) ---------- */
@media (max-width: 1199px) {
  .nav { padding: 12px 28px; font-size: 14px; }
  .nav__logo { font-size: 20px; }
  .nav__links { left: calc(50% - 106px); }
  .cta { background: #fff; color: var(--bg); }
  .cta .icon { color: var(--accent); }
  .hero__content { justify-content: flex-start; padding-top: calc(var(--nav-h) + 60px); gap: 20px; }
  .hero__row--first { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  .hero__title { font-size: clamp(56px, 7.04vw, 80px); line-height: 1.2; font-weight: 600; }
  .hero__row--first .hero__meta { padding: 0; }
  .hero__intro { margin-top: 56px; font-size: 18px; }
  .work { height: auto; }
  .work__link { grid-template-columns: 1fr 1fr; }
  .work__summary { font-size: 20px; }
  .work__img { height: auto; aspect-ratio: 483 / 374; }
  .footer__mail { font-size: 24px; }
}

/* ---------- Phone (<810) ---------- */
@media (max-width: 809px) {
  :root { --pad: 16px; }
  .nav { padding: 12px 16px; }
  .nav__links { display: none; }
  .cta { padding: 10px 14px; }
  .hero { min-height: 640px; }
  .hero__title { font-size: 14vw; }
  .hero__intro { font-size: 16px; margin-top: 32px; }
  .video { padding: var(--pad); }
  .video__frame { aspect-ratio: 4 / 5; }
  .works { padding-top: 64px; }
  .works__heading { margin-bottom: 48px; }
  .work__link { grid-template-columns: 1fr; gap: 20px; }
  .work { padding-bottom: 32px; }
  .work__text { order: 2; max-width: none; }
  .work__media { order: 1; }
  .work__summary { font-size: 18px; }
  .footer { gap: 80px; min-height: 480px; padding-top: 40px; }
  .footer__social { flex-direction: column; gap: 10px; }
  .about-hero__title { font-size: 12vw; }
  .about-item, .project__head, .project__info { grid-template-columns: 1fr; }
  .about-item__title { font-size: 28px; }
  .gallery { grid-template-columns: 1fr; }
  .more__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__grain { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .roll__a, .roll__b, .work__img img { transition: none; }
}
