/* Denin — dark editorial portfolio. Fonts: Archivo + Noto Serif Display */
:root {
  --bg: #0b0b0c;
  --bg-2: #111113;
  --panel: #141416;
  --ink: #f2f0ea;
  --muted: #6f6f6f;
  --faint: #3a3a3d;
  --line: #232326;
  --accent: #e8e4d8;
  --serif: "Noto Serif Display", Georgia, serif;
  --sans: "Archivo", -apple-system, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
/* fluid root: 16px up to 1280px wide, ramping to 22.4px (≈140%) at 2560px, capped above */
html { font-size: clamp(16px, 9.6px + 0.5vw, 22.4px); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; }
img { display: block; max-width: 100%; }

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

/* ── header ── */
.site-head {
  position: absolute; top: .7rem; left: 50%; z-index: 60;
  width: min(calc(100% - 1.4rem), 100rem); transform: translateX(-50%);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1.5rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11,11,12,.35);
}
.brand { text-decoration: none; display: inline-flex; align-items: baseline; gap: .45em; font-size: 1.12rem; font-weight: 400; letter-spacing: 0.02em; line-height: 1; }
.brand:hover { opacity: .8; }
.brand-name { font-weight: 700; color: var(--ink); }
.brand-role { font-weight: 400; color: #8f8f93; }
.site-nav { font-size: 1.12rem; font-weight: 400; letter-spacing: 0.02em; }
.site-nav a { text-decoration: none; color: #8f8f93; }
.site-nav a.is-active { color: var(--ink); }
/* ── animated link underlines ── */
.site-nav a,
.hero-socials a,
.hero-headline a,
.contact-line a,
.site-foot a,
.copy-btn {
  position: relative;
  text-decoration: none !important;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 1px);
  padding-bottom: 2px;
  transition: background-size .38s cubic-bezier(.22,1,.36,1), color .25s ease;
}
.site-nav a:hover,
.hero-socials a:hover,
.hero-headline a:hover,
.contact-line a:hover,
.site-foot a:hover,
.copy-btn:hover {
  background-size: 100% 1px;
}
.site-nav a.is-active {
  background-size: 100% 1px;
  text-underline-offset: 4px;
}
.site-nav .nav-link + .nav-link { margin-left: .8em; }

/* ── hero ── */
.hero {
  width: min(calc(100% - 1.4rem), 100rem);
  min-height: 0;
  margin: .7rem auto 1rem;
  padding: 3.2rem 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: clamp(9rem, 18vw, 13.5rem) minmax(0, 1fr);
  background: rgba(20,20,22,.42);
}
.hero-portrait {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid var(--line);
}
.portrait-frame {
  --mx: -30px;
  margin: 0; width: 100%; max-width: 11rem; aspect-ratio: 4 / 5; overflow: hidden; background: #090b10;
  display: grid; cursor: ew-resize; position: relative;
  transition: transform .45s cubic-bezier(.22,1,.36,1);
}
.portrait-frame:hover { transform: scale(1.025); }
.portrait-frame img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; object-position: 55% 36%; }
.portrait-color { filter: saturate(.9) contrast(1.04); }
.portrait-bw {
  filter: grayscale(1) contrast(1.04);
  opacity: 1;
  transition: opacity .4s ease;
}
/* cursor swipe reveal: color on the left of the cursor, BW on the right */
.portrait-frame.is-revealing .portrait-bw {
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent calc(var(--mx) - 14px), black calc(var(--mx) + 14px));
  mask-image: linear-gradient(to right, transparent 0, transparent calc(var(--mx) - 14px), black calc(var(--mx) + 14px));
}
/* touch fallback: press shows full color */
.portrait-frame:active .portrait-bw { opacity: 0; }
.portrait-frame.is-revealing:active .portrait-bw { opacity: 1; }
.hero-main {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.6rem) clamp(1rem, 2.2vw, 2rem) .9rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.hero-headline {
  max-width: 26ch;
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: .98;
  color: var(--ink);
}
.hero-headline a { color: inherit; font-weight: inherit; }
.hero-headline a em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
/* ── hero entrance (pure keyframes: no-JS safe, staggered) ── */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.hero-portrait { animation: hero-rise .8s cubic-bezier(.22,1,.36,1) both; }
.hero-headline { animation: hero-rise .8s cubic-bezier(.22,1,.36,1) .12s both; }
.hero-meta { animation: hero-rise .8s cubic-bezier(.22,1,.36,1) .24s both; }
.hero-meta {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: .85rem;
  gap: 1.5rem;
  font-size: .72rem;
  line-height: 1.15;
}
.hero-socials { display: grid; gap: .12rem; }
.hero-socials a { color: var(--ink); font-weight: 600; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #68d391;
  box-shadow: 0 0 0 0 rgba(104, 211, 145, 0.6);
  animation: pulse-dot 2.5s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(104, 211, 145, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(104, 211, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(104, 211, 145, 0); }
}

/* ── cloud ── */
.cloud-section { padding: 1rem 2rem 0; max-width: 100rem; position: relative; }
.cloud-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(62% 58% at 50% 46%, rgba(46, 110, 68, 0.30), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}
.cloud-section { padding-top: 0; }
.cloud {
  position: relative; height: 74vh; min-height: 440px; margin-top: 1rem;
  border: 0; border-radius: 0; overflow: hidden;
  background: transparent;
  cursor: crosshair; touch-action: pan-y;
}
.cloud-card {
  position: absolute; top: 0; left: 0; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  background: #000; cursor: pointer;
}
.cloud.is-animating .cloud-card { will-change: transform; }
.cloud-card img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.05); transition: filter .35s ease; }
.cloud-card { transition: border-color .35s ease; }
/* card-in animates opacity/filter only: the JS motion loop owns transform */
@keyframes card-in {
  from { opacity: 0; filter: brightness(.55); }
  to { opacity: 1; filter: brightness(1); }
}
.cloud-card { animation: card-in .7s ease backwards; animation-delay: calc(var(--ci, 0) * 70ms); }
.cloud-card:hover { border-color: rgba(255,255,255,.45); z-index: 3; }
.cloud-card:hover img { filter: saturate(1.3) contrast(1.08) brightness(1.07); }

