/*
 * OrthoM8 — Page Template CSS
 * Shared page-level components for all /Orthom8/ pages.
 * Works alongside shared-nav.css which owns tokens, header, footer, buttons, typography.
 */

/* ═══════════════════════════════════════════════════
   FONT SHORTHANDS
═══════════════════════════════════════════════════ */
.serif { font-family: 'Playfair Display', serif; }
.mono  { font-family: 'IBM Plex Mono', monospace; }

/* ═══════════════════════════════════════════════════
   ALPINE CLOAK
═══════════════════════════════════════════════════ */
[x-cloak] { display: none !important; }

/* ═══════════════════════════════════════════════════
   CORNER DECORATIONS
═══════════════════════════════════════════════════ */
.corner-dec {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.corner-dec.tl { top: 0; left: 0; border-top: 1px solid var(--brand-cobalt); border-left: 1px solid var(--brand-cobalt); }
.corner-dec.tr { top: 0; right: 0; border-top: 1px solid var(--brand-cobalt); border-right: 1px solid var(--brand-cobalt); }
.corner-dec.bl { bottom: 0; left: 0; border-bottom: 1px solid var(--brand-cobalt); border-left: 1px solid var(--brand-cobalt); }
.corner-dec.br { bottom: 0; right: 0; border-bottom: 1px solid var(--brand-cobalt); border-right: 1px solid var(--brand-cobalt); }

/* ═══════════════════════════════════════════════════
   SPLIT SECTION — 2-col aligned layout
   ═══════════════════════════════════════════════════ */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: center;
}
@media (max-width: 1024px) {
  .split-section { grid-template-columns: 1fr; gap: 3rem; }
}

/* Specific grid for the-model page report section */
.model-report-grid {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: clamp(2rem, 5vw, 6rem);
}
@media (max-width: 1024px) {
  .model-report-grid { grid-template-columns: 1fr; gap: 3rem; }
  .model-report-grid > div:first-child { position: static !important; }
}

/* ═══════════════════════════════════════════════════
   PERFORMANCE GRID
   ═══════════════════════════════════════════════════ */
.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--brand-rule-strong);
}
.perf-card {
  background: var(--surface-bg);
  padding: clamp(1.5rem, 3vw, 3rem);
  transition: background 0.3s ease;
}
.perf-card:hover { background: var(--surface-2); }
@media (max-width: 768px) {
  .perf-grid { grid-template-columns: 1fr; gap: 1rem; background: transparent; }
  .perf-card { border: 1px solid var(--brand-rule-strong); }
}

/* ═══════════════════════════════════════════════════
   STATS RIBBON
   ═══════════════════════════════════════════════════ */
.stats-ribbon {
  display: flex;
  gap: 4rem;
  align-items: center;
}
.stats-ribbon .stat-divider {
  width: 1px;
  align-self: stretch;
  background: var(--brand-rule-strong);
}
@media (max-width: 640px) {
  .stats-ribbon { gap: 2rem; justify-content: space-between; }
  .stats-ribbon > div { flex: 1; }
}

