/* ============================================================
   MASTER KEY STUDIOS — DESIGN SYSTEM v1 (PROTOTYPE)
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Colors */
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --surface: #141414;
  --border: #1f1f1f;
  --text: #ffffff;
  --text-muted: #a8a8a8;
  --text-subtle: #6e6e6e;
  --accent: #e4b43b;
  --accent-hover: #f5c955;

  /* Type */
  --font-display: "Anton", "Bebas Neue", "Helvetica Neue", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* Spacing (8px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
  --space-9: 128px;

  /* Layout */
  --max-width: 1600px;
  --gutter-mobile: 24px;
  --gutter-desktop: 48px;
  --header-height: 64px;

  /* Motion */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-med: 400ms;
  --dur-slow: 600ms;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

/* ---------- TYPOGRAPHY ---------- */
.display-xl { font-family: var(--font-display); font-size: clamp(56px, 9vw, 96px); line-height: 0.95; letter-spacing: -0.02em; font-weight: 400; text-transform: uppercase; }
.display-lg { font-family: var(--font-display); font-size: clamp(48px, 7vw, 72px); line-height: 0.95; letter-spacing: -0.02em; font-weight: 400; text-transform: uppercase; }
.display-md { font-family: var(--font-display); font-size: clamp(36px, 5vw, 56px); line-height: 1.0; letter-spacing: -0.01em; font-weight: 400; text-transform: uppercase; }
h1, .h1 { font-family: var(--font-display); font-size: 40px; font-weight: 400; line-height: 1.1; text-transform: uppercase; margin: 0; }
h2, .h2 { font-family: var(--font-display); font-size: 32px; font-weight: 400; line-height: 1.15; text-transform: uppercase; margin: 0; }
h3, .h3 { font-family: var(--font-body); font-size: 24px; font-weight: 500; line-height: 1.3; margin: 0; }
p { margin: 0 0 1em; color: var(--text); }
p.lead { font-size: 18px; line-height: 1.6; color: var(--text); }
.caption {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter-mobile);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--gutter-desktop); }
}
.full-bleed { width: 100%; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
}
.site-header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter-mobile);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .site-header__inner { padding: 0 var(--gutter-desktop); }
}
.site-header__nav { display: none; gap: var(--space-5); }
@media (min-width: 768px) {
  .site-header__nav { display: flex; }
  .site-header__nav--right { justify-content: flex-end; }
}
.site-header__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  max-width: 200px;
}
.site-header__logo img {
  display: block;
  height: 16px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.site-header__logo small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding: 8px 0;
}
.nav-link:hover { color: var(--accent); }
.nav-link--active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 2px;
  background: var(--accent);
}
.menu-toggle { display: block; }
@media (min-width: 768px) { .menu-toggle { display: none; } }

/* ---------- HERO (REEL) ---------- */
.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  min-height: 600px;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(228, 180, 59, 0.12), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(228, 180, 59, 0.06), transparent 60%);
}
.hero__content {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 0 var(--gutter-mobile);
}
.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 180px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 var(--space-4) 0;
}
.hero__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-6);
}
.hero__play {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 28px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background var(--dur-fast) var(--ease);
}
.hero__play:hover { background: var(--accent-hover); }
.hero__play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--bg);
}

/* ---------- CLIENT STRIP ---------- */
.client-strip {
  background:
    radial-gradient(ellipse 70% 120% at 50% 50%, rgba(228, 180, 59, 0.10), transparent 65%),
    linear-gradient(180deg, #0c0c0c 0%, #181818 50%, #0c0c0c 100%);
  padding: var(--space-6) 0;
  overflow: hidden;
  position: relative;
  border-top: 1px solid rgba(228, 180, 59, 0.18);
  border-bottom: 1px solid rgba(228, 180, 59, 0.18);
}
.client-strip__track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 2.5vw, 48px);
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 var(--gutter-mobile);
}
@media (min-width: 768px) {
  .client-strip__track { padding: 0 var(--gutter-desktop); }
}
.client-strip__group {
  display: contents;
}
.client-strip__group[aria-hidden="true"] { display: none; }
.client-strip__logo {
  height: clamp(20px, 2.4vw, 34px);
  width: auto;
  opacity: 0.85;
  transition: opacity var(--dur-fast) var(--ease);
  flex: 0 1 auto;
  min-width: 0;
}
.client-strip__logo:hover { opacity: 1; }
.client-strip__logo[alt="Samsung"],
.client-strip__logo[alt="LG"] {
  height: clamp(24px, 2.9vw, 40px);
}

