/* DC Chavez portfolio. One stylesheet for every page. */

:root {
  /* Palette: 212A31 / 2E3944 / 124E66 / 748D92 / D3D9D4 */
  --bg: #212A31;          /* page background */
  --surface: #2E3944;     /* video frames and placeholders */
  --accent: #124E66;      /* deep teal: buttons, active filter, footer */
  --accent-hover: #17607d;
  --steel: #748D92;       /* lines and borders */
  --text: #D3D9D4;        /* main text */
  --text-soft: #c3cbc6;   /* long-form body copy */
  --muted: #8FA5AA;       /* small labels (a lighter step of 748D92, for legibility) */
  --line: #34414c;
  --chip-line: #4a5b63;
  --gutter: 64px;
  --max: 1440px;
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --narrow: 'Archivo Narrow', 'Archivo', sans-serif;
  --serif: 'Newsreader', Georgia, serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #ffffff; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(33, 42, 49, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 72px;
}
.brand { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; }
.brand-name {
  font-family: var(--narrow); font-weight: 600; font-size: 22px; letter-spacing: 0.14em;
}
.brand-role { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.brand-role { word-spacing: 0.1em; }

.nav { display: flex; gap: 32px; font-size: 14px; letter-spacing: 0.06em; }
.nav a { padding: 12px 0; color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.menu-btn {
  display: none;
  background: none; border: 0; cursor: pointer;
  min-height: 44px; padding: 0 0 0 16px;
  align-items: center; gap: 10px;
  font-size: 14px; letter-spacing: 0.06em;
}

/* Full-screen phone menu */
.menu-panel {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: none; flex-direction: column;
  padding: 10px 20px 40px;
}
.menu-panel.open { display: flex; }
.menu-panel-top { display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.menu-close {
  background: none; border: 0; cursor: pointer;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: flex-end; padding: 0;
}
.menu-links {
  display: flex; flex-direction: column; gap: 4px; margin-top: 64px;
  font-family: var(--serif); font-weight: 300; font-size: 52px; line-height: 1.15;
}
.menu-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  font-size: 14px; color: var(--muted);
}
.menu-foot a { padding: 8px 0; }
.menu-foot .row { display: flex; gap: 24px; }

/* ---------- Home: headline + reel ---------- */

.headline {
  padding-top: 72px; padding-bottom: 48px;
}
.headline h1 {
  margin: 0; max-width: 1000px;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(38px, 4.6vw, 66px);
  line-height: 1.05; letter-spacing: -0.015em;
  color: #8CC5D8; /* fallback if gradient text isn't supported */
}
.locale {
  margin: 24px 0 0; display: flex; align-items: center; gap: 10px;
  font-size: 14px; letter-spacing: 0.04em; color: var(--muted);
}
.locale::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4E9BB8; }
.role-line { display: none; margin: 0 0 16px; font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }

/* Headline color: pale grey melting into the teal family (lightened teals keep it readable). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .headline h1, .about-text h1 {
    background: linear-gradient(100deg, #D3D9D4 0%, #8CC5D8 48%, #4E9BB8 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    padding-bottom: 0.08em; /* keeps descenders from being clipped */
  }
}

/* The reel is the featured film: true 16:9, same width as the grid, captioned like a card. */
.feature { padding-bottom: 8px; }
.reel {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9; overflow: hidden;
  border: 0; padding: 0; margin: 0; cursor: pointer;
  background: var(--surface) center / cover no-repeat;
}
.reel iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; pointer-events: none;
}
.reel-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
  background: rgba(18, 78, 102, 0.88);
  border: 1px solid rgba(211, 217, 212, 0.25); border-radius: 999px;
  padding: 12px 22px; min-height: 44px;
  font-size: 14px; color: var(--text);
  transition: background 0.2s;
}
.reel:hover .reel-play { background: var(--accent-hover); }
.feature-caption {
  display: flex; flex-direction: column; align-items: flex-end; text-align: right;
  gap: 4px; margin-top: 18px;
}
.feature-title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2;
}
.feature-meta { font-size: 14px; color: var(--muted); }

/* ---------- Work grid ---------- */

