/* ============================================================
   ERGOWORKS - SCROLL-DRIVEN VIDEO DOCUMENTARY
   ============================================================
   Scroll controls video playback - no autoplay
   Typography: Playfair Display + JetBrains Mono + Outfit
   Aesthetic: Cinematic Documentary
   ============================================================ */

/* ==================== RESET & VARIABLES ==================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core Palette */
  --athens: #E8E6E1;
  --ivory: #FAF9F6;
  --ink: #0D0D0D;
  --ink-75: rgba(13, 13, 13, 0.75);
  --ink-50: rgba(13, 13, 13, 0.5);
  --ink-25: rgba(13, 13, 13, 0.25);
  --ink-10: rgba(13, 13, 13, 0.1);

  /* Accent */
  --amber: #D4A574;
  --amber-bright: #E8B88A;
  --rust: #B8703D;

  /* Glass */
  --glass-bg: rgba(250, 249, 246, 0.88);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: rgba(13, 13, 13, 0.08);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Outfit', -apple-system, sans-serif;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Timing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--athens);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==================== SCROLL CONTAINER ==================== */
.scroll-container {
  position: relative;
}

.scroll-spacer {
  height: 500vh; /* Creates scroll room for video scrubbing */
  pointer-events: none;
}

/* ==================== VIDEO BACKGROUND ==================== */
.video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--athens);
  overflow: hidden;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.bg-video.active {
  opacity: 1;
}

.video-grain {
  position: absolute;
  inset: 0;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ==================== CONTENT LAYER ==================== */
.content-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== CARDS ==================== */
.card {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border);
  padding: var(--sp-7);
  max-width: 460px;
  width: 88%;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  box-shadow:
    0 2px 4px var(--glass-shadow),
    0 12px 40px var(--glass-shadow);
}

.card.visible {
  opacity: 1;
  visibility: visible;
}

/* Card Positions - S-curve flow */
.card-hero {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.card-about {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
}

.card-services {
  top: 50%;
  left: 8%;
  transform: translateY(-50%);
}

.card-clients {
  top: 40%;
  right: 10%;
  left: auto;
  transform: translateY(-50%);
}

.card-contact {
  bottom: 12%;
  left: 50%;
  top: auto;
  transform: translateX(-50%);
}

/* ==================== HERO CARD ==================== */
.card-hero {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  text-align: center;
  max-width: 600px;
}

.card-frame {
  position: absolute;
  inset: -20px;
  pointer-events: none;
}

.frame-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink-25);
}

.frame-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.frame-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.frame-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.frame-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.card-super {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin-bottom: var(--sp-5);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-5);
}

.title-line {
  display: block;
}

.title-line.accent {
  font-style: italic;
  color: var(--rust);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-50);
  line-height: 1.8;
}

.scroll-hint {
  margin-top: var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.scroll-hint span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-25);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--ink-25), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

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

/* ==================== SECTION NUMBER ==================== */
.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--amber);
  margin-bottom: var(--sp-4);
}

/* ==================== TYPOGRAPHY ==================== */
.card h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}

.card-body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-75);
  line-height: 1.7;
  max-width: 360px;
}

/* ==================== STATS ROW ==================== */
.stat-row {
  display: flex;
  gap: var(--sp-6);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--ink-10);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.stat-val {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-50);
}

/* ==================== SERVICES LIST ==================== */
.services-list {
  list-style: none;
  margin-top: var(--sp-5);
}

.services-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--ink-10);
}

.services-list li:last-child {
  border-bottom: none;
}

.srv-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber);
  min-width: 24px;
}

.srv-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-75);
}

/* ==================== CLIENT GRID ==================== */
.client-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.client-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: var(--sp-2) var(--sp-3);
  background: var(--ink-10);
  color: var(--ink-75);
  border: 1px solid transparent;
  transition: all 0.3s var(--ease-smooth);
}

.client-tag:hover {
  background: transparent;
  border-color: var(--amber);
  color: var(--ink);
}

/* ==================== CONTACT ==================== */
.contact-info {
  margin-top: var(--sp-5);
}

.contact-person {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin-bottom: var(--sp-6);
}

.avatar {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--amber), var(--rust));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: white;
  flex-shrink: 0;
}

.person-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person-details strong {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
}

.person-details span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-50);
}

.degree {
  font-size: 10px !important;
  color: var(--ink-25) !important;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.contact-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--ink-10);
  transition: all 0.3s var(--ease-smooth);
}

.contact-btn:hover {
  border-color: var(--amber);
  background: rgba(212, 165, 116, 0.05);
}

.contact-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ivory);
}

.contact-btn.primary:hover {
  background: var(--rust);
  border-color: var(--rust);
}

.btn-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

.btn-value {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
  position: fixed;
  right: var(--sp-6);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.progress-fill {
  position: absolute;
  width: 2px;
  height: 100%;
  background: var(--ink-10);
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--amber);
  transition: height 0.3s var(--ease-smooth);
}

.progress-sections {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.prog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--ink-25);
  background: var(--ivory);
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  padding: 0;
}

.prog-dot:hover {
  border-color: var(--ink-50);
  transform: scale(1.2);
}

.prog-dot.active {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.2);
}

/* ==================== SECTION LABEL ==================== */
.section-label {
  position: fixed;
  left: var(--sp-6);
  bottom: var(--sp-6);
  z-index: 100;
}

.label-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-25);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

/* ==================== BRAND WATERMARK ==================== */
.brand-watermark {
  position: fixed;
  top: var(--sp-6);
  left: var(--sp-6);
  z-index: 100;
}

.brand-watermark span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--ink-25);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .card-about,
  .card-clients {
    right: 5%;
  }

  .card-services {
    left: 5%;
  }
}

@media (max-width: 768px) {
  .card {
    padding: var(--sp-5);
    max-width: 360px;
    width: 90%;
  }

  .card-hero,
  .card-about,
  .card-services,
  .card-clients,
  .card-contact {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
  }

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .progress-bar {
    right: var(--sp-4);
  }

  .section-label {
    left: var(--sp-4);
    bottom: var(--sp-4);
  }

  .brand-watermark {
    left: var(--sp-4);
    top: var(--sp-4);
  }

  .stat-row {
    gap: var(--sp-4);
  }

  .stat-val {
    font-size: 1.5rem;
  }

  .frame-corner {
    width: 24px;
    height: 24px;
  }

  .card-frame {
    inset: -12px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: var(--sp-4);
    width: 92%;
  }

  .card h2 {
    font-size: 1.5rem;
  }

  .stat-row {
    flex-wrap: wrap;
  }

  .services-list li {
    padding: var(--sp-2) 0;
  }

  .client-grid {
    gap: var(--sp-1);
  }

  .client-tag {
    font-size: 10px;
    padding: var(--sp-1) var(--sp-2);
  }
}

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

  .scroll-line {
    animation: none;
  }
}

/* ==================== FOCUS STATES ==================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

/* ==================== DEBUG TIMESTAMP ==================== */
.debug-timestamp {
  position: fixed;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(8px);
  padding: var(--sp-4);
  font-family: var(--font-mono);
  min-width: 140px;
}

.ts-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ts-row:last-child {
  border-bottom: none;
}

.ts-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
}

.ts-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
