/* ============================================================
   Drain The Swamp — Main Stylesheet
   ============================================================ */

/* ── CUSTOM FONTS ──────────────────────────────────────────── */
@font-face {
  font-family: 'Awesome Serif';
  src: url('../fonts/Awesome Serif Italic VAR-VF.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Aceh';
  src: url('../fonts/Aceh-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ── RESET + CUSTOM PROPERTIES ──────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #06080a;
  --accent: #c8b89a;
  --text: #4f4f4f;
  --dim: #7a7369;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cinzel', serif;
  overflow-x: hidden;
}

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

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


/* ── SKIP LINK (accessibility) ──────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5em 1em;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.875rem;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}


/* ── BACKGROUND LAYER ───────────────────────────────────────── */
.dts-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  will-change: transform;
}

.dts-bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom right;
}

/* Cinematic vignette overlay */
.dts-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 80% at 50% 40%,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.75) 70%,
    rgba(0, 0, 0, 0.92) 100%
  );
  pointer-events: none;
}


/* ── GRAIN TEXTURE ──────────────────────────────────────────── */
.dts-grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(1) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, -4%); }
  40%  { transform: translate(-6%, 3%); }
  60%  { transform: translate(3%, -1%); }
  80%  { transform: translate(-4%, 6%); }
  100% { transform: translate(0, 0); }
}


/* ── STAGE / LAYOUT ─────────────────────────────────────────── */
.dts-stage {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}


/* ── VIDEO CONTAINER ────────────────────────────────────────── */
.dts-video {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  background: #000;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 1.2s var(--ease-out-expo) 0.3s forwards;
}

/* Subtle gold frame glow */
.dts-video::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(200, 184, 154, 0.25),
    rgba(200, 184, 154, 0.05) 40%,
    rgba(200, 184, 154, 0.15)
  );
  z-index: -1;
  pointer-events: none;
}

.dts-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ── VIDEO PLACEHOLDER (lazy-load pattern) ──────────────────── */
.dts-video__placeholder {
  position: absolute;
  inset: 0;
  background: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.4s ease;
}

.dts-video__placeholder[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

/* Poster image inside placeholder */
.dts-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

.dts-video__placeholder:hover .dts-video__poster {
  opacity: 0.75;
}

/* Play button */
.dts-play {
  position: relative;
  z-index: 2;
  width: clamp(52px, 8vw, 72px);
  height: clamp(52px, 8vw, 72px);
  border: 1.5px solid rgba(212, 207, 201, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, transform 0.3s;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dts-video__placeholder:hover .dts-play {
  border-color: var(--accent);
  transform: scale(1.08);
}

.dts-play svg {
  width: 50%;
  fill: rgba(212, 207, 201, 0.85);
  margin-left: 8%;
  transition: fill 0.3s;
}

.dts-video__placeholder:hover .dts-play svg {
  fill: var(--accent);
}

/* Pulse animation on play button */
.dts-play::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(200, 184, 154, 0.15);
  border-radius: 50%;
  animation: pulse-ring 2.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}


/* ── TITLE BLOCK ────────────────────────────────────────────── */
.dts-title {
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 1s var(--ease-out-expo) 0.6s forwards;
}

.dts-title__heading {
  font-family: 'Awesome Serif', 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 4.5rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.8);
}

.dts-title__date {
  font-family: 'Aceh', 'Cinzel', serif;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  letter-spacing: 0.35em;
  color: var(--text);
  margin-top: 0.6em;
}

/* ── SYNOPSIS TEXT ───────────────────────────────────────────── */
.dts-title__synopsis {
  font-family: 'pressio-x-compressed', sans-serif;
  font-weight: 200;
  font-style: normal;
  font-size: clamp(0.94rem, 1.78vw, 1.29rem);
  line-height: 1.12;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  max-width: 680px;
  margin: 1.4em auto 0;
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-out-expo) 0.85s forwards;
}


/* ── SOCIAL LINKS BAR ───────────────────────────────────────── */
.dts-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 3vw, 2rem);
  margin-top: clamp(1rem, 2.5vw, 1.8rem);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.9s forwards;
}

.dts-social__link {
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--dim);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.6rem, 1vw, 0.75rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.6em 1em;
  border: 1px solid rgba(200, 184, 154, 0.12);
  border-radius: 2px;
  transition: color 0.35s ease,
              border-color 0.35s ease,
              transform 0.35s ease,
              background 0.35s ease;
  position: relative;
  overflow: hidden;
}

.dts-social__link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200, 184, 154, 0.06), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.dts-social__link:hover::before {
  opacity: 1;
}

.dts-social__link:hover {
  color: var(--accent);
  border-color: rgba(200, 184, 154, 0.35);
  transform: translateY(-1px);
}

.dts-social__link svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  transition: transform 0.35s ease;
}

.dts-social__link:hover svg {
  transform: scale(1.1);
}

.dts-social__label {
  position: relative;
  z-index: 1;
}

/* YouTube red hint on hover */
.dts-social__link--yt:hover {
  color: #ff4444;
  border-color: rgba(255, 68, 68, 0.25);
}

