:root {
  --bg: #0f0f10;
  --bg-soft: #171718;
  --surface: rgba(250, 245, 235, 0.08);
  --surface-strong: rgba(250, 245, 235, 0.12);
  --line: rgba(250, 245, 235, 0.14);
  --line-strong: rgba(250, 245, 235, 0.24);
  --text: #f7f2e9;
  --muted: rgba(247, 242, 233, 0.66);
  --accent: #d5ba8f;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(146, 123, 84, 0.18), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(123, 141, 125, 0.16), transparent 22%),
    linear-gradient(180deg, #151514 0%, #0e0e0f 100%);
  color: var(--text);
  font-family: "Neue Haas Grotesk Text Pro", "Helvetica Neue", "Avenir Next", "PingFang SC", sans-serif;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 100%);
  opacity: 0.34;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.32) 0, transparent 1px),
    radial-gradient(circle at 75% 65%, rgba(255, 255, 255, 0.24) 0, transparent 1px);
  background-size: 14px 14px, 18px 18px;
  mix-blend-mode: soft-light;
}

.aura {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
}

.aura-left {
  top: -10vw;
  left: -12vw;
  background: #c89b5e;
}

.aura-right {
  right: -12vw;
  top: 18vw;
  background: #7e9a82;
}

.masthead,
.shell {
  width: min(calc(100% - 48px), 1440px);
  margin: 0 auto;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0 0;
}

.brand,
.brand:visited {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.masthead-note,
.eyebrow,
.note-kicker,
.filter-label,
.section-kicker,
.viewer-counter {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell {
  position: relative;
  padding: 26px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-feature,
.stat-card,
.note-card,
.filters,
.viewer-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(20px);
}

.hero-copy {
  padding: 30px 32px 34px;
}

.hero h1,
.hero-feature-title,
.section-title,
.viewer-title,
.project-title {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.hero h1 {
  max-width: 10.4ch;
  margin-top: 18px;
  font-size: clamp(3.2rem, 8vw, 6.7rem);
  line-height: 0.95;
}

.hero-text,
.note-body,
.results-summary,
.section-caption,
.project-summary,
.viewer-description,
.hero-feature-description,
.footer-copy {
  color: var(--muted);
}

.hero-text {
  max-width: 34rem;
  margin: 22px 0 0;
  font-size: 1rem;
  line-height: 1.82;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button-primary {
  background: rgba(247, 242, 233, 0.11);
}

.hero-feature {
  overflow: hidden;
}

.hero-feature-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.hero-feature-video {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  background:
    radial-gradient(circle at 20% 18%, rgba(213, 186, 143, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(10, 10, 10, 0.98));
}

.hero-feature-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.62));
}

.hero-feature-client,
.project-client,
.viewer-client {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 242, 233, 0.8);
}

.hero-feature-title {
  margin-top: 10px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 0.98;
}

.hero-feature-meta,
.hero-feature-description {
  margin: 10px 0 0;
  max-width: 22rem;
  font-size: 0.96rem;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  padding: 22px 24px;
}

.stat-value {
  display: block;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 0.84rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.note-card {
  padding: 22px 24px;
}

.note-body {
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.78;
}

.filters {
  display: grid;
  gap: 18px;
  margin-top: 28px;
  padding: 22px 24px;
}

.filter-group {
  display: grid;
  gap: 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill,
.viewer-close,
.viewer-step {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.filter-pill {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.filter-pill:hover,
.filter-pill:focus-visible,
.viewer-close:hover,
.viewer-close:focus-visible,
.viewer-step:hover,
.viewer-step:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.filter-pill.is-active {
  background: rgba(247, 242, 233, 0.12);
}

.results-summary {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.74;
}

.portfolio-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin: 30px 0 22px;
}

.section-title {
  margin-top: 12px;
  max-width: 10ch;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.section-caption {
  max-width: 29rem;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.8;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  grid-column: span 4;
  min-width: 0;
  animation: rise 500ms var(--transition) both;
}

.project-card[data-layout="wide"] {
  grid-column: span 8;
}

.project-card[data-layout="tall"] {
  grid-column: span 4;
}

.project-hitarea {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-frame {
  --ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(247, 242, 233, 0.14);
  background:
    radial-gradient(circle at 18% 22%, rgba(213, 186, 143, 0.22), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(126, 154, 130, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(28, 28, 29, 0.96), rgba(10, 10, 10, 0.98));
  box-shadow: var(--shadow);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.project-hitarea:hover .project-frame,
.project-hitarea:focus-visible .project-frame {
  transform: translateY(-5px);
  border-color: rgba(247, 242, 233, 0.28);
  box-shadow: 0 34px 96px rgba(0, 0, 0, 0.36);
}

.project-glow,
.project-preview,
.project-overlay {
  position: absolute;
  inset: 0;
}

.project-glow {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
}

.project-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 360ms ease;
}

.project-preview.is-ready {
  opacity: 0.96;
}

.project-overlay {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.66));
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.project-index,
.project-status {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 242, 233, 0.82);
}

.project-copy {
  display: grid;
  gap: 10px;
}

.project-title {
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  line-height: 0.98;
}

.project-summary {
  margin: 0;
  max-width: 20rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer {
  display: grid;
  gap: 10px;
  margin-top: 34px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
}

.footer-line {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-copy {
  margin: 0;
  max-width: 40rem;
  font-size: 0.96rem;
  line-height: 1.78;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.viewer[hidden] {
  display: none;
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(6, 6, 6, 0.84);
  backdrop-filter: blur(24px);
  cursor: pointer;
}

.viewer-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 18px;
  width: min(calc(100% - 40px), 1440px);
  height: min(calc(100% - 40px), 920px);
  margin: 20px auto;
}

.viewer-stage,
.viewer-panel {
  min-height: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 242, 233, 0.1);
  background: #080808;
  box-shadow: var(--shadow);
}

.viewer-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
}

.viewer-step {
  position: absolute;
  top: 20px;
  z-index: 2;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  background: rgba(15, 15, 16, 0.6);
}

.viewer-step-prev {
  left: 20px;
}

.viewer-step-next {
  right: 20px;
}

.viewer-panel {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 22px;
}

.viewer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.viewer-close {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

.viewer-copy {
  display: grid;
  gap: 12px;
}

.viewer-title {
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 0.98;
}

.viewer-description {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.82;
}

.viewer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.viewer-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.viewer-note {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255, 255, 255, 0.02) 100%);
  text-align: center;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .hero,
  .portfolio-head,
  .viewer-shell {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .project-card,
  .project-card[data-layout="wide"],
  .project-card[data-layout="tall"] {
    grid-column: span 3;
  }

  .viewer-shell {
    height: auto;
    max-height: calc(100% - 40px);
  }

  .viewer-stage {
    min-height: 54vh;
  }
}

@media (max-width: 860px) {
  .masthead,
  .shell {
    width: min(calc(100% - 24px), 1440px);
  }

  .masthead {
    padding-top: 14px;
  }

  .stats,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card,
  .project-card[data-layout="wide"],
  .project-card[data-layout="tall"] {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  .hero-copy,
  .hero-feature,
  .filters,
  .stat-card,
  .note-card,
  .viewer-panel {
    border-radius: 24px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .viewer-shell {
    width: min(calc(100% - 16px), 1440px);
    margin: 8px auto;
  }

  .viewer-step {
    top: auto;
    bottom: 18px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
