/**
 * Vilaasita Global — Production CSS Engineering Specification
 * File: styles/main.css
 * Version: 1.0 (Production Approved – Frozen & Locked)
 * Principle: Treat every pixel as permanent. Minimalism through disciplined omission.
 * Motion Philosophy: The visitor should never notice the animation itself. They should only notice the passage of time.
 */

/* ==========================================================================
   0. TYPOGRAPHY SYSTEM (@FONT-FACE)
   ========================================================================== */
@font-face {
  font-family: 'Canela-Regular';
  src: url('../assets/fonts/Canela-Regular.woff2') format('woff2'),
       url('../assets/fonts/Canela-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
  /* Typography System */
  --font-primary: 'Canela-Regular', 'Cormorant Garamond', 'Garamond', serif;
  --font-weight-regular: 400;
  
  /* Brand Colour System (Strict Tri-Color Institutional Palette) */
  --color-bg-primary: #2E2E2E;
  --color-text-primary: #EDE7DF;
  --color-brand-gold: #C8A96A;
  
  /* Layout Spacing System (Mobile First Base) */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 2rem;     /* 32px */
  --spacing-lg: 4rem;     /* 64px */
  --spacing-xl: 8rem;     /* 128px */
  
  /* Structural Dimensions */
  --max-width-editorial: 52rem; /* Expanded to allow optimal editorial breathing room */
  --max-width-form: 40rem;      /* Expanded for institutional forms */
  --touch-target-min: 44px;
  
  /* Animation Timings & Curves */
  --transition-speed-fast: 400ms;
  --transition-speed-base: 900ms; /* Locked 900ms institutional pacing */
  --transition-speed-slow: 1200ms;
  --ease-editorial: cubic-bezier(0.25, 1, 0.5, 1);
  
  /* Layering Hierarchy (Z-Index Matrix) */
  --z-video-underlay: 10;
  --z-hero-overlay: 20;
  --z-geographic-bridge: 30;
  --z-main-portal: 40;
  --z-accessibility: 100;
}

/* ==========================================================================
   2. GLOBAL RESET & BASE ARCHITECTURE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--color-bg-primary);
}

/* Accessibility Core Utilities */
.v-visually-hidden,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--spacing-sm);
  background: var(--color-bg-primary);
  color: var(--color-brand-gold);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-brand-gold);
  z-index: var(--z-accessibility);
  text-decoration: none;
  transition: top 200ms var(--ease-editorial); /* Accelerated for instant utility */
}

.skip-link:focus {
  top: var(--spacing-sm);
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--color-brand-gold);
  outline-offset: 4px;
}

/* Core Element Typography Defaults */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
  line-height: 1.2;
}

p {
  line-height: 1.72; /* Enhanced breathing room for premium aesthetic */
  letter-spacing: 0.01em;
}

/* ==========================================================================
   3. HERO EXPERIENCE (EXPERIENCE ONE) — IMMERSIVE CINEMATIC
   ========================================================================== */
.hero-canvas-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  background-color: var(--color-bg-primary); /* Prevents black flash */
}

.hero-canvas-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: var(--z-video-underlay);
}

/* Prompt Overlay (Stripped of artificial gradients) */
.prompt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: var(--z-hero-overlay);
  transition: opacity var(--transition-speed-base) var(--ease-editorial),
              visibility var(--transition-speed-base) var(--ease-editorial);
}

/* Tap To Immerse Interaction Model (Robust coordinate positioning across form factors) */
.immersion-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  box-shadow: none;
  padding: var(--spacing-md);
  cursor: pointer;
  min-height: var(--touch-target-min);
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translate(-50%, -50%);
}

.immerse-text {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  color: #2E2E2E; /* Locked brand specification engraving tone */
  letter-spacing: 0.22em; 
  text-transform: capitalize; 
  padding-bottom: var(--spacing-xs);
  display: block;
  transition: opacity var(--transition-speed-base) var(--ease-editorial),
              letter-spacing var(--transition-speed-base) var(--ease-editorial);
}

.immersion-prompt:hover .immerse-text {
  opacity: 0.7;
  letter-spacing: 0.25em; /* Subtle lateral expansion, no vertical translation */
}

/* Fluid Institutional Audio Equaliser (Seamless circular loop configuration) */
.equaliser {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px; /* Visual compression for structural tightening */
  width: 48px;
  height: 18px; /* Elevated container headroom for rhythmic metrics */
  margin-top: var(--spacing-xs);
}

.eq-bar {
  width: 3px;
  height: 9px;
  will-change: height;
}

.eq-bar:nth-child(1) { background-color: var(--color-brand-gold); animation: fluidBarOne 1.4s infinite ease-in-out; }
.eq-bar:nth-child(2) { background-color: var(--color-text-primary); animation: fluidBarTwo 1.8s infinite ease-in-out; }
.eq-bar:nth-child(3) { background-color: var(--color-brand-gold); animation: fluidBarThree 1.2s infinite ease-in-out; }
.eq-bar:nth-child(4) { background-color: var(--color-text-primary); animation: fluidBarFour 1.6s infinite ease-in-out; }
.eq-bar:nth-child(5) { background-color: var(--color-brand-gold); animation: fluidBarFive 1.9s infinite ease-in-out; }
.eq-bar:nth-child(6) { background-color: var(--color-text-primary); animation: fluidBarSix 1.5s infinite ease-in-out; }
.eq-bar:nth-child(7) { background-color: var(--color-brand-gold); animation: fluidBarSeven 1.7s infinite ease-in-out; }

