/* about-cinematic.css */
/* Full-screen cinematic "About" overlay — WebGL ocean + scroll story.
   Everything is scoped under #aboutCinematic so it never collides with
   the rest of the HPI platform's styles. */

@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Instrument+Serif:ital@0;1&family=DM+Mono:wght@300;400;500&display=swap");

#aboutCinematic {
  display: none;               /* toggled to 'block' by JS */
  position: fixed;
  inset: 0;
  z-index: 100000;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  /* ── Open/close transition ──
     Opacity-only fade. (A transform here would make this element the
     containing block for its position:fixed children — canvas, HUD,
     close button, theme toggle, scene dots — breaking their full-viewport
     positioning, which is why the ocean/sun disappeared.) */
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(.2,.7,.3,1);
  will-change: opacity;

  /* ── Theme tokens (dark default) ── */
  --ac-bg: #0a0a0f;
  --ac-fg: #e8e4d9;
  --ac-muted: #6a6a7e;
  --ac-accent: #4fc3f7;
  --ac-card-bg: rgba(10, 10, 15, 0.32);
  --ac-card-border: rgba(79, 195, 247, 0.18);

  background: var(--ac-bg);
  color: var(--ac-fg);
  font-family: 'DM Mono', monospace;
}

#aboutCinematic.ac-visible {
  opacity: 1;
}

#aboutCinematic[data-theme="light"] {
  --ac-bg: #eef4ff;
  --ac-fg: #0b141a;
  --ac-muted: #6c8296;
  --ac-accent: #1b7ed6;
  --ac-card-bg: rgba(245, 249, 255, 0.86);
  --ac-card-border: rgba(27, 126, 214, 0.22);
}

#aboutCinematic * { box-sizing: border-box; }

/* ── WebGL canvas ── */
#ac-ocean {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ── Close button ── */
.ac-close-btn {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 50;
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ac-muted) 35%, transparent);
  color: var(--ac-fg);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
  backdrop-filter: blur(6px);
}
.ac-close-btn:hover {
  background: color-mix(in srgb, var(--ac-muted) 55%, transparent);
  transform: scale(1.08);
}

/* ── HUD (top-right progress) ── */
#ac-hud {
  position: fixed;
  top: 22px;
  right: 74px;
  z-index: 10;
  text-align: right;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--ac-muted);
  text-transform: uppercase;
}
#ac-hud .ac-progress-bar {
  width: 7.5rem;
  height: 1px;
  background: var(--ac-muted);
  margin-block-start: 0.5rem;
  margin-inline-start: auto;
  position: relative;
  overflow: hidden;
}
#ac-hud .ac-progress-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0%;
  background: var(--ac-accent);
  transition: width 0.1s linear;
}
#ac-hud .ac-scene-label {
  font-size: 0.6rem;
  color: var(--ac-accent);
  margin-block-start: 0.4rem;
}

/* ── Scene dots ── */
#ac-scene-strip {
  position: fixed;
  left: 2.125rem;
  top: 50%;
  translate: -50% -50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ac-scene-dot {
  width: 0.25rem; height: 0.25rem;
  border-radius: 50%;
  background: var(--ac-muted);
  transition: background 0.3s, scale 0.3s;
}
.ac-scene-dot.active {
  background: var(--ac-accent);
  scale: 1.8;
}

/* ── Theme toggle ── */
#ac-theme-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2.125rem;
  translate: -50% 0;
  z-index: 10;
  width: 2rem; height: 2rem;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ac-muted) 35%, transparent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
