/* Andrew Oliver — cinematic editor portfolio */
:root {
  --bg: #0a0a0c;
  --bg-elevated: #121216;
  --bg-card: #16161c;
  --fg: #f4f2ee;
  --fg-muted: #a8a49c;
  --fg-dim: #6e6a64;
  --accent: #f4f2ee;
  --border: rgba(244, 242, 238, 0.08);
  --border-strong: rgba(244, 242, 238, 0.16);
  --overlay: rgba(4, 4, 6, 0.88);
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 72px;
  --font-display: "Anton", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
  text-decoration: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 12, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.header-inner {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0 1.1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
  color: var(--fg);
}

.brand-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.brand-name {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: none;
}

/* Main layout */
.main {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
}

.hero-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 0.95;
}

.hero-tagline {
  margin: 0;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--fg-muted);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.75rem;
  padding-bottom: 0.25rem;
}

.filter-chip {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-chip:hover {
  color: var(--fg);
  border-color: rgba(244, 242, 238, 0.28);
}

.filter-chip.is-active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Sections */
.work-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.work-section.is-hidden {
  display: none;
}

.section-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  border-radius: var(--radius);
  cursor: pointer;
  color: inherit;
}

.card:focus-visible {
  outline-offset: 4px;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), opacity 0.3s ease;
  opacity: 0.92;
}

.card:hover .card-media img,
.card:focus-visible .card-media img {
  transform: scale(1.03);
  opacity: 1;
}

.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 55%);
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.card:hover .card-play,
.card:focus-visible .card-play {
  opacity: 1;
}

.play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(244, 242, 238, 0.92);
  color: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.play-icon svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.card-duration {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(10, 10, 12, 0.75);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.1rem;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-dialog {
  position: relative;
  width: min(960px, 100%);
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-strong);
}

.lightbox-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.7);
  color: var(--fg);
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(10, 10, 12, 0.95);
}

.lightbox-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.lightbox-stage video,
.lightbox-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.lightbox-caption {
  padding: 0.85rem 1rem 1rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.lightbox-caption h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.lightbox-caption p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

body.lightbox-open {
  overflow: hidden;
}

/* Contact page */
.page-hero {
  padding: 4rem 0 2.5rem;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.75rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.page-hero p {
  margin: 0;
  max-width: 32rem;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

.contact-card {
  max-width: 28rem;
  padding: 1.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.contact-card a.email-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.contact-note {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--fg-dim);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
}

.footer-inner {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--fg-dim);
  font-size: 0.8125rem;
}

.footer-inner a {
  color: var(--fg-muted);
}

.footer-inner a:hover {
  color: var(--fg);
}

/* 404 */
.error-page {
  min-height: calc(100vh - var(--header-h) - 6rem);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.error-page p {
  margin: 0 0 1.5rem;
  color: var(--fg-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover .card-media img,
  .card:focus-visible .card-media img {
    transform: none;
  }
}

/* Responsive */
@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }

  .header-inner,
  .main,
  .footer-inner {
    width: calc(100% - 1.75rem);
  }

  .hero {
    padding: 3rem 0 2rem;
  }

  .brand-name {
    display: none;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .lightbox {
    padding: 0.75rem;
  }
}