@keyframes fluidBarOne   { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes fluidBarTwo   { 0%, 100% { height: 6px; } 50% { height: 16px; } }
@keyframes fluidBarThree { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@keyframes fluidBarFour  { 0%, 100% { height: 7px; } 50% { height: 15px; } }
@keyframes fluidBarFive  { 0%, 100% { height: 5px; } 50% { height: 16px; } }
@keyframes fluidBarSix   { 0%, 100% { height: 8px; } 50% { height: 13px; } }
@keyframes fluidBarSeven { 0%, 100% { height: 4px; } 50% { height: 15px; } }

/* ==========================================================================
   4. GEOGRAPHIC REVEAL SCREEN (THE CINEMATIC BRIDGE)
   ========================================================================== */
.geo-reveal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-geographic-bridge);
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-speed-base) var(--ease-editorial),
              visibility var(--transition-speed-base) var(--ease-editorial);
}

.geo-reveal-text {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  color: var(--color-brand-gold);
  letter-spacing: 0.15em;
  margin: 0;
  line-height: 1.2;
}

/* ==========================================================================
   5. PORTAL INTERFACE SYSTEM (EXPERIENCE TWO)
   ========================================================================== */
main {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--color-bg-primary);
  z-index: var(--z-main-portal);
  transition: opacity var(--transition-speed-base) var(--ease-editorial);
}

.portal-hidden {
  opacity: 0;
  pointer-events: none;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.portal-block {
  width: 100%;
  max-width: var(--max-width-editorial);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-speed-base) var(--ease-editorial);
}

.portal-block.active-block {
  opacity: 1;
}

.portal-block h2 {
  font-size: 2rem; /* Mobile baseline proportion */
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.editorial-narrative {
  font-size: 1.125rem;
  color: var(--color-text-primary);
  opacity: 0.9;
}

.editorial-narrative p {
  margin-bottom: var(--spacing-sm);
}

.editorial-narrative p:last-child {
  margin-bottom: 0;
}

/* Button Architecture */
.block-navigation-actions,
.form-navigation-actions {
  display: flex;
  gap: var(--spacing-sm);
  width: 100%;
  margin-top: var(--spacing-md);
}

.next-btn,
.form-nav-btn {
  font-family: var(--font-primary);
  background: none;
  border: 1px solid rgba(200, 169, 106, 0.35); /* Pure brand gold baseline integration */
  color: var(--color-text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1rem;
  letter-spacing: 0.08em; /* Calibrated explicitly to complement Canela regular metrics */
  cursor: pointer;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-speed-base) var(--ease-editorial),
              color var(--transition-speed-base) var(--ease-editorial),
              background-color var(--transition-speed-base) var(--ease-editorial);
}

.next-btn:hover,
.form-nav-btn[data-action="next"]:hover {
  border-color: var(--color-text-primary);
  background-color: rgba(237, 231, 223, 0.03);
}

.prev-btn {
  border-color: transparent;
  color: var(--color-text-primary);
  opacity: 0.6;
}

.prev-btn:hover {
  opacity: 1;
  background-color: rgba(237, 231, 223, 0.02);
}

/* ==========================================================================
   6. DOSSIER INTAKE ARCHITECTURE (FORM ARCHITECTURE)
   ========================================================================== */
.dossier-form-architecture {
  width: 100%;
  max-width: var(--max-width-form);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-stage {
  display: none;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  opacity: 0;
  transition: opacity var(--transition-speed-base) var(--ease-editorial);
}

.form-stage.active {
  display: flex;
  opacity: 1;
}

.stage-header {
  border-bottom: 1px solid rgba(200, 169, 106, 0.3);
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.stage-index-prefix {
  font-size: 0.75rem;
  color: var(--color-brand-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--spacing-xs);
}

/* Input Fields Infrastructure */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  width: 100%;
}

.input-group label {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.v-form-control {
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-brand-gold);
  color: var(--color-text-primary);
  padding: 18px 20px; /* Elevated premium padding */
  width: 100%;
  box-sizing: border-box;
  caret-color: var(--color-brand-gold);
  transition: border-color var(--transition-speed-base) var(--ease-editorial),
              opacity var(--transition-speed-base) var(--ease-editorial);
}

.v-form-control::placeholder {
  color: rgba(237, 231, 223, 0.4);
}

.v-form-control:focus {
  outline: none;
  border-color: var(--color-brand-gold);
  opacity: 1;
}

textarea.v-form-control {
  resize: vertical;
  min-height: 160px; /* Extended vertical allocation for reflective discourse */
}

select.v-form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C8A96A' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: var(--spacing-xl);
}

.error-msg {
  font-size: 0.75rem;
  color: var(--color-brand-gold);
  min-height: 1.25em;
  letter-spacing: 0.01em;
  margin-top: calc(var(--spacing-xs) * -0.5);
  opacity: 0.8;
}

/* ==========================================================================
   7. REVIEW STATE MANIFEST SUMMARY
   ========================================================================== */
.review-manifest-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.review-group {
  background-color: var(--color-bg-primary);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  border: 1px solid rgba(237, 231, 223, 0.2);
}

.review-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(237, 231, 223, 0.1);
  padding-bottom: var(--spacing-xs);
}

