/* ==========================================================================
   MBAI Main Website Stylesheet
   Design System: Executive Terminal (White Canvas, Black Ink, Phosphor Green)
   Fonts: IBM Plex Mono (Headings/Highlights), Courier Prime (Content/Body)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Core Tokens */
  --mbai-bg: #FFFFFF;
  --mbai-ink: #000000;
  --mbai-border: #000000;
  --mbai-border-subtle: #E5E5E5;
  --mbai-muted: #555555;
  --mbai-phosphor: #33FF33;
  --mbai-phosphor-glow: 0 0 12px rgba(51, 255, 51, 0.5);
  --mbai-focus-ring: 0 0 0 2px #000000, 0 0 0 4px #33FF33;

  /* Typography */
  --font-heading: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-highlight: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-body: 'Courier Prime', ui-monospace, SFMono-Regular, Courier, monospace;

  /* Layout */
  --container-max-width: 820px;
}

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

html {
  background-color: var(--mbai-bg);
  color: var(--mbai-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--mbai-bg);
  color: var(--mbai-ink);
  overflow-x: hidden;
}

/* ==========================================================================
   Intro Screen Animation (4.0s Exact Specification)
   - 0s - 2s: Types 'MBai' (2 chars/sec)
   - 2s - 4s: Cursor blinking at 2 Hz
   - 4s: Transition to main holding site
   ========================================================================== */

#intro-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}

#intro-view.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-terminal {
  font-family: var(--font-heading);
  font-size: clamp(38px, 8vw, 76px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000000;
  display: flex;
  align-items: baseline;
  user-select: none;
}

.intro-cursor {
  display: inline-block;
  color: var(--mbai-phosphor);
  margin-left: 2px;
}

/* 2 Hz Cursor Blink: 500ms period (250ms on / 250ms off) */
.cursor-blink-2hz {
  animation: blink2Hz 0.5s infinite steps(1, start);
}

@keyframes blink2Hz {
  0%, 49.9% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(51, 255, 51, 0.7));
  }
  50%, 100% {
    opacity: 0;
    filter: none;
  }
}

/* ==========================================================================
   Main Holding Page
   ========================================================================== */

#main-view {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-view.visible {
  opacity: 1;
  visibility: visible;
}

.site-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 48px 24px 72px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header & Brand */
header.site-header {
  padding-bottom: 36px;
  border-bottom: 2px solid var(--mbai-border);
  margin-bottom: 40px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-logo {
  display: inline-block;
  text-decoration: none;
}

.brand-logo svg {
  height: 64px;
  width: auto;
  display: block;
}

.nav-link-styleguide {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #000000;
  text-decoration: none;
  border: 1px solid #000000;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.nav-link-styleguide:hover {
  background-color: #000000;
  color: var(--mbai-phosphor);
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.3);
}

/* Main Content Area */
main.site-content {
  flex: 1;
}

.subheading-kicker {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(18px, 3.5vw, 24px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.subheading-kicker::before {
  content: '>';
  color: var(--mbai-phosphor);
  font-weight: 700;
}

.content-body {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.75;
  color: #000000;
  margin-bottom: 48px;
  max-width: 760px;
}

/* Action Section */
.actions-card {
  border: 2px solid var(--mbai-border);
  padding: 32px;
  border-radius: 6px;
  margin-bottom: 48px;
  background-color: #FFFFFF;
}

.actions-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Email Form */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

@media (min-width: 600px) {
  .email-form {
    flex-direction: row;
  }
}

.email-input-wrapper {
  flex: 1;
  position: relative;
}

.email-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px;
  color: #000000;
  background-color: #FFFFFF;
  border: 1.5px solid #000000;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s ease;
}

.email-input::placeholder {
  color: #767676;
}

.email-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000, 0 0 10px rgba(51, 255, 51, 0.55);
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--mbai-focus-ring);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: #000000;
  border: 1.5px solid #000000;
}

.btn-secondary:hover {
  background-color: #000000;
  color: var(--mbai-phosphor);
  border-color: #000000;
  box-shadow: 0 0 12px rgba(51, 255, 51, 0.35);
}

.form-feedback {
  font-family: var(--font-heading);
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.form-feedback.success {
  color: #000000;
  background: var(--mbai-phosphor);
  display: inline-block;
  padding: 2px 8px;
  font-weight: 600;
}

.form-feedback.error {
  color: #D32F2F;
  font-weight: 600;
}

/* Student Login Divider & Button */
.student-login-section {
  padding-top: 24px;
  border-top: 1px dashed var(--mbai-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.student-login-desc {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--mbai-muted);
}

.btn-primary {
  background-color: #000000;
  color: #FFFFFF;
  border: 2px solid #000000;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 28px;
}

.btn-primary:hover {
  background-color: #000000;
  color: var(--mbai-phosphor);
  border-color: var(--mbai-phosphor);
  box-shadow: 0 0 18px rgba(51, 255, 51, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Hyperlinks */
a.text-link {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: background-color 0.15s ease;
}

a.text-link:hover {
  background-color: var(--mbai-phosphor);
  text-decoration: none;
}

/* Footer */
footer.site-footer {
  padding-top: 32px;
  border-top: 1px solid var(--mbai-border-subtle);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 13px;
  color: #767676;
}

.footer-legal {
  color: #767676;
}

.footer-link {
  color: #767676;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.15s ease;
}

.footer-link:hover {
  color: #000000;
  background-color: var(--mbai-phosphor);
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .site-container {
    padding: 32px 18px 48px;
  }
  .actions-card {
    padding: 20px;
  }
  .btn-primary {
    width: 100%;
  }
  .brand-logo svg {
    height: 52px;
  }
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #intro-view {
    display: none !important;
  }
  #main-view {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
  }
  .cursor-blink-2hz {
    animation: none !important;
    opacity: 1 !important;
  }
}
