/* ═══════════════════════════════════════════════════════════════
   110021 — THE CODE
   Monochrome editorial with warm gold accent (#C8A44E)
   Single-viewport experience with AJAX page transitions
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────────────── */

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-card: #151515;
  --bg-input: #1A1A1A;

  --text-primary: #F0EDE8;
  --text-secondary: #8A8580;
  --text-muted: #5A5550;

  --accent: #C8A44E;
  --accent-hover: #D4B35A;
  --accent-glow: rgba(200, 164, 78, 0.25);
  --accent-subtle: rgba(200, 164, 78, 0.08);

  --border: #222222;
  --border-light: #2A2A2A;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --header-h: 60px;
  --tabs-h: 56px;
  --viewport-pad: clamp(16px, 3vw, 40px);
}

/* ─── Reset & Base ──────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* ─── Viewport Container ───────────────────────────────────── */

.viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Header ────────────────────────────────────────────────── */

.site-header {
  height: var(--header-h);
  padding: 0 var(--viewport-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.3s;
}

.brand-logo:hover {
  opacity: 0.7;
}

.brand-digits {
  display: inline-flex;
  gap: 2px;
  perspective: 600px;
}

.digit {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--text-primary);
  display: inline-block;
  letter-spacing: 0.05em;
}

.header-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─── Main Content ──────────────────────────────────────────── */

.main-content {
  flex: 1;
  overflow: hidden;
  padding: var(--viewport-pad);
  display: flex;
  align-items: stretch;
}

/* ─── Bottom Tabs Navigation ────────────────────────────────── */

.bottom-tabs {
  height: var(--tabs-h);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.tab-link:last-child {
  border-right: none;
}

.tab-link:hover {
  background-color: var(--accent-subtle);
  color: var(--text-secondary);
}

.tab-link.active {
  color: var(--accent);
  background-color: var(--accent-subtle);
}

.tab-link.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.tab-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.tab-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── WhatsApp Float ────────────────────────────────────────── */

.whatsapp-float {
  position: fixed;
  bottom: calc(var(--tabs-h) + 20px);
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: wa-pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6), 0 0 0 8px rgba(37, 211, 102, 0.1); }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE: THE ACADEMY (index.html)
   ═══════════════════════════════════════════════════════════════ */

.academy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 60px);
  width: 100%;
  align-items: center;
}

.academy-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: clamp(0px, 2vw, 40px);
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 80px);
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 24px;
}

.headline-word {
  display: block;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.headline-accent {
  color: var(--accent);
}

.hero-divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 20px;
}

.hero-tagline {
  font-size: clamp(14px, 1.2vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 32px;
  font-weight: 300;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 12px 0;
  border-bottom: 1px solid var(--accent);
  transition: gap 0.3s, color 0.3s;
  width: fit-content;
}

.cta-link:hover {
  gap: 20px;
  color: var(--accent-hover);
}

.cta-arrow {
  font-size: 18px;
  transition: transform 0.3s;
}

.cta-link:hover .cta-arrow {
  transform: translateX(4px);
}

/* Academy Image */

.academy-image {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.6s ease;
}

.image-frame:hover img {
  filter: grayscale(50%) contrast(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200, 164, 78, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.image-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE: PROGRAMS (programs.html)
   ═══════════════════════════════════════════════════════════════ */

.programs-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: clamp(16px, 2vw, 28px);
  overflow: hidden;
}

.programs-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  flex-shrink: 0;
}

.programs-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.programs-statement {
  font-size: clamp(12px, 1vw, 15px);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
  font-weight: 300;
  text-align: right;
}

.programs-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(12px, 1.5vw, 20px);
  flex: 1;
  min-height: 0;
}

.program-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.program-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px var(--accent-subtle);
}

.card-image {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 0.5s, transform 0.5s;
}

.program-card:hover .card-image img {
  filter: grayscale(60%);
  transform: scale(1.04);
}

.card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 50%);
  pointer-events: none;
}

.card-content {
  padding: clamp(12px, 1.5vw, 20px);
  flex-shrink: 0;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.2;
}

.card-desc {
  font-size: clamp(11px, 0.9vw, 13px);
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 300;
}

/* Knowledge Pulse — golden border pulse on hover */

.card-pulse {
  position: absolute;
  inset: -2px;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.program-card:hover .card-pulse {
  opacity: 1;
  animation: knowledge-pulse 1.5s ease-out infinite;
}

@keyframes knowledge-pulse {
  0% {
    inset: -2px;
    opacity: 1;
  }
  100% {
    inset: -14px;
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE: THE METHOD (method.html)
   ═══════════════════════════════════════════════════════════════ */

.method-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 60px);
  width: 100%;
  align-items: start;
  overflow-y: auto;
}

.method-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  height: 100%;
}

.method-counter-wrap {
  margin-bottom: 4px;
}

.method-counter {
  font-family: var(--font-mono);
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: inline-block;
  line-height: 1;
}

.method-quote {
  position: relative;
  padding: 0;
  margin-bottom: 8px;
}