/* ═══════════════════════════════════════════════════
   MARQUEE
═══════════════════════════════════════════════════ */
.marquee-track {
  display: flex;
  width: 200%;
  animation: marquee 30s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════
   HERO SPLIT LAYOUT (index page)
═══════════════════════════════════════════════════ */
#hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  min-height: 100vh;
  background: var(--page-bg);
  position: relative;
  overflow: hidden;
}
.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}
.hero-left {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6rem 5vw 4rem;
  border-right: 1px solid var(--brand-rule-strong);
  z-index: 10;
  position: relative;
  background: linear-gradient(to right, var(--page-bg), transparent);
}
.hero-left-content { max-width: 580px; width: 100%; }
.hero-right {
  background: #040812;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  z-index: 5;
}
.hero-cta-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 4.5rem;
}
.hero-heading-xl {
  font-size: clamp(2.8rem, 6vw, 5.5rem) !important;
  line-height: 0.95 !important;
  letter-spacing: -0.04em !important;
}
@media (max-width: 1024px) {
  #hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left {
    justify-content: center;
    padding: clamp(6rem,14vw,10rem) clamp(1.25rem,5vw,2rem) 3rem;
    border-right: none;
    border-bottom: 1px solid var(--brand-rule-strong);
  }
  .hero-right { padding: clamp(2.5rem,6vw,4rem) clamp(1.25rem,5vw,2rem); }
}
@media (max-width: 480px) {
  .hero-cta-row { gap: 0.75rem; margin-bottom: 2.5rem; }
  .hero-cta-row .btn-gold,
  .hero-cta-row .btn-ghost { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════
   TERMINAL WIDGET
═══════════════════════════════════════════════════ */
.pipeline-terminal {
  width: 100%;
  max-width: 620px;
  background: rgba(6, 9, 18, 0.95);
  border: 1px solid var(--brand-rule-strong);
  box-shadow: 0 50px 120px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}
@media (max-width: 640px) {
  .pipeline-terminal { margin: 0 -1rem; width: calc(100% + 2rem); border-left: none; border-right: none; }
}
.terminal-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
  filter: grayscale(1) brightness(0.5);
}
.terminal-content { position: relative; z-index: 10; }
.terminal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--brand-rule-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 19, 37, 0.4);
}
@media (max-width: 480px) {
  .terminal-header { padding: 1rem; }
  .terminal-title { font-size: 8px !important; }
}
.terminal-dots { display: flex; align-items: center; gap: 6px; }
.td-red   { width: 8px; height: 8px; border-radius: 50%; background: #FF5F57; }
.td-amber { width: 8px; height: 8px; border-radius: 50%; background: #FEBC2E; }
.td-green { width: 8px; height: 8px; border-radius: 50%; background: #28C840; }
.terminal-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--tx-sub);
}
.terminal-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #27C93F;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27C93F;
  animation: status-blink 2s ease-in-out infinite;
}
@keyframes status-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.pipeline-nodes {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
@media (max-width: 480px) {
  .pipeline-nodes { padding: 1.25rem; }
}
.pnode {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--brand-rule);
}
.pnode:last-child { border-bottom: none; }
.pnode-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--tx-muted);
  min-width: 24px;
}
.pnode-label {
  font-family: 'Fira Code', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--tx-sub);
  flex: 1;
}
.pnode-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-cobalt);
  animation: indicator-glow 2s ease-in-out infinite;
}
.pnode-indicator.gold  { background: var(--brand-gold-light); }
.pnode-indicator.green { background: #27C93F; }
@keyframes indicator-glow {
  0%,100% { box-shadow: 0 0 4px var(--brand-cobalt); }
  50%     { box-shadow: 0 0 12px var(--brand-cobalt); }
}
.pipeline-footer {
  background: rgba(0,0,0,0.4);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
@media (max-width: 480px) {
  .pipeline-footer { padding: 1.25rem 1rem; gap: 0.5rem; }
  .pf-val { font-size: 11px !important; }
  .pf-lbl { font-size: 7px !important; }
}
.pf-metric { text-align: center; }
.pf-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--tx-main);
  margin-bottom: 4px;
}
.pf-lbl {
  font-family: 'Fira Code', monospace;
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tx-muted);
}

/* ═══════════════════════════════════════════════════
   GLASS PANEL (model page / stat cards)
═══════════════════════════════════════════════════ */
.glass-panel {
  background: var(--surface-bg);
  border: 1px solid var(--brand-rule);
  transition: border-color 0.3s, background 0.3s;
}
.glass-panel:hover { border-color: var(--brand-cobalt); }