/* X / Twitter stays accent gold */
.dts-social__link--x:hover {
  color: var(--accent);
  border-color: rgba(200, 184, 154, 0.35);
}


/* ── TWITTER / X EMBED SECTION ──────────────────────────────── */
.dts-tweet-section {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 3rem);
  /* Soft top gradient to blend from hero */
  background-image: linear-gradient(
    to bottom,
    rgba(6, 8, 10, 0) 0%,
    var(--bg) 10%
  );
}

.dts-tweet-section__inner {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
}

.dts-tweet-section__heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: 0.15em;
  color: var(--dim);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  text-transform: uppercase;
}

/* Decorative line under heading */
.dts-tweet-section__heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: rgba(200, 184, 154, 0.25);
  margin: 0.8em auto 0;
}

.dts-tweet-embed {
  display: flex;
  justify-content: center;
  min-height: 200px;
  position: relative;
}

/* Loading shimmer while tweet loads */
.dts-tweet-embed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(200, 184, 154, 0.02) 0%,
    rgba(200, 184, 154, 0.06) 40%,
    rgba(200, 184, 154, 0.02) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
}

.dts-tweet-embed.is-loaded::before {
  display: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fallback link */
.dts-tweet-embed__fallback {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--accent);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
  letter-spacing: 0.2em;
  padding: 1em 1.5em;
  border: 1px solid rgba(200, 184, 154, 0.2);
  border-radius: 2px;
  transition: border-color 0.3s, background 0.3s;
  position: relative;
  z-index: 1;
}

.dts-tweet-embed__fallback:hover {
  border-color: rgba(200, 184, 154, 0.5);
  background: rgba(200, 184, 154, 0.05);
}

/* Hide fallback when tweet is embedded */
.dts-tweet-embed.is-loaded .dts-tweet-embed__fallback {
  display: none;
}

/* Override Twitter widget styles to match dark theme */
.dts-tweet-embed .twitter-tweet {
  margin: 0 auto !important;
}

/* Ensure iframe-based embeds are responsive */
.dts-tweet-embed iframe {
  max-width: 100% !important;
  border-radius: 12px !important;
}


/* ── SCROLL INDICATOR ───────────────────────────────────────── */
.dts-scroll-hint {
  display: none;
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 1.4s forwards;
}

.dts-scroll-hint__line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--dim), transparent);
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0%, 100% { opacity: 0.4; transform: scaleY(0.6); }
  50%      { opacity: 1;   transform: scaleY(1); }
}


/* ── CONTENT SECTION (below fold) ───────────────────────────── */
.dts-content {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem);
}

.dts-content__inner {
  max-width: 740px;
  margin: 0 auto;
}

.dts-content__inner h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.dts-content__inner p {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.9;
  color: var(--dim);
  margin-bottom: 1.5em;
  letter-spacing: 0.02em;
}

/* Reveal-on-scroll */
.dts-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.dts-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ── FOOTER ─────────────────────────────────────────────────── */
.dts-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg);
  border-top: 1px solid rgba(200, 184, 154, 0.08);
}

.dts-footer__text {
  font-family: 'Aceh', 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  opacity: 0.5;
}


/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .dts-grain { animation: none; }
  .dts-video,
  .dts-title,
  .dts-scroll-hint,
  .dts-reveal {
    opacity: 1;
    transform: none;
  }
}


/* ── MOBILE (≤ 600px) ───────────────────────────────────────── */
@media (max-width: 600px) {
  .dts-bg::after {
    background: radial-gradient(
      ellipse 120% 100% at 50% 35%,
      rgba(0, 0, 0, 0.3) 0%,
      rgba(0, 0, 0, 0.7) 55%,
      rgba(0, 0, 0, 0.95) 100%
    );
  }

  .dts-stage {
    justify-content: center;
    padding-top: 18vh;
    padding-bottom: clamp(1.5rem, 5vw, 3rem);
  }

  .dts-video {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: transparent;
  }

  .dts-video::before {
    display: none;
  }

  .dts-video__placeholder {
    background: transparent;
  }

  .dts-video__poster {
    display: none;
  }

  .dts-title__heading {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .dts-bg__img {
    content: url('../img/hero-bg-mobile.jpg');
    object-position: center 30%;
  }

  .dts-play {
    width: 96px;
    height: 96px;
  }

  .dts-title__synopsis {
    font-size: clamp(0.8rem, 3.5vw, 1.1rem);
    max-width: 92%;
    line-height: 1.15;
    margin-top: 1.2em;
    letter-spacing: 0.06em;
  }

  .dts-scroll-hint {
    display: none;
  }
}


/* ── DESKTOP LARGE (≥ 1200px) ───────────────────────────────── */
@media (min-width: 1200px) {
  .dts-video {
    width: min(58vw, 820px);
  }

  .dts-title__synopsis {
    max-width: 680px;
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out-expo) 0.85s forwards;
  }
}


/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  .dts-bg,
  .dts-grain,
  .dts-video {
    display: none !important;
  }
  .dts-stage {
    min-height: auto;
    padding: 2rem;
  }
}