.review-group-header h4 {
  font-size: 1.125rem;
  color: var(--color-brand-gold);
}

.review-group dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xs);
}

.review-group dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  opacity: 0.5;
  margin-top: var(--spacing-xs);
}

.review-group dd {
  font-size: 1rem;
  color: var(--color-text-primary);
  word-break: break-word;
}

.edit-stage-btn {
  background: none;
  border: none;
  color: var(--color-brand-gold);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  align-self: flex-start;
  padding: var(--spacing-xs) 0;
  min-height: calc(var(--touch-target-min) * 0.75);
}

.edit-stage-btn:hover {
  color: var(--color-text-primary);
}

/* ==========================================================================
   8. INSTITUTIONAL FOOTER
   ========================================================================== */
.institutional-footer {
  width: 100%;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
  text-align: center;
  background-color: var(--color-bg-primary);
}

.footer-copy {
  font-family: var(--font-primary);
  font-size: 0.75rem; /* Calibrated to 12px standard for crisp, legible restraint */
  color: var(--color-text-primary);
  opacity: 0.55; /* Refined visibility metrics */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  border: none;
}

/* ==========================================================================
   9. NOSCRIPT BLOCK FALLBACK ARCHITECTURE
   ========================================================================== */
.noscript-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-brand-gold);
  color: var(--color-bg-primary);
  text-align: center;
  padding: var(--spacing-sm);
  font-size: 1rem;
  font-weight: bold;
  z-index: calc(var(--z-accessibility) + 10);
}

/* ==========================================================================
   10. RESPONSIVE MEDIA CONSTRAINTS & BREAKPOINT ARCHITECTURE
   ========================================================================== */

/* 390px (Pro Max / Large Mobile Baseline Reset) */
@media (min-width: 390px) {
  .portal-block h2 {
    font-size: 2rem;
  }
}

/* 576px (Phablets / Small Tablets) */
@media (min-width: 576px) {
  :root {
    --spacing-md: 2.25rem;
    --spacing-lg: 4.5rem;
  }
  .portal-block h2 {
    font-size: 2rem;
  }
}

/* 768px (Tablets) */
@media (min-width: 768px) {
  :root {
    --spacing-md: 2.5rem;
    --spacing-lg: 5rem;
  }
  .portal-block h2 {
    font-size: 2.25rem; /* Locked Tablet Value */
  }
  .review-group dl {
    grid-template-columns: var(--spacing-xl) 1fr;
    gap: var(--spacing-sm);
  }
  .review-group dt {
    margin-top: 0;
    align-self: center;
  }
}

/* 1024px (Laptops / Small Desktop) */
@media (min-width: 1024px) {
  :root {
    --spacing-md: 3rem;
    --spacing-lg: 6rem;
    --spacing-xl: 10rem;
  }
  .portal-block h2 {
    font-size: 2.5rem; /* Locked Desktop Cap */
  }
}

/* 1280px (Standard Desktop Hierarchy Alignment) */
@media (min-width: 1280px) {
  .portal-block h2 {
    font-size: 2.5rem;
  }
}

/* 1440px (Wide Desktop Hierarchy Alignment) */
@media (min-width: 1440px) {
  :root {
    --spacing-md: 3.5rem;
    --spacing-lg: 7rem;
    --spacing-xl: 12rem;
  }
  .portal-block h2 {
    font-size: 2.5rem;
  }
}

/* 1600px+ (Ultra-Wide / Institutional Display Thresholds) */
@media (min-width: 1600px) {
  :root {
    --spacing-md: 4rem;
    --spacing-lg: 8rem;
    --spacing-xl: 14rem;
  }
  .portal-block h2 {
    font-size: 2.75rem; /* Ultra-Wide Lockout Limit */
  }
}

/* ==========================================================================
   11. ACCESSIBILITY OVERRIDES (REDUCED MOTION)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: scroll !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  
  .eq-bar {
    height: 9px !important;
    animation: none !important;
  }
}

/* ==========================================================================
   12. INSTITUTIONAL PRINT SPECIFICATION
   ========================================================================== */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  html, body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  video, 
  .hero-canvas-container, 
  .equaliser, 
  .prompt-overlay, 
  .block-navigation-actions, 
  .form-navigation-actions, 
  .skip-link, 
  .edit-stage-btn {
    display: none !important;
  }
  main {
    padding: 0 !important;
    background: #FFFFFF !important;
  }
  .portal-block, 
  .dossier-form-architecture {
    max-width: 100% !important;
    opacity: 1 !important;
  }
  .v-form-control {
    border-bottom: 1px solid #000000 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    color: #000000 !important;
    padding: var(--spacing-xs) 0 !important;
  }
}