:root {
  color-scheme: dark;
  --background: #10100f;
  --surface: #191918;
  --line: #ffffff21;
  --muted: #b5b4aa;
  --text: #f8f6ef;
  --accent: #f9e61e;
  --header-height: 74px;
  --display: "Archivo", "Arial Black", Arial, sans-serif;
  --body: "Inter Tight", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font-family: var(--body); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { padding: 0; border: 0; color: inherit; background: none; font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(100% - clamp(32px, 7vw, 112px), 1320px); margin-inline: auto; }
.scroll-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 12; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: #10100fed; backdrop-filter: blur(12px); }
.header-inner, .header-inner nav { display: flex; align-items: center; }
.header-inner { height: var(--header-height); justify-content: space-between; gap: 24px; }
.header-inner nav { gap: clamp(18px, 3vw, 39px); }
.brand { flex: none; }
.brand img { object-fit: contain; }
.nav-work, .nav-portfolio { font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-work { color: var(--accent); }
.nav-portfolio { color: var(--muted); }
.nav-portfolio:hover, .footer a:hover, .drive-link:hover { color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 17px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-weight: 700; white-space: nowrap; transition: color .2s, background .2s, border-color .2s; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.button.primary:hover { background: #fff378; border-color: #fff378; }
.arrow { display: inline-block; position: relative; width: 12px; height: 12px; flex: none; transform: rotate(-45deg); }
.arrow::before { content: ""; position: absolute; left: 0; right: 1px; top: 5px; height: 1.5px; background: currentColor; }
.arrow::after { content: ""; position: absolute; width: 5px; height: 5px; right: 1px; top: 3px; border-top: 1.5px solid; border-right: 1.5px solid; transform: rotate(45deg); }
.play { display: inline-block; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }

.hero { min-height: clamp(465px, 43vw, 595px); position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end; margin-top: 22px; background: #1b110e; border: 1px solid var(--line); border-radius: 14px; }
.hero-image, .hero::after { position: absolute; z-index: -1; height: 100%; top: 0; right: 0; }
.hero-image { width: 82%; object-fit: cover; object-position: center 50%; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero-image { transform: translate(var(--hero-x, 0), var(--hero-y, 0)) scale(1.04); transition: transform .45s ease-out; }
}
.hero::after { content: ""; left: 0; background: linear-gradient(90deg, #140e0c 5%, #140e0cf7 24%, #140e0c93 44%, transparent 67%), linear-gradient(0deg, #130a07bf, transparent 45%); }
.hero-content { position: relative; width: min(100%, 590px); padding: 45px 0 50px clamp(30px, 5.7vw, 84px); }
.hero h1 { color: var(--text); font: 900 clamp(74px, 10vw, 148px)/.77 var(--display); font-stretch: 114%; letter-spacing: -.078em; text-transform: uppercase; }
.hero h1 span { color: var(--accent); }
.hero-content p { margin-top: 26px; max-width: 30ch; color: #eee9dd; font-size: clamp(16px, 2vw, 20px); line-height: 1.4; }
.hero-content .button { margin-top: 23px; }
.hero-label { position: absolute; bottom: 21px; right: 24px; display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #f5e9dc; }
.hero-label span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.hero-label b { color: var(--text); }

.works { padding-block: clamp(42px, 6vw, 80px); scroll-margin-top: var(--header-height); }
.works-heading { margin-bottom: 12px; }
.works h2, .full-portfolio h2, .contact h2 { font-family: var(--display); font-weight: 850; font-size: clamp(32px, 4.8vw, 62px); line-height: .98; letter-spacing: -.056em; }
.works-count { margin-top: 10px; color: var(--muted); font-size: 14px; }
.filters, .clip-options { display: flex; gap: 7px; flex-wrap: wrap; }
.filters { position: sticky; top: var(--header-height); z-index: 5; padding: 9px 0; margin-bottom: 12px; background: #10100fed; backdrop-filter: blur(10px); }
.filters button, .clip-options button { border: 1px solid var(--line); border-radius: 5px; padding: 9px 11px; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .2s, border-color .2s, background .2s; }
.filters button:hover, .clip-options button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"], .clip-options button[aria-pressed="true"] { color: #121211; background: var(--accent); border-color: var(--accent); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 23px); }
.project-card { min-width: 0; }
.card-button { width: 100%; height: 100%; display: flex; flex-direction: column; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); transition: border-color .2s, background .2s; }
.card-button:hover, .card-button:focus-visible { border-color: var(--accent); background: #20201c; }
.thumbnail { border-radius: 6px; overflow: hidden; width: 100%; display: block; position: relative; aspect-ratio: 16 / 9; background: #25241f; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.thumbnail::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(180px circle at var(--focus-x, 50%) var(--focus-y, 50%), #ffffff28, transparent 72%); opacity: 0; transition: opacity .25s; }
.card-button:hover .thumbnail::after { opacity: 1; }
.card-button:hover img { transform: scale(1.045); }
.card-play { position: absolute; z-index: 1; inset: auto 10px 10px auto; width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #ffffff70; border-radius: 50%; background: #10100fd9; color: var(--text); transition: color .2s, background .2s, border-color .2s; }
.card-play .play { transform: translateX(1px); }
.card-button:hover .card-play, .card-button:focus-visible .card-play { color: #121211; background: var(--accent); border-color: var(--accent); }
.caption { display: block; padding: 13px 9px 12px; }
.type { display: block; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; line-height: 1.35; }
.client { display: block; margin-top: 6px; font: 750 clamp(15px, 1.7vw, 22px)/1.12 var(--display); letter-spacing: -.018em; overflow-wrap: anywhere; }
.clip-count { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; margin-left: 5px; }
@media (prefers-reduced-motion: no-preference) {
  .project-card.reveal { animation: appear .42s ease-out both; animation-delay: calc(var(--delay, 0) * 1ms); }
  @keyframes appear { from { opacity: .15; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

.full-portfolio { position: relative; isolation: isolate; overflow: hidden; padding: clamp(26px, 5vw, 60px); margin-bottom: 20px; border-radius: 12px; color: #17160d; background: var(--accent); scroll-margin-top: calc(var(--header-height) + 18px); }
.full-portfolio h2 { max-width: 14ch; }
.full-portfolio p { margin-top: 14px; max-width: 44ch; color: #3c350e; font-size: 16px; line-height: 1.45; }
.full-portfolio .button { margin-top: 21px; background: #161510; color: var(--text); border-color: #161510; }
.full-portfolio .button:hover, .full-portfolio .button:focus-visible { background: #fff6a0; color: #161510; }
.full-portfolio .button:focus-visible { outline-color: #161510; }
.full-portfolio img { position: absolute; z-index: -1; right: 0; top: 50%; width: min(52%, 420px); height: auto; opacity: .16; filter: brightness(0); transform: translate(9%, -49%) rotate(-12deg); pointer-events: none; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(22px, 5vw, 52px); border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(100deg, #27261c, #181816 68%); scroll-margin-top: calc(var(--header-height) + 18px); }
.contact h2 { font-size: clamp(32px, 4vw, 56px); }
.contact p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 24px 33px; color: var(--muted); font-size: 13px; }
.footer small { font-size: inherit; }
.footer a { flex: none; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

body:has(dialog[open]) { overflow: hidden; }
dialog { color: var(--text); margin: auto; padding: 0; width: min(920px, 100% - 28px); max-width: none; max-height: calc(100dvh - 24px); border: 1px solid #ffffff3b; border-radius: 13px; background: #181817; overscroll-behavior: contain; }
dialog::backdrop { background: #000c; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #181817; border-bottom: 1px solid var(--line); padding: 15px clamp(15px, 3vw, 28px); }
.dialog-header h2 { margin-top: 4px; font: 800 clamp(19px, 3.6vw, 28px)/1.08 var(--display); }
.close-button { display: grid; place-items: center; min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; font-size: 24px; line-height: 1; }
.close-button:hover { border-color: var(--accent); color: var(--accent); }
.dialog-body { display: grid; justify-items: center; gap: 13px; padding: clamp(14px, 3vw, 26px); }
.player { display: grid; justify-items: center; width: 100%; }
.player video, .player iframe { display: block; width: min(100%, calc(62dvh * var(--ratio, 1.77778))); aspect-ratio: var(--ratio, 1.77778); border: 0; border-radius: 7px; background: #050505; }
.drive-link { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
#project-description { max-width: 63ch; color: #d2cfc6; font-size: 15px; line-height: 1.48; }
.project-navigation { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.project-navigation [aria-live] { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-button { display: inline-flex; align-items: center; gap: 7px; min-height: 39px; padding-inline: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 650; }
.step-button:hover { color: #111; border-color: var(--accent); background: var(--accent); }

@media (max-width: 950px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  :root { --header-height: 64px; }
  .brand img { width: 78px; height: 40px; }
  .header-inner { gap: 10px; }
  .header-inner nav { gap: 11px; }
  .nav-work, .nav-portfolio { font-size: 12px; }
  .header-contact { min-height: 36px; padding-inline: 10px; font-size: 12px; }
  .hero { min-height: 530px; margin-top: 12px; }
  .hero-image { width: 100%; height: 71%; object-position: center 50%; }
  .hero::after { background: linear-gradient(0deg, #170f0c 13%, #170f0c 29%, #170f0c75 55%, transparent 72%); }
  .hero-content { padding: 25px 19px 24px; }
  .hero h1 { font-size: clamp(64px, 16.8vw, 97px); }
  .hero-content p { margin-top: 16px; max-width: 33ch; font-size: 15px; }
  .hero-content .button { margin-top: 16px; }
  .hero-label { top: 13px; left: 13px; bottom: auto; right: auto; padding: 6px 8px; border-radius: 4px; background: #150f0bcb; font-size: 9px; }
  .caption { padding: 9px 4px 7px; }
  .type { font-size: 9px; }
  .card-play { width: 27px; height: 27px; bottom: 5px; right: 5px; }
  .card-play .play { border-top-width: 4px; border-bottom-width: 4px; border-left-width: 6px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filters button { flex: none; }
  .contact { align-items: start; flex-direction: column; }
  .footer { align-items: start; flex-direction: column; }
}
@media (max-width: 360px) {
  .nav-work { display: none; }
  .project-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
