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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.state {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.state.active {
  opacity: 1;
  pointer-events: auto;
}

#state-still    { z-index: 1; }
#state-video    { z-index: 2; }
#state-terminal { z-index: 3; }

#state-still img,
#state-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.002);
}

/* ── CRT Screen ──────────────────────────────────────────── */

#crt-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0000AA;
  font-family: 'VT323', monospace;
  font-size: clamp(20px, 2.2vw, 30px);
  color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scanlines */
#crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.25) 2px,
    rgba(0, 0, 0, 0.25) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* Terminal content area */
#terminal-content {
  position: relative;
  z-index: 5;
  padding: clamp(20px, 3vw, 36px) clamp(56px, 9vw, 130px) clamp(40px, 6vw, 80px);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.95),
    0 0 8px rgba(200, 220, 255, 0.7),
    0 0 20px rgba(160, 190, 255, 0.3);
  line-height: 1.75;
  white-space: pre-wrap;
  scrollbar-width: none; /* Firefox */
  max-width: 860px;
}

#terminal-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Blinking block cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: #ffffff;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 14px rgba(200, 220, 255, 0.5);
}

/* Clickable menu items */
.menu-item {
  cursor: pointer;
  display: inline-block;
  padding: 0.3em 0.5em;
  transition: background 0.1s, color 0.1s;
}

button.menu-item {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: inherit;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  outline: none;
}

button.menu-item.menu-item--active {
  background: #ffffff;
  color: #0000AA;
  text-shadow: none;
}

.menu-item--active {
  background: #ffffff;
  color: #0000AA;
  text-shadow: none;
}

@media (hover: hover) {
  button.menu-item:hover {
    background: #ffffff;
    color: #0000AA;
    text-shadow: none;
  }

  .menu-item:hover {
    background: #ffffff;
    color: #0000AA;
    text-shadow: none;
  }
}

/* Form inputs */
select.terminal-input {
  background: #0000AA;
  cursor: pointer;
}

select.terminal-input option {
  background: #ffffff;
  color: #0000AA;
  text-shadow: none;
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'VT323', monospace;
  font-size: inherit;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  width: 60%;
  caret-color: #ffffff;
  caret-shape: block;
}

.terminal-textarea {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'VT323', monospace;
  font-size: inherit;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  width: 80%;
  resize: none;
  caret-color: #ffffff;
  caret-shape: block;
  vertical-align: top;
}

.terminal-input::placeholder,
.terminal-textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
  text-shadow: none;
}

/* Buttons (back, send) */
.terminal-btn {
  cursor: pointer;
  display: inline-block;
  margin-top: 1.5em;
  padding: 0.2em 0.8em;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: inherit;
  background: transparent;
  min-height: 44px;
  min-width: 80px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  transition: background 0.1s, color 0.1s, text-shadow 0.1s;
}

@media (hover: hover) {
  .terminal-btn:hover {
    background: #ffffff;
    color: #0000AA;
    text-shadow: none;
  }
}

/* Footer — always-visible WhatsApp link */
.terminal-footer {
  position: absolute;
  bottom: clamp(16px, 3vw, 32px);
  left: clamp(24px, 5vw, 64px);
  z-index: 5;
  opacity: 0.6;
  font-size: 0.85em;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  pointer-events: auto;
}

.terminal-footer a {
  color: #ffffff;
  text-decoration: underline;
}

@media (hover: hover) {
  .terminal-footer a:hover {
    text-decoration: underline;
  }
}

.terminal-link {
  color: inherit;
  text-decoration: underline;
}

/* Apply page — sticky action bar */
.apply-sticky-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  gap: 0.5em;
  padding: clamp(12px, 2vw, 20px) clamp(56px, 9vw, 130px);
  background: #0000AA;
}

.terminal-footer-inline-wrap {
  display: flex;
  align-items: center;
  margin-left: 1.5em;
  opacity: 0.6;
  font-size: 0.85em;
}