.method-quote .quote-mark {
  font-family: var(--font-display);
  font-size: clamp(32px, 3vw, 48px);
  color: var(--accent);
  line-height: 0;
  vertical-align: -0.3em;
  opacity: 0.5;
}

.method-quote {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.4;
  color: var(--text-primary);
  font-style: italic;
}

.method-body p {
  font-size: clamp(13px, 1vw, 15px);
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 12px;
}

.method-body p:last-child {
  margin-bottom: 0;
}

.method-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.method-image {
  position: relative;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.method-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.5s;
}

.method-image:hover img {
  filter: grayscale(40%) contrast(1.05);
}

.method-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg-primary) 100%);
  pointer-events: none;
}

.method-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.stat {
  flex: 1;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE: CONNECT (connect.html)
   ═══════════════════════════════════════════════════════════════ */

.connect-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 60px);
  width: 100%;
  align-items: start;
  overflow-y: auto;
}

.connect-form-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.connect-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.connect-subtitle {
  font-size: clamp(13px, 1vw, 15px);
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 300;
  line-height: 1.6;
  max-width: 420px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 160px;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  transition: background-color 0.3s, gap 0.3s;
  width: fit-content;
}

.form-submit:hover {
  background: var(--accent-hover);
  gap: 16px;
}

.submit-arrow {
  font-size: 16px;
  transition: transform 0.3s;
}

.form-submit:hover .submit-arrow {
  transform: translateX(3px);
}

/* Thank You State */

.form-thanks {
  text-align: center;
  padding: 40px 20px;
}

.thanks-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 24px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.thanks-title {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 12px;
}

.thanks-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  max-width: 380px;
  margin: 0 auto 20px;
  font-weight: 300;
}

.thanks-wa {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #25D366;
  border-bottom: 1px solid #25D366;
  padding-bottom: 2px;
  transition: opacity 0.3s;
}

.thanks-wa:hover {
  opacity: 0.7;
}

/* Connect Info Area */

.connect-info-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.connect-map {
  flex: 1;
  min-height: 200px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.connect-map iframe {
  filter: grayscale(100%) invert(92%) contrast(0.85);
}

.connect-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.detail-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 70px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-link {
  transition: color 0.3s;
}

.detail-link:hover {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   VIEW TRANSITIONS
   ═══════════════════════════════════════════════════════════════ */

::view-transition-old(brand-logo),
::view-transition-new(brand-logo) {
  animation-duration: 0.3s;
}

::view-transition-old(bottom-tabs),
::view-transition-new(bottom-tabs) {
  animation-duration: 0.25s;
}

::view-transition-old(root) {
  animation: fade-out 0.25s ease-in;
}

::view-transition-new(root) {
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE: MOBILE (< 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --header-h: 50px;
    --tabs-h: 52px;
  }

  body {
    overflow-y: auto;
  }

  .viewport {
    height: auto;
    min-height: 100vh;
  }

  .main-content {
    overflow: visible;
    min-height: calc(100vh - var(--header-h) - var(--tabs-h));
  }

  .bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
  }

  .tab-index {
    display: none;
  }

  .tab-label {
    font-size: 10px;
  }

  .whatsapp-float {
    bottom: calc(var(--tabs-h) + 12px);
    right: 12px;
    width: 46px;
    height: 46px;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }

  /* Academy Mobile */
  .academy-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .academy-text {
    padding-right: 0;
    order: 1;
  }

  .academy-image {
    order: 0;
  }

  .hero-headline {
    font-size: 36px;
  }

  .image-frame {
    aspect-ratio: 16 / 9;
  }

  /* Programs Mobile */
  .programs-header {
    flex-direction: column;
    gap: 8px;
  }

  .programs-statement {
    text-align: left;
    max-width: none;
  }

  .programs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-image {
    max-height: 180px;
  }

  /* Method Mobile */
  .method-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .method-counter {
    font-size: 42px;
  }

  .method-stats {
    flex-direction: column;
    gap: 12px;
  }

  /* Connect Mobile */
  .connect-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: calc(var(--tabs-h) + 20px);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .connect-map {
    min-height: 200px;
  }
}

/* ─── Small Mobile (< 400px) ────────────────────────────────── */

@media (max-width: 400px) {
  .hero-headline {
    font-size: 30px;
  }

  .method-quote {
    font-size: 16px;
  }

  .programs-title {
    font-size: 24px;
  }

  .connect-title {
    font-size: 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

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

  .whatsapp-float {
    animation: none;
  }

  .program-card:hover .card-pulse {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LARGE SCREENS (> 1400px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1400px) {
  .main-content {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* ─── Focus States (accessibility) ──────────────────────────── */

.tab-link:focus-visible,
.nav-link:focus-visible,
.form-input:focus-visible,
.form-submit:focus-visible,
.whatsapp-float:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Selection ─────────────────────────────────────────────── */

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

::-moz-selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ─── Scrollbar (for mobile overflow) ───────────────────────── */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
