/* ===========================================================
   Tudor Potop — Portfolio site
   Design tokens
   =========================================================== */
:root {
  --bg: #0a0a0b;
  --bg-alt: #121214;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --border: #262629;
  --border-soft: #1c1c1f;

  --gold: #c9a25c;
  --gold-bright: #e3c384;
  --gold-dim: #8a7141;

  --text: #f1ede4;
  --text-muted: #948e83;
  --text-faint: #5c5952;

  --serif: "Fraunces", "Iowan Old Style", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1280px;
  --pad: clamp(24px, 5vw, 96px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

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

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

::selection { background: var(--gold-dim); color: var(--text); }

/* Film-grain / vignette atmosphere, subtle, fixed over whole page */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--pad);
  mix-blend-mode: normal;
}
.nav.scrolled {
  background: rgba(10,10,11,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  padding-top: 18px;
  padding-bottom: 18px;
  transition: padding 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-btn {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.nav-btn:hover { color: var(--text); border-color: var(--border); background: var(--surface); }
.nav-btn.active { color: var(--gold-bright); }
.nav-btn.primary {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}
.nav-btn.primary:hover { background: var(--gold); color: #0a0a0b; border-color: var(--gold); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(78vw, 320px);
    background: rgba(9,9,10,0.98);
    backdrop-filter: blur(14px);
    border-left: 1px solid var(--border-soft);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 100;
  }
  .nav.nav-open .nav-links { transform: translateX(0); }
  .nav-btn { width: 100%; text-align: center; padding: 16px; font-size: 15px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  font-weight: 500;
  transition: all 0.25s var(--ease);
  border: 1px solid transparent;
}
.btn-gold { background: var(--gold); color: #0a0a0b; }
.btn-gold:hover { background: var(--gold-bright); transform: translateY(-1px); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------- Utility ---------- */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.section { padding: 120px var(--pad); max-width: var(--container); margin: 0 auto; }
.section-tight { padding-top: 60px; padding-bottom: 60px; }
.divider { height: 1px; background: var(--border-soft); border: none; margin: 0; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
.footer {
  padding: 48px var(--pad) 40px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-faint);
  font-size: 13px;
}
.footer a { color: var(--text-muted); transition: color 0.2s; }
.footer a:hover { color: var(--gold-bright); }
.footer-links { display: flex; gap: 24px; }

/* ---------- Page header (interior pages) ---------- */
.page-header {
  padding: 200px var(--pad) 80px;
  max-width: var(--container);
  margin: 0 auto;
}
.page-header .eyebrow { margin-bottom: 18px; display: block; }
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.page-header p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 560px;
  margin: 0;
}

/* ---------- Reel card (shared: home preview + full portfolio) ---------- */
.reel-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.reel-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); }

/* Placeholder cards (no video yet) — icon + text overlaid on empty frame */
.reel-card.is-placeholder { aspect-ratio: 9 / 16; }
.reel-card.is-placeholder .ph-icon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  font-size: 14px;
}
.reel-card.is-placeholder .rc-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(10,10,11,0.75) 70%);
}

/* Video cards — video on top, text stacked BELOW (never overlapping Vimeo's own UI) */
.reel-card.is-video { display: flex; flex-direction: column; }
.reel-card.is-video .rc-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  flex-shrink: 0;
}
.reel-card.is-video .rc-embed {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.reel-card.is-video .rc-text {
  padding: 16px 18px 18px;
}

.reel-card .rc-client { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.reel-card .rc-title { font-family: var(--serif); font-size: 18px; margin: 0 0 6px; }
.reel-card .rc-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ---------- Mobile refinements ---------- */
@media (max-width: 700px) {
  .nav { padding: 20px var(--pad); }
  .nav.scrolled { padding-top: 14px; padding-bottom: 14px; }
  .nav-logo { font-size: 17px; }

  .page-header { padding-top: 130px; padding-bottom: 56px; }
  .page-header p { font-size: 16px; }

  .footer { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-links { gap: 18px; flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .btn { padding: 14px 24px; font-size: 13px; }
}

/* ---------- Photo Albums ---------- */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.album-card { cursor: pointer; }
.album-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.album-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.album-card:hover .album-cover img { transform: scale(1.06); }
.album-count {
  position: absolute; top: 14px; right: 14px;
  background: rgba(10,10,11,0.65);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 999px;
}
.album-info { padding: 16px 4px 0; }
.album-title { font-family: var(--serif); font-size: 19px; margin-bottom: 4px; }
.album-subtitle { font-size: 13px; color: var(--text-muted); }

@media (max-width: 900px) {
  .albums-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .albums-grid { grid-template-columns: 1fr; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6,6,7,0.96);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-img {
  max-width: min(88vw, 900px);
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--gold); color: #0a0a0b; border-color: var(--gold); }
.lb-close { top: 24px; right: 24px; width: 42px; height: 42px; font-size: 16px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 26px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-caption {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: var(--text-muted);
  background: rgba(10,10,11,0.6);
  padding: 8px 18px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .lb-prev { left: 10px; width: 40px; height: 40px; font-size: 22px; }
  .lb-next { right: 10px; width: 40px; height: 40px; font-size: 22px; }
  .lb-close { top: 14px; right: 14px; width: 38px; height: 38px; }
  .lb-img { max-width: 94vw; max-height: 76vh; }
}