/* ── work / list ── */
.work {
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: 2.5rem; padding: 4rem 2rem; max-width: 100rem;
}
.work-left { position: sticky; top: 7rem; align-self: start; }
.filters { position: static; }
.toggle { display: flex; gap: .5rem; }
.toggle-btn {
  background: transparent; border: 1px solid var(--faint); color: var(--muted);
  border-radius: 999px; padding: .45rem 1rem; font: inherit; font-size: .9rem; cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.toggle-btn:hover { transform: translateY(-1px); }
.toggle-btn:active { transform: translateY(0) scale(.97); }
.toggle-btn.is-on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.hover-preview { position: static; margin: 2rem 0 0; max-width: none; }
.hover-preview img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; background: #000; transition: opacity .25s; }

.list-head, .row {
  display: grid; grid-template-columns: 1fr 1fr 90px; gap: 1rem; align-items: baseline;
}
.list-head { color: var(--muted); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; padding-bottom: .6rem; }
.list-head .year-col { text-align: right; }
.project-list { list-style: none; margin: 0; padding: 0; }
.row {
  width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line);
  color: var(--muted); padding: 1rem 0; font: inherit; cursor: pointer;
  transition: color .25s, padding .25s;
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row .t { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; transition: transform .3s ease; }
.row:hover .t, .row.is-active .t { transform: translateX(6px); }
.row .b { font-size: 1.05rem; }
.row .y { text-align: right; font-variant-numeric: tabular-nums; }
.row:hover, .row.is-active { color: var(--ink); }
.row.is-dim { opacity: .45; }
.project-list.has-hover .row:not(.is-active) { color: #4c4c4e; }

/* ── info ── */
.info { border-top: 1px solid var(--line); padding: 4rem 2rem 0.8rem; max-width: 100rem; }
.info-grid { display: grid; grid-template-columns: 1fr auto; gap: 3.2rem; align-items: center; }
.letsdo { font-weight: 400; text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.92; font-size: clamp(2.52rem, 5.88vw, 5.6rem); margin: 0; }
.letsdo em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.contact-block { align-self: center; justify-self: end; display: grid; gap: 0.28rem; padding-top: 0; padding-right: 1.1rem; text-align: left; justify-items: start; font-size: 0.8rem; line-height: 1.65; max-width: 26rem; }
.contact-block p { margin: 0; color: var(--ink); font-weight: 400; }
.contact-line { display: flex; align-items: baseline; justify-content: flex-start; gap: 0.64rem; flex-wrap: nowrap; }
.contact-line > * { flex-shrink: 0; }
.contact-line a { color: var(--ink); font-weight: 400; }
.contact-line a.dim { color: #8f8f93; font-size: 0.8rem; }
.copy-btn { background: transparent; border: 0; padding: 0; padding-bottom: 2px; color: #8f8f93; font: inherit; font-size: 0.8rem; font-weight: 400; cursor: pointer; }
.copy-btn:hover { color: var(--ink); }
.contact-gap { height: 1.6rem; }
.site-foot { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1.9rem; padding: 0.64rem 0 0.88rem; font-size: 0.58rem; }
.site-foot a { color: var(--muted); }

/* ── center capped sections on very wide displays ── */
.hero, .cloud-section, .work, .info { margin-inline: auto; }

/* ── drawer ── */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; }
.backdrop[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(37.5rem, 100vw); background: var(--bg-2); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .45s cubic-bezier(.22,1,.36,1);
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer.open { transform: none; }
.drawer-inner { padding: 1.2rem 1.4rem 3rem; position: relative; }
.drawer-close {
  position: sticky; top: 0; margin-left: auto; display: block;
  background: var(--ink); color: var(--bg); border: 0; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; font-size: 1.4rem; cursor: pointer; z-index: 2;
}
.kicker { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.pill { border: 1px solid var(--faint); border-radius: 999px; padding: .2rem .7rem; color: var(--ink); }
.drawer-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; margin: .8rem 0; }
.drawer-title em { font-style: italic; }
.drawer-brands { color: #c9c6bd; font-size: 1.05rem; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; margin: 1.2rem 0; }
.meta-grid dt { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.meta-grid dd { margin: .25rem 0 0; }
.film-frame { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.film-frame img, .film-frame iframe, .film-frame video { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 0; display: block; background: #000; }
.film-note { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.drawer-desc { color: #d8d5cc; line-height: 1.6; margin: 1.2rem 0; }
.carousel-head { display: flex; justify-content: space-between; align-items: center; margin: 1.6rem 0 .6rem; }
.carousel-head h3 { margin: 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.car-btns { display: flex; gap: .5rem; }
.car-btns button { background: transparent; border: 1px solid var(--faint); color: var(--ink); border-radius: 50%; width: 2.2rem; height: 2.2rem; cursor: pointer; }
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.carousel figure { flex: 0 0 82%; scroll-snap-align: start; margin: 0; overflow: hidden; border-radius: 8px; }
.carousel img { border-radius: 8px; border: 1px solid var(--line); aspect-ratio: 16/10; object-fit: cover; width: 100%; transition: transform .45s ease; }
.carousel img:hover { transform: scale(1.04); }
.next-btn { width: 100%; margin-top: 1.6rem; background: transparent; border: 1px solid var(--faint); color: var(--ink); border-radius: 10px; padding: .9rem; font: inherit; cursor: pointer; }
.next-btn:hover { border-color: var(--ink); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; transition-delay: var(--rd, 0ms); }
.reveal.in { opacity: 1; transform: none; }
/* keep row hover color/padding transitions alongside the reveal */
.row.reveal { transition: opacity .7s, transform .7s, color .25s, padding .25s; transition-delay: var(--rd, 0ms); }

@media (max-width: 960px) {
  .site-head { top: .5rem; width: calc(100% - 1rem); padding: 0.9rem 1rem; flex-wrap: nowrap; gap: 0.75rem; align-items: center; }
  .brand { flex-shrink: 0; font-size: 0.9rem; letter-spacing: 0.01em; }
  .site-nav { font-size: 0.9rem; letter-spacing: 0.01em; white-space: nowrap; margin-left: auto; }
  .hero {
    width: calc(100% - 1rem);
    margin-top: .5rem;
    grid-template-columns: minmax(8rem, 22vw) minmax(0, 1fr);
  }
  .hero-headline { font-size: clamp(1.7rem, 4.2vw, 2.6rem); }
  .hero, .cloud-section, .work, .info { padding-left: 1rem; padding-right: 1rem; }
  .work { grid-template-columns: 1fr; }
  .work-left { position: static; }
  .filters { position: static; }
  .hover-preview { display: none; }
  .row .t { font-size: 1.05rem; }
  .row .b { font-size: .92rem; }
  .info-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-block { align-self: start; justify-self: start; max-width: none; padding-top: 0; padding-right: 0; text-align: left; }
  .cloud { height: 54vh; min-height: 360px; margin-top: 0.5rem; }
}
@media (max-width: 430px) {
  .site-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: rgba(11,11,12,.5);
  }
  .brand { font-size: 0.85rem; }
  .site-nav {
    display: flex;
    gap: 0.65rem;
    font-size: 0.85rem;
    margin-left: auto;
    white-space: nowrap;
  }
  .site-nav .nav-link + .nav-link { margin-left: 0; }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 3.25rem;
  }
  .hero-portrait {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .hero-portrait .portrait-frame { max-width: 5.5rem; }
  .hero-main { min-height: 0; padding: 1rem 1rem .9rem; }
  .hero-headline { font-size: clamp(1.65rem, 8.5vw, 2.1rem); }
  .hero-meta { gap: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .hero-portrait, .hero-headline, .hero-meta { animation: none; }
  .cloud-card { animation: none; } /* silences card-in entrance */
  .drawer, .row, .row.reveal, .hover-preview img, .portrait-bw,
  .row .t, .toggle-btn, .portrait-frame, .carousel img,
  .site-nav a, .hero-socials a, .hero-headline a, .contact-line a, .site-foot a, .copy-btn { transition: none; }
  .portrait-frame.is-revealing .portrait-bw {
    -webkit-mask-image: none;
    mask-image: none;
  }
}