/* ═══════════════════════════════════════════════════
   TAB BUTTON (model page)
═══════════════════════════════════════════════════ */
.tab-btn {
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 1rem 1.25rem;
  border: 1px solid var(--brand-rule-strong);
  background: transparent;
  color: var(--tx-sub);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  width: 100%;
  text-align: left;
}
.tab-btn:hover { border-color: var(--brand-cobalt); color: var(--tx-main); }
.tab-btn.active { background: var(--brand-cobalt) !important; color: #fff !important; border-color: var(--brand-cobalt); }

.matrix-cell {
  border-bottom: 1px solid var(--brand-rule);
  transition: background 0.2s ease;
}
.matrix-cell:hover { background: rgba(26, 86, 255, 0.04); }

/* ═══════════════════════════════════════════════════
   STAT CARD (results page)
═══════════════════════════════════════════════════ */
.stat-card {
  background: var(--surface-bg);
  border: 1px solid var(--brand-rule);
  padding: clamp(1.25rem, 3vw, 2rem);
  transition: border-color 0.3s, background 0.3s;
}
.stat-card:hover { border-color: var(--brand-cobalt); }
@media (max-width: 480px) {
  .stat-card { padding: 1.25rem; }
}

/* ═══════════════════════════════════════════════════
   RESULTS TABLE
═══════════════════════════════════════════════════ */
.results-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.results-table th {
  text-align: left;
  padding: clamp(0.6rem, 2vw, 1rem);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--tx-muted);
  border-bottom: 1px solid var(--brand-rule);
  font-family: 'Fira Code', monospace;
}
.results-table td {
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(0.6rem, 2vw, 1rem);
  border-bottom: 1px solid var(--brand-rule);
  font-family: 'Fira Code', monospace;
  font-size: clamp(11px, 2vw, 13px);
  color: var(--tx-main);
}
.pos-val { color: #22C55E; }
.neg-val { color: #EF4444; }

/* ═══════════════════════════════════════════════════
   CONTACT SPLIT LAYOUT
═══════════════════════════════════════════════════ */
#contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 68px);
  margin-top: 68px;
}
.contact-form-side {
  padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4vw, 4rem);
  border-right: 1px solid var(--brand-rule-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--page-bg);
}
.contact-visual-side {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: hidden;
  background: var(--surface-bg);
}
.contact-visual-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.8) contrast(1.1);
}
.img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,86,255,0.15), transparent);
  z-index: 2;
  pointer-events: none;
}
.contact-card {
  background: var(--surface-bg);
  border: 1px solid var(--brand-rule-strong);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}
.contact-card:hover {
  border-color: var(--brand-cobalt);
  background: var(--surface-2);
}
@media (max-width: 1024px) {
  #contact-split { grid-template-columns: 1fr; }
  .contact-visual-side { display: none; }
  .contact-form-side { border-right: none; }
}

/* ═══════════════════════════════════════════════════
   TEAM PAGE — FOUNDER & DIRECTORS
═══════════════════════════════════════════════════ */
.hero-team {
  padding: clamp(8rem, 15vw, 12rem) 0 clamp(3rem, 6vw, 6rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.founder-section {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--brand-rule-strong);
}
.founder-img-wrap {
  position: relative;
  background: var(--surface-bg);
  border: 1px solid var(--brand-rule-strong);
  padding: 1.5rem;
}
.founder-img {
  width: 100%;
  height: auto;
  filter: saturate(0.6) contrast(1.1);
  display: block;
}
.directors-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: clamp(2rem, 5vw, 4rem);
}
.director-card {
  background: var(--surface-bg);
  border: 1px solid var(--brand-rule);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  transition: border-color 0.3s, background 0.3s;
}
.director-card:hover { border-color: var(--brand-cobalt); background: var(--surface-2); }
.director-portrait {
  width: 64px;
  height: 64px;
  background: var(--surface-2);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.director-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8);
}
.director-name {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-main);
  margin-bottom: 0.25rem;
}
.director-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-gold-light);
}
.signature {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--brand-gold-light);
  line-height: 1.6;
}
@media (max-width: 1024px) {
  .founder-section { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .directors-list  { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .director-card { flex-direction: column; text-align: center; gap: 1rem; }
}