#ac-theme-toggle:hover { background: color-mix(in srgb, var(--ac-muted) 55%, transparent); }
#ac-theme-toggle svg {
  width: 0.875rem; height: 0.875rem;
  position: absolute;
  transition: opacity 0.3s ease, rotate 0.3s ease;
  color: var(--ac-accent);
}
#aboutCinematic[data-theme="light"] #ac-theme-toggle svg { color: var(--ac-fg); }
#ac-theme-toggle .ac-icon-sun  { opacity: 1; rotate: 0deg; }
#ac-theme-toggle .ac-icon-moon { opacity: 0; rotate: 90deg; }
#aboutCinematic[data-theme="light"] #ac-theme-toggle .ac-icon-sun  { opacity: 0; rotate: -90deg; }
#aboutCinematic[data-theme="light"] #ac-theme-toggle .ac-icon-moon { opacity: 1; rotate: 0deg; }

/* ── Scroll container ── */
#ac-scroll-container {
  position: relative;
  z-index: 1;
}

.ac-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 5rem;
}

/* ── Text cards ── */
.ac-text-card {
  max-width: 23.75rem;
  padding: 2.25rem 2rem;
  background: var(--ac-card-bg);
  border-left: 1px solid var(--ac-card-border);
  border-radius: 0.875rem;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border: 1px solid var(--ac-card-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.ac-text-card.right {
  margin-inline-start: auto;
  text-align: right;
}
.ac-text-card.center {
  margin-inline: auto;
  text-align: center;
  max-width: 28.75rem;
}

.ac-tag {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ac-accent);
  margin-block-end: 1.1rem;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease, translate 0.5s ease;
}
.ac-tag.visible { opacity: 1; translate: 0 0; }

#aboutCinematic :is(h1, h2) {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 0.92;
  opacity: 0;
  translate: 0 1.125rem;
  transition: opacity 0.5s ease 0.08s, translate 0.5s ease 0.08s;
  color: var(--ac-fg);
}
#aboutCinematic :is(h1, h2).visible { opacity: 1; translate: 0 0; }
#aboutCinematic h1 { font-size: clamp(3rem, 8vw, 6.5rem); }
#aboutCinematic h2 { font-size: clamp(2.2rem, 6vw, 5rem); }

.ac-body-text {
  font-size: 0.78rem;
  line-height: 1.8;
  color: color-mix(in srgb, var(--ac-fg) 65%, transparent);
  margin-block-start: 1.25rem;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease 0.2s, translate 0.5s ease 0.2s;
}
.ac-body-text.visible { opacity: 1; translate: 0 0; }
.ac-body-text a { color: var(--ac-accent); text-decoration: none; }

.ac-stat-row {
  display: flex;
  gap: 2.5rem;
  margin-block-start: 2rem;
  flex-wrap: wrap;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease 0.3s, translate 0.5s ease 0.3s;
}
.ac-stat-row.visible { opacity: 1; translate: 0 0; }
.ac-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.ac-stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: var(--ac-accent);
  line-height: 1;
}
.ac-stat-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ac-muted);
}

.ac-h-line {
  width: 3.125rem; height: 1px;
  background: var(--ac-accent);
  margin-block-end: 1.2rem;
  opacity: 0;
  scale: 0 1;
  transform-origin: left;
  transition: opacity 0.4s ease, scale 0.4s ease;
}
.ac-h-line.visible { opacity: 1; scale: 1 1; }
.ac-text-card.right .ac-h-line { transform-origin: right; margin-inline-start: auto; }
.ac-text-card.center .ac-h-line { transform-origin: center; margin-inline: auto; }

.ac-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-block-start: 1.75rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--ac-accent);
  color: var(--ac-accent);
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease 0.35s, translate 0.5s ease 0.35s, background 0.2s, color 0.2s;
}
.ac-cta.visible { opacity: 1; translate: 0 0; }
.ac-cta:hover { background: var(--ac-accent); color: var(--ac-bg); }
.ac-cta svg { width: 0.6875rem; height: 0.6875rem; }

/* ── Team group label (role category above each team member) ── */
.ac-team-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ac-accent);
  margin-block-start: 1.4rem;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease 0.2s, translate 0.5s ease 0.2s;
}
.ac-team-group-label.visible { opacity: 1; translate: 0 0; }
.ac-team-group-label:first-of-type { margin-block-start: 1.1rem; }
.ac-text-card.right .ac-team-group-label { text-align: right; }

