/* =====================================================
   Marcos Garcia — "Look Through the Window" section
   Head-tracked 3D window (webcam / mouse / phone tilt)
   ===================================================== */

.portal-section {
  position: relative;
  padding: clamp(64px, 9vw, 120px) 0 clamp(70px, 9vw, 120px);
  background: transparent;
  color: var(--ivory, #f5f0e4);
}

.portal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 48px;
  margin-bottom: clamp(26px, 4vw, 40px);
}

.portal-head .section-title {
  margin: 0 0 12px;
}

.portal-lede {
  max-width: 620px;
  margin: 0;
  color: var(--ivory-muted, rgba(245, 240, 228, 0.72));
  font-size: 1rem;
  line-height: 1.75;
}

.portal-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid rgba(201, 162, 39, 0.65);
  background: rgba(201, 162, 39, 0.08);
  color: #f3e3b5;
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.portal-btn:hover {
  background: #c9a227;
  color: #10141a;
  transform: translateY(-2px);
}

.portal-btn[aria-pressed="true"] {
  background: rgba(95, 184, 163, 0.14);
  border-color: rgba(95, 184, 163, 0.75);
  color: #bfeee2;
}

.portal-btn .portal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.portal-btn[aria-pressed="true"] .portal-dot {
  background: #5fb8a3;
  box-shadow: 0 0 10px #5fb8a3;
  animation: portal-live 1.6s ease-in-out infinite;
}

.portal-status {
  margin: 0;
  max-width: 300px;
  text-align: right;
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 0.66rem;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 228, 0.55);
}

/* The "window" itself */
.portal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  padding: 10px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: rgba(5, 7, 13, 0.85);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(95, 184, 163, 0.08),
    inset 0 0 0 1px rgba(201, 162, 39, 0.12);
}

.portal-frame::before,
.portal-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #c9a227;
  border-style: solid;
  pointer-events: none;
}
.portal-frame::before { top: -6px; left: -6px; border-width: 2px 0 0 2px; }
.portal-frame::after  { bottom: -6px; right: -6px; border-width: 0 2px 2px 0; }

.portal-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #121a2b 0%, #05070d 70%);
}

.portal-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: pan-y;
}

.portal-hint {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  margin: 0;
  padding: 7px 12px;
  background: rgba(5, 7, 13, 0.6);
  border: 1px solid rgba(245, 240, 228, 0.14);
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 240, 228, 0.75);
  pointer-events: none;
  transition: opacity 600ms ease;
}

.portal-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 228, 0.7);
}
.portal-canvas-wrap.no-webgl .portal-fallback { display: grid; }

.portal-privacy {
  margin: 14px 0 0;
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 228, 0.45);
}

@keyframes portal-live {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 760px) {
  .portal-head {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .portal-lede { margin: 0 auto; }
  .portal-controls { align-items: center; }
  .portal-status { text-align: center; }
  .portal-frame {
    aspect-ratio: 4 / 5;
    max-height: none;
    padding: 6px;
  }
  .portal-privacy { text-align: center; }
}
