/* ============================================================
   CINEMATIC ENIGMA PORTAL — styles.css
   Aesthetic: Cyber-Dark Luxury
   Author: Angelina Rania | slotmawar.it.com
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────── */
:root {
  --void:          #050507;
  --obsidian:      #080810;
  --gold:          #D4AF37;
  --gold-muted:    rgba(212, 175, 55, 0.45);
  --gold-dim:      rgba(212, 175, 55, 0.15);
  --silver:        #C8C8D4;
  --silver-muted:  rgba(200, 200, 212, 0.55);
  --silver-bright: #E8E8F0;
  --white-ghost:   rgba(255, 255, 255, 0.04);
  --overlay-base:  rgba(5, 5, 7, 0.62);

  --font-display:  'Cinzel', 'Palatino Linotype', Georgia, serif;
  --font-body:     'Cormorant Garamond', 'EB Garamond', Georgia, serif;

  --ease-cinematic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-luxury:    cubic-bezier(0.16, 1, 0.3, 1);

  --z-video:   0;
  --z-overlay: 1;
  --z-content: 10;
  --z-chrome:  20;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--void);
  color: var(--silver);
  font-family: var(--font-body);
  cursor: default;
  user-select: none;
}

/* ── Video Background ──────────────────────────────────── */
.video-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-video);
  overflow: hidden;
}

#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  /* Cinematic treatment: darken and desaturate slightly
     so gold/silver typography always reads perfectly */
  filter:
    brightness(0.38)
    contrast(1.18)
    saturate(0.7)
    blur(0px);
  transform: scale(1.04); /* slight overscale prevents edge flicker */
  will-change: transform;
}

/* Subtle slow zoom breathe on the video — purely atmospheric */
@keyframes video-breathe {
  0%   { transform: scale(1.04); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1.04); }
}

#bg-video {
  animation: video-breathe 28s ease-in-out infinite;
}

/* ── Overlays ───────────────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Dark base tint */
.overlay--base {
  z-index: 1;
  background: var(--overlay-base);
}

/* Cinematic vignette — deep shadows at all edges, brightest in center */
.overlay--vignette {
  z-index: 2;
  background: radial-gradient(
    ellipse 78% 70% at 50% 50%,
    transparent 0%,
    rgba(5, 5, 7, 0.45) 55%,
    rgba(5, 5, 7, 0.88) 100%
  );
}

/* Subtle film grain texture via SVG noise */
.overlay--grain {
  z-index: 3;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: overlay;
}

/* ── Decorative Rules (top & bottom) ───────────────────── */
.rule {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-chrome);
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 80vw);
  opacity: 0;
  transition: opacity 1.6s var(--ease-cinematic);
}

.rule--top    { top: 32px;    }
.rule--bottom { bottom: 32px; }

.rule.is-visible { opacity: 1; }

.rule__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-muted) 40%,
    var(--gold-muted) 60%,
    transparent
  );
}

.rule__diamond {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.7;
  flex-shrink: 0;
}

/* ── Main Portal Layout ─────────────────────────────────── */
.portal {
  position: relative;
  z-index: var(--z-content);
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 80px 24px;

  /* Initial hidden state — JS drives the reveal */
  opacity: 0;
}

/* ── Wordmark ──────────────────────────────────────────── */
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
  letter-spacing: 0.38em;
}

.wordmark__letter {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1vw, 0.72rem);
  font-weight: 300;
  color: var(--gold-muted);
  text-transform: uppercase;
  letter-spacing: 0.55em;
}

.wordmark__separator {
  color: var(--gold-dim);
  font-size: 0.5rem;
}

/* ── Clock Section ──────────────────────────────────────── */
.clock-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  padding: 28px 52px;
}

/* Thin corner-bracket frame around the clock */
.clock-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.clock-frame__corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--gold-muted);
  border-style: solid;
}