/* ── Team profile rows (section 1) ── */
.ac-team-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-block-start: 1.1rem;
  opacity: 0;
  translate: 0 0.625rem;
  transition: opacity 0.5s ease 0.25s, translate 0.5s ease 0.25s;
}
.ac-team-row.visible { opacity: 1; translate: 0 0; }
.text-card.right .ac-team-row,
.ac-text-card.right .ac-team-row { flex-direction: row-reverse; }
.ac-team-photo {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ac-accent);
  flex-shrink: 0;
}
.ac-team-name { font-size: 0.82rem; font-weight: 700; color: var(--ac-fg); }
.ac-team-role { font-size: 0.62rem; color: var(--ac-muted); margin-top: 2px; }
.ac-team-link { font-size: 0.6rem; color: var(--ac-accent); text-decoration: none; }

/* ════════════════════════════════════════════════════════════════════════
   DOC SECTION (final section) — readable document, not cinematic type
═══════════════════════════════════════════════════════════════════════════ */
.ac-doc-section {
  display: block;
  padding: 4rem 5vw 6rem;
  align-items: initial;
  min-height: auto;
}
.ac-doc-card {
  max-width: 56rem;
  margin: 0 auto;
  background: var(--ac-card-bg);
  border: 1px solid var(--ac-card-border);
  border-radius: 0.875rem;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  padding: 2.5rem 2.5rem 3rem;
}
.ac-doc-card h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ac-accent);
  margin: 2.2rem 0 0.8rem;
  letter-spacing: 0.02em;
}
.ac-doc-card h3:first-child { margin-top: 0; }
.ac-doc-card h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ac-fg);
  margin: 1.2rem 0 0.4rem;
}
.ac-doc-card p, .ac-doc-card li {
  font-size: 0.8rem;
  line-height: 1.9;
  color: color-mix(in srgb, var(--ac-fg) 70%, transparent);
  margin-bottom: 0.6rem;
}
.ac-doc-card ul { padding-left: 1.2rem; margin-bottom: 0.6rem; }
.ac-doc-card a { color: var(--ac-accent); text-decoration: none; }
.ac-doc-card a:hover { text-decoration: underline; }
.ac-doc-card .ac-citation {
  font-style: italic;
  background: color-mix(in srgb, var(--ac-fg) 6%, transparent);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-size: 0.78rem;
  line-height: 1.8;
}
.ac-doc-card .ac-doc-top-tag {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ac-accent);
  margin-bottom: 1rem;
}
.ac-doc-card hr {
  border: none;
  border-top: 1px solid var(--ac-card-border);
  margin: 1.6rem 0;
}

/* ── Credit / footer line ── */
.ac-credit {
  position: fixed;
  right: 1.5rem;
  bottom: 1.2rem;
  z-index: 10;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--ac-muted);
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 60em) {
  .ac-section { padding: 5rem 3rem; }
  .ac-text-card { max-width: 20rem; }
}

@media (max-width: 37.5em) {
  .ac-section { padding: 4rem 1.25rem; }
  .ac-text-card { max-width: 100%; }
  .ac-text-card:is(.right, .center) { margin-inline: 0; text-align: left; }
  .ac-text-card:is(.right, .center) .ac-h-line { transform-origin: left; margin-inline-start: 0; margin-inline: 0; }
  .text-card.right .ac-team-row, .ac-text-card.right .ac-team-row { flex-direction: row; }
  #ac-hud { top: 1rem; right: 64px; }
  #ac-scene-strip { display: none; }
  #ac-theme-toggle { bottom: 1rem; left: 1.25rem; translate: 0 0; }
  .ac-close-btn { top: 1rem; right: 1rem; }
  .ac-doc-card { padding: 1.5rem 1.25rem 2rem; }
  .ac-stat-row { gap: 1.5rem; }
}