.terminal-footer-inline {
  color: #ffffff;
  text-decoration: underline;
  margin-left: 0.3em;
}

/* FAQ accordion */
.faq-question {
  cursor: pointer;
  padding: 0.3em 0;
  margin-top: 0.3em;
}

@media (hover: hover) {
  .faq-question:hover {
    text-decoration: underline;
  }
}

.faq-answer {
  padding: 0.3em 0 0.8em 1.5em;
  opacity: 0.85;
  white-space: pre-line;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.3em;
  line-height: 1.4;
}

/* ── The Program section ─────────────────────────────────── */
.program-core-item {
  margin-top: 0.3em;
}

.program-core-label {
  padding: 0.3em 0;
}

.program-core-text {
  padding: 0.3em 0 0.6em 1.5em;
  opacity: 0.85;
  white-space: pre-line;
  line-height: 1.4;
}

.program-separator {
  margin: 1.4em 0 0.5em;
  opacity: 0.18;
  letter-spacing: 0;
}

.program-fine-print-header {
  opacity: 1;
  margin-bottom: 0.8em;
  font-size: 0.9em;
  letter-spacing: 0.12em;
}

/* ── Terminal header bar (logo container, sticky above scroll) ── */

#terminal-header {
  flex-shrink: 0;
  background: #0000AA;
  padding: clamp(14px, 2.2vw, 24px) clamp(24px, 4vw, 56px) clamp(8px, 1.2vw, 14px);
  z-index: 7;
}

#terminal-ember-logo {
  display: block;
  height: clamp(32px, 4vw, 52px);
  width: auto;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

@media (max-width: 600px) {
  #terminal-header {
    padding: 10px 0 8px 14px;
  }

  #terminal-ember-logo {
    height: 20px;
  }
}

/* ── Secondary menu item (partner) ──────────────────────── */

.menu-item--secondary {
  opacity: 0.5;
  font-size: 0.85em;
  padding: 0.3em 0.5em;
  display: block;
}

.menu-item--secondary a {
  color: #ffffff;
  text-decoration: underline;
}

@media (hover: hover) {
  .menu-item--secondary:hover {
    opacity: 1;
  }
}

/* ── Enter CTA ───────────────────────────────────────────── */

#enter-cta {
  position: absolute;
  bottom: 75%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.15em;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  animation: cta-fadein 1s ease-out 1.5s forwards;
  user-select: none;
  white-space: nowrap;
}

@media (hover: hover) {
  #enter-cta:hover {
    color: #ffffff;
  }
}

@keyframes cta-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.manifesto-view > div {
  white-space: nowrap;
}

/* ── Desktop CTA override ────────────────────────────────── */

@media (min-width: 601px) {
  #enter-cta {
    bottom: 87%;
    color: rgba(255, 255, 255, 0.85);
  }

  @media (hover: hover) {
    #enter-cta:hover {
      color: #ffffff;
    }
  }
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .manifesto-view > div {
    white-space: normal;
  }

  #terminal-content {
    font-size: 18px;
    padding: 16px 16px 20px;
    /* Explicit scroll ensures keyboard-resize doesn't collapse the area */
    overflow-y: scroll;
  }

  .terminal-input,
  .terminal-textarea {
    width: 100%;
    font-size: 18px; /* also prevents iOS auto-zoom (≥16px required) */
  }

  .menu-item {
    display: block;
    min-height: 44px;   /* Apple HIG minimum tap target */
    line-height: 44px;
    padding: 0 0.3em;
  }

  .faq-question {
    min-height: 44px;
    display: block;
    line-height: 44px;
  }

  .terminal-btn {
    min-height: 44px;
    padding: 0 1em;
    margin-top: 1em;
    margin-right: 0.5em;
  }

  .terminal-footer {
    font-size: 14px;
    /* Align footer left edge with content padding */
    left: 16px;
    bottom: 16px;
  }
}