.clock-frame__corner--tl { top: 0; left: 0;  border-width: 1px 0 0 1px; }
.clock-frame__corner--tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.clock-frame__corner--bl { bottom: 0; left: 0;  border-width: 0 0 1px 1px; }
.clock-frame__corner--br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.clock {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 8.5vw, 6.8rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--silver-bright);
  line-height: 1;

  /* Metallic silver shimmer via gradient text */
  background: linear-gradient(
    160deg,
    #a8a8b8 0%,
    #e8e8f4 28%,
    #f0f0f8 50%,
    #c4c4d8 72%,
    #909098 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* Subtle luminous glow */
  filter: drop-shadow(0 0 22px rgba(200, 200, 220, 0.18))
          drop-shadow(0 0 8px rgba(212, 175, 55, 0.08));

  /* Prevent digit-width layout shifts */
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum" 1;
  font-feature-settings: "tnum" 1;
  min-width: 9ch;
  text-align: center;
}

.clock-date {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.1vw, 0.68rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--gold-muted);
  text-transform: uppercase;
}

/* ── Gold Divider ────────────────────────────────────────── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(320px, 60vw);
  margin-bottom: 36px;
}

.gold-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-muted),
    transparent
  );
}

.gold-divider__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}

/* ── Enigmatic Quote ─────────────────────────────────────── */
.quote {
  text-align: center;
  max-width: min(520px, 85vw);
  margin-bottom: 44px;
}

.quote__main {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.4vw, 1.42rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--silver-muted);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.quote__main em {
  font-style: italic;
  color: rgba(212, 175, 55, 0.72);
  font-weight: 300;
}

.quote__attribution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quote__dash {
  color: var(--gold-dim);
  font-size: 1rem;
}

cite {
  font-family: var(--font-display);
  font-size: clamp(0.48rem, 0.9vw, 0.6rem);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.45);
}

/* ── Status Indicator ────────────────────────────────────── */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.75;
  animation: pulse-dot 3.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.75; box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50%       { opacity: 1;    box-shadow: 0 0 0 5px rgba(212, 175, 55, 0); }
  40%       { opacity: 1;    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18); }
}

.status__text {
  font-family: var(--font-display);
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 0.62em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.38);
}

/* ── Watermark ────────────────────────────────────────────── */
.watermark {
  position: fixed;
  bottom: 24px;
  right: 32px;
  z-index: var(--z-chrome);
  opacity: 0;
  transition: opacity 2s var(--ease-cinematic) 2s;
}

.watermark.is-visible { opacity: 1; }

.watermark__text {
  font-family: var(--font-display);
  font-size: 0.45rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(200, 200, 212, 0.22);
}

.watermark__text strong {
  font-weight: 400;
  color: rgba(212, 175, 55, 0.3);
}

/* ── Corner Coordinates ───────────────────────────────────── */
.coord {
  position: fixed;
  z-index: var(--z-chrome);
  font-family: var(--font-display);
  font-size: 0.42rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200, 200, 212, 0.14);
  opacity: 0;
  transition: opacity 2s var(--ease-cinematic) 2.5s;
}

.coord.is-visible { opacity: 1; }

.coord--tl { top: 24px;    left: 32px;  }
.coord--tr { top: 24px;    right: 32px; }

/* ── Ambient Scan Line ─────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  left: 0;
  top: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.0) 10%,
    rgba(212, 175, 55, 0.18) 50%,
    rgba(212, 175, 55, 0.0) 90%,
    transparent 100%
  );
  z-index: var(--z-chrome);
  animation: scan-line 9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scan-line {
  0%   { top: -2px;   opacity: 0; }
  5%   {              opacity: 1; }
  95%  {              opacity: 0.6; }
  100% { top: 100vh;  opacity: 0; }
}

/* ── Responsive Adjustments ──────────────────────────────── */
@media (max-width: 480px) {
  .clock-section { padding: 20px 28px; }
  .wordmark       { gap: 8px; margin-bottom: 40px; }
  .coord          { display: none; }
  .rule           { width: 85vw; }
}

@media (max-height: 600px) {
  .wordmark      { margin-bottom: 28px; }
  .clock-section { margin-bottom: 20px; }
  .gold-divider  { margin-bottom: 20px; }
  .quote         { margin-bottom: 24px; }
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #bg-video,
  body::after,
  .status__dot {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