.work { padding-top: 72px; padding-bottom: 32px; scroll-margin-top: 72px; }
.work-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px; margin-bottom: 40px;
}
.eyebrow {
  margin: 0;
  font-family: var(--narrow); font-weight: 500; font-size: 15px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: transparent; color: var(--text);
  border: 1px solid var(--chip-line); border-radius: 999px;
  padding: 10px 18px; min-height: 44px;
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--steel); color: #ffffff; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--text); border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
}
.card { display: flex; flex-direction: column; gap: 14px; }
.card[hidden] { display: none; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease, opacity 0.4s ease;
  opacity: 0;
}
.thumb img.loaded { opacity: 1; }
.card:hover .thumb img { transform: scale(1.03); }
.play-dot {
  position: absolute; left: 12px; bottom: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(18, 78, 102, 0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.card:hover .play-dot { opacity: 1; }
.card-title { font-size: 17px; font-weight: 500; line-height: 1.3; }
.card-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.empty { color: var(--muted); }

/* ---------- Project page ---------- */

.player-wrap { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 0; }
.player {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--surface) center / cover no-repeat;
  border: 0; padding: 0; cursor: pointer; display: block;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(18, 78, 102, 0.88); border: 1px solid rgba(211, 217, 212, 0.3);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.player-note {
  position: absolute; left: 50%; top: calc(50% + 62px); transform: translateX(-50%);
  white-space: nowrap; font-size: 14px; color: var(--text);
  background: rgba(33, 42, 49, 0.85); padding: 6px 12px; border-radius: 999px;
}
.player:hover .big-play { background: var(--accent-hover); }

.project { padding-top: 56px; padding-bottom: 32px; }
.project-title {
  margin: 0 0 40px; max-width: 1000px;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(36px, 4.6vw, 64px); line-height: 1.05; letter-spacing: -0.01em;
}
.project-body { display: flex; flex-wrap: wrap; gap: 48px 80px; }
.facts {
  flex: 1 1 260px; max-width: 420px; margin: 0;
  display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; align-content: start;
  font-size: 14px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.prose { flex: 999 1 520px; max-width: 720px; }
.prose p { margin: 0 0 20px; font-size: 18px; line-height: 1.65; color: var(--text-soft); }
.prose p.award {
  margin: 0 0 24px;
  font-family: var(--narrow); text-transform: uppercase;
  font-size: 13px; line-height: 1.5; letter-spacing: 0.02em; color: var(--text);
}
.details { list-style: none; margin: 8px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.details li { font-size: 14px; color: var(--muted); padding: 4px 0; }

.pager {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: 88px; padding-top: 28px; border-top: 1px solid var(--line);
}
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; max-width: 46%; }
.pager .next { text-align: right; margin-left: auto; }
.pager small { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pager span { font-family: var(--serif); font-size: 26px; font-weight: 300; line-height: 1.2; }

/* ---------- About ---------- */

.about { padding-top: 88px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 56px 80px; }
/* The headshot is a tall strip (474 x 1000) with DC at the right edge by design.
   Desktop shows it whole and keeps it in view while you read; smaller screens
   crop top and bottom only (never the sides) around his face. */
.about-photo {
  flex: 0 0 320px; max-width: 320px; align-self: flex-start;
  position: sticky; top: 104px;
}
.about-photo img { width: 100%; height: auto; aspect-ratio: 474 / 1000; object-fit: cover; background: var(--surface); }
.about-text { flex: 999 1 520px; max-width: 760px; }
.about-text h1 {
  margin: 0 0 32px;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(34px, 3.8vw, 52px); line-height: 1.12;
}
.about-text p { margin: 0 0 20px; font-size: 18px; line-height: 1.65; color: var(--text-soft); }
.about-lists { display: flex; flex-wrap: wrap; gap: 40px 64px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.about-lists > div { flex: 1 1 220px; }
.about-lists ul { list-style: none; margin: 14px 0 0; padding: 0; font-size: 15px; line-height: 1.9; }
.about-lists li { break-inside: avoid; }
.about-lists .list-clients { flex: 2 1 100%; }
.about-lists .list-clients ul { columns: 3 170px; column-gap: 32px; }
.about-lists .list-agencies { flex: 2 1 340px; }
.about-lists .list-agencies ul { columns: 2 170px; column-gap: 32px; }
.about-lists .list-recognition { flex: 1 1 220px; }

.about-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px;
  padding: 12px 24px; border-radius: 999px;
  background: var(--accent); color: var(--text);
  font-size: 15px; font-weight: 500;
}
.btn:hover { background: var(--accent-hover); color: #ffffff; }
.btn-ghost { background: transparent; border: 1px solid var(--steel); }
.btn-ghost:hover { background: rgba(116, 141, 146, 0.15); }
.btn[hidden] { display: none; }

.experience { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.exp-list { list-style: none; margin: 8px 0 0; padding: 0; }
.exp-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 24px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.exp-row:last-child { border-bottom: 0; }
.exp-dates { font-size: 13px; color: var(--muted); padding-top: 4px; letter-spacing: 0.02em; }
.exp-role { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.4; }
.exp-co { display: block; font-weight: 400; font-size: 15px; color: #8CC5D8; }
.exp-body p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.about-lists em { font-style: italic; color: var(--text-soft); }

/* ---------- Contact ---------- */

.contact { padding-top: 88px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 48px 96px; }
.contact-intro { flex: 1 1 320px; max-width: 480px; }
.contact-intro h1 {
  margin: 0 0 20px;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(38px, 4.6vw, 64px); line-height: 1.05;
}
.contact-intro p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text-soft); }
.contact-form-wrap { flex: 999 1 460px; max-width: 680px; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--steel);
  padding: 10px 0; border-radius: 0;
  transition: border-color 0.2s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.send {
  justify-self: start;
  background: var(--accent); color: var(--text);
  border: 0; border-radius: 999px;
  padding: 14px 28px; min-height: 48px;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.send:hover { background: var(--accent-hover); }
.send:disabled { opacity: 0.6; cursor: default; }
.form-status { margin: 20px 0 0; font-size: 16px; }
.form-status.ok { font-family: var(--serif); font-size: 28px; font-weight: 300; color: var(--text); }
.form-status.err { color: #f0a58a; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 96px; background: var(--accent); scroll-margin-top: 72px; }
.site-footer a:hover { color: #ffffff; }
.site-footer .wrap {
  padding-top: 96px; padding-bottom: 64px;
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 32px;
}
.footer-lead { display: flex; flex-direction: column; gap: 10px; }
.footer-lead span { font-size: 13px; color: #B9C7C9; letter-spacing: 0.06em; }
.footer-lead a { font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 3vw, 40px); }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; font-size: 14px; color: #B9C7C9; }
.footer-links a, .footer-links span { padding: 12px 0; }

/* ---------- Lightbox (reel with sound) ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 26, 31, 0.96);
  display: none; align-items: center; justify-content: center;
  padding: 64px;
}
.lightbox.open { display: flex; }
.lightbox-frame { position: relative; width: min(100%, calc((100vh - 128px) * 16 / 9)); aspect-ratio: 16 / 9; }
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .about-photo { flex: 1 1 100%; max-width: 440px; position: static; }
  .about-photo img { aspect-ratio: 4 / 5; object-position: 50% 62%; }
  .brand-role { display: none; }
  .role-line { display: block; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Phone ---------- */

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .site-header .wrap { min-height: 64px; }
  .brand-name { font-size: 18px; }
  .brand-role { display: none; }
  .nav { display: none; }
  .menu-btn { display: flex; }

  .headline { padding-top: 32px; padding-bottom: 36px; }
  .headline h1 { line-height: 1.08; letter-spacing: -0.01em; }

  .reel-play { padding: 10px 16px; font-size: 13px; }
  .feature-caption { margin-top: 12px; }

  .work { padding-top: 48px; }
  .work-head { margin-bottom: 24px; }
  .filters {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px;
    width: calc(100% + var(--gutter) * 2);
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 10px 16px; }

  .grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .play-dot { opacity: 1; width: 32px; height: 32px; left: 10px; bottom: 10px; }

  .player-wrap { padding: 0; }
  .project { padding-top: 32px; }
  .project-title { margin-bottom: 28px; }
  .prose p, .about-text p { font-size: 17px; }
  .pager { margin-top: 56px; }
  .pager span { font-size: 20px; }

  .about { padding-top: 32px; }
  .contact { padding-top: 32px; }
  .exp-row { grid-template-columns: minmax(0, 1fr); }
  .contact-form { grid-template-columns: minmax(0, 1fr); }
  .send { width: 100%; }

  .site-footer .wrap { padding-top: 48px; padding-bottom: 40px; flex-direction: column; align-items: flex-start; }

  .lightbox { padding: 0; }
  .lightbox-frame { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .thumb img { transition: none; }
}

/* =====================================================================
   TEAL THEME (alternate). Turn it on by changing the first line of each
   page from <html lang="en"> to <html lang="en" data-theme="teal">.
   124E66 becomes the page, 212A31 becomes the high-contrast accent.
   ===================================================================== */

html[data-theme="teal"] {
  --bg: #124E66;
  --surface: #212A31;          /* video frames read like dark screens */
  --accent: #212A31;           /* buttons, active filter, footer */
  --accent-hover: #2E3944;
  --steel: #748D92;
  --text: #E6EBE7;
  --text-soft: #D3D9D4;
  --muted: #B9C7C9;
  --line: rgba(211, 217, 212, 0.22);
  --chip-line: rgba(211, 217, 212, 0.4);
}
html[data-theme="teal"] .site-header { background: rgba(18, 78, 102, 0.94); }
html[data-theme="teal"] .reel-play,
html[data-theme="teal"] .player .big-play,
html[data-theme="teal"] .play-dot { background: rgba(33, 42, 49, 0.88); border-color: rgba(230, 235, 231, 0.3); }
html[data-theme="teal"] .reel:hover .reel-play,
html[data-theme="teal"] .player:hover .big-play { background: #2E3944; }
html[data-theme="teal"] .chip:hover { border-color: #E6EBE7; }
html[data-theme="teal"] .exp-co { color: #8CC5D8; }
html[data-theme="teal"] .locale::before { background: #E6EBE7; }
html[data-theme="teal"] .field input,
html[data-theme="teal"] .field textarea { border-bottom-color: rgba(230, 235, 231, 0.5); }
html[data-theme="teal"] .btn-ghost { border-color: rgba(230, 235, 231, 0.6); }
html[data-theme="teal"] .form-status.err { color: #FFD2C2; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="teal"] .headline h1,
  html[data-theme="teal"] .about-text h1 {
    background: linear-gradient(100deg, #FFFFFF 0%, #D3D9D4 50%, #8CC5D8 100%);
    -webkit-background-clip: text; background-clip: text;
  }
}

/* =====================================================================
   AMBER ACCENT (optional, pairs with the teal theme). Turn on with
   <html lang="en" data-theme="teal" data-accent="amber">.
   One warm color, used only on things people click or should notice.
   ===================================================================== */
html[data-accent="amber"] { --pop: #F2B544; --pop-hover: #F6C566; --on-pop: #212A31; }
html[data-accent="amber"] .chip[aria-pressed="true"] { background: var(--pop); border-color: var(--pop); color: var(--on-pop); }
html[data-accent="amber"] .reel-play,
html[data-accent="amber"] .player .big-play { background: var(--pop); color: var(--on-pop); border-color: var(--pop); }
html[data-accent="amber"] .player .big-play svg { fill: var(--on-pop); }
html[data-accent="amber"] .reel:hover .reel-play,
html[data-accent="amber"] .player:hover .big-play { background: var(--pop-hover); }
html[data-accent="amber"] .play-dot { background: var(--pop); }
html[data-accent="amber"] .play-dot svg { fill: var(--on-pop); }
html[data-accent="amber"] .send,
html[data-accent="amber"] .btn:not(.btn-ghost) { background: var(--pop); color: var(--on-pop); }
html[data-accent="amber"] .send:hover,
html[data-accent="amber"] .btn:not(.btn-ghost):hover { background: var(--pop-hover); color: var(--on-pop); }
html[data-accent="amber"] .locale::before { background: var(--pop); }
html[data-accent="amber"] .prose p.award { color: var(--pop); }
html[data-accent="amber"] .footer-lead a { color: var(--pop); }
html[data-accent="amber"] .footer-lead a:hover { color: var(--pop-hover); }
html[data-accent="amber"] .nav a[aria-current="page"] { text-decoration-color: var(--pop); }
html[data-accent="amber"] :focus-visible { outline-color: var(--pop); }