/* ---------- FILTERS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--gutter-mobile) var(--space-5);
  scroll-margin-top: var(--header-height);
}
.section-eyebrow { scroll-margin-top: var(--header-height); }
.filter-chip {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.filter-chip:hover { color: var(--text); border-color: var(--text); }
.filter-chip--active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.section-eyebrow {
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding-top: var(--space-7);
}

/* ---------- WORK GRID ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  align-content: start;
  min-height: calc(100vh - var(--header-height));
}
@media (min-width: 640px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(4, 1fr); }
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}
.tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.tile:hover .tile__img { transform: scale(1.05); }
.tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: var(--space-3);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}
.tile:hover .tile__overlay { opacity: 1; }
.tile__brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.tile__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.0;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 8px;
}
.tile__rule { width: 24px; height: 2px; background: var(--accent); margin-top: 8px; }
.tile__location {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}
.btn--secondary:hover {
  background: var(--text);
  color: var(--bg);
}

/* ---------- PROJECT DETAIL ---------- */
.project-hero {
  position: relative;
  width: calc(100% - var(--gutter-mobile) * 2);
  max-width: 1500px;
  margin: var(--space-7) auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}
.project-hero img { width: 100%; height: 100%; object-fit: cover; }
.project-hero__iframe { width: 100%; height: 100%; border: 0; display: block; }
.project-hero__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}
.project-hero__play-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(228, 180, 59, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease);
}
.project-hero__play-circle:hover { transform: scale(1.08); }
.project-hero__play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent var(--bg);
  margin-left: 4px;
}
.project-meta {
  padding: var(--space-7) 0 var(--space-6);
  text-align: center;
}
.project-meta__brand {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.project-meta__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}
.project-meta__caption {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stills-strip {
  display: grid;
  gap: 2px;
}
.stills-strip img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.credits {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding: var(--space-8) 0;
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .credits { grid-template-columns: 1fr 1fr; }
}
.credit-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.credit-row__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.credit-row__value {
  font-size: 14px;
  font-weight: 500;
}

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.project-nav__item {
  padding: var(--space-5) var(--gutter-desktop);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--dur-fast) var(--ease);
}
.project-nav__item:hover { background: var(--surface); }
.project-nav__item--prev { border-right: 1px solid var(--border); }
.project-nav__item--next { text-align: right; align-items: flex-end; }
.project-nav__label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-subtle); }
.project-nav__title { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; }

/* ---------- ABOUT PAGE ---------- */
.page-header {
  text-align: center;
  padding: var(--space-8) 0 var(--space-6);
}
.page-header__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) 0;
}
.about-content p { font-size: 18px; line-height: 1.7; margin-bottom: 1.4em; color: var(--text-muted); }
.about-content p strong { color: var(--text); font-weight: 500; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: var(--space-7) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-8) 0;
}
.stat { text-align: center; padding: var(--space-4); }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  line-height: 0.95;
  color: var(--accent);
}
.stat__label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.locations {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-4);
  padding: var(--space-7) 0;
}
@media (min-width: 768px) {
  .locations { grid-template-columns: repeat(4, 1fr); }
}
.location {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.location__pin {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--accent);
}
.location__city {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  line-height: 1.0;
  margin: 0 0 2px;
}
.location__country {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-5);
  margin-top: var(--space-8);
}
.site-footer__brand-link {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity var(--dur-fast) var(--ease);
}
.site-footer__monogram {
  display: block;
  height: 64px;
  width: auto;
  opacity: 0.92;
  transition: opacity var(--dur-fast) var(--ease);
}
.site-footer__brand-link:hover .site-footer__monogram { opacity: 1; }

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
  text-align: center;
  align-items: center;
}
@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: var(--space-7);
    text-align: left;
  }
  .site-footer__brand-link { justify-content: flex-start; }
}
.footer-block h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 var(--space-3);
}
.footer-block p { color: var(--text-muted); font-size: 14px; margin: 0 0 6px; }
.footer-block a:hover { color: var(--accent); }

.site-footer__bar {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .site-footer__bar { flex-direction: row; }
}
.site-footer__nav {
  display: flex;
  gap: var(--space-5);
}
.site-footer__nav a {
  color: var(--text-subtle);
  transition: color var(--dur-fast) var(--ease);
}
.site-footer__nav a:hover { color: var(--accent); }

/* ---------- ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
