/* ── Homepage hero layout ── */
.portal-home {
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.portal-home #matrix-canvas { opacity: 0.42; }

.portal-home .vignette {
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 20%, rgba(0, 0, 0, 0.82) 100%);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(0, 255, 170, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 170, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 10%, transparent 75%);
}

.glow-orb {
  position: fixed;
  top: 38%;
  left: 50%;
  width: min(520px, 90vw);
  height: 280px;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(0, 255, 170, 0.14) 0%, transparent 68%);
  animation: orb-breathe 6s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.scan-beam {
  position: fixed;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 170, 0.5), transparent);
  box-shadow: 0 0 24px rgba(0, 255, 170, 0.35);
  animation: beam-sweep 7s linear infinite;
  opacity: 0.55;
}

@keyframes beam-sweep {
  0% { top: 12%; opacity: 0; }
  8% { opacity: 0.55; }
  45% { top: 78%; opacity: 0.35; }
  55% { opacity: 0; }
  100% { top: 78%; opacity: 0; }
}

/* ── Hero shell ── */
.portal-hero {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 620px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 28px 48px;
  margin: 0 auto;
  animation: portal-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-brand {
  text-align: center;
  margin-bottom: 48px;
}

.portal-home .brand-eyebrow {
  font-size: 10px;
  letter-spacing: 0.42em;
  margin-bottom: 20px;
  opacity: 0.85;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.hero-line {
  font-family: "Orbitron", var(--mono);
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.15;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(0, 255, 170, 0.2);
}

.hero-line-accent {
  color: var(--accent);
  letter-spacing: 0.28em;
  font-size: clamp(22px, 5.5vw, 34px);
}

.portal-home .brand-sub {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0.7;
}

.portal-home .glitch::before,
.portal-home .glitch::after {
  font-family: inherit;
}

/* ── Access terminal module ── */
.access-terminal {
  position: relative;
  background: rgba(3, 8, 18, 0.82);
  border: 1px solid rgba(0, 255, 170, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 255, 170, 0.06) inset,
    0 0 80px rgba(0, 255, 170, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.access-form {
  padding: 28px 24px;
}

.portal-hint {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(160, 220, 195, 0.72);
  margin-bottom: 18px;
  text-align: center;
  transition: color 0.2s;
}

.portal-hint.hint-shake {
  animation: hint-shake 0.45s ease;
  color: var(--accent);
}

@keyframes hint-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.phone-row {
  display: flex;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-dim);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.phone-row:focus-within {
  border-color: rgba(0, 255, 170, 0.35);
  box-shadow: inset 0 0 32px rgba(0, 255, 170, 0.04);
}

.portal-home .phone-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
}

.input-glyph {
  padding: 0 0 0 16px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--accent);
  opacity: 0.7;
  user-select: none;
}

.portal-home .phone-field input {
  flex: 1;
  width: 0;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 20px 16px 20px 10px;
  font-size: 17px;
  letter-spacing: 0.08em;
  box-shadow: none;
}

.portal-home .phone-field input:focus {
  box-shadow: none;
  background: transparent;
}

.portal-home .phone-field input::placeholder {
  color: rgba(160, 220, 195, 0.25);
  font-size: 13px;
}

.auth-gate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 68px;
  padding: 0 14px;
  border: none;
  border-left: 1px solid rgba(0, 255, 170, 0.22);
  background: rgba(0, 255, 170, 0.05);
  color: rgba(0, 255, 170, 0.62);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-gate-btn:hover:not(:disabled) {
  background: rgba(0, 255, 170, 0.12);
  color: rgba(0, 255, 170, 0.88);
}

.auth-gate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-gate-btn svg {
  opacity: 0.82;
  transition: opacity 0.2s;
}

.auth-gate-btn:hover:not(:disabled) svg {
  opacity: 1;
}

.auth-gate-btn.loading svg {
  animation: spin 0.8s linear infinite;
}

.hero-footer {
  margin-top: 36px;
  text-align: center;
  min-height: 24px;
}

.type-line {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.type-line::after {
  content: "▋";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.portal-home .portal-error {
  margin-top: 16px;
  padding-top: 4px;
}

@media (max-width: 520px) {
  .portal-hero { padding: 64px 18px 40px; }
  .hero-brand { margin-bottom: 36px; }
  .access-form { padding: 22px 16px 16px; }
  .portal-hint { font-size: 12px; }
  .auth-gate-btn { min-width: 60px; padding: 0 10px; }
  .auth-gate-text { font-size: 9px; }
}

@media (min-width: 768px) {
  .portal-hero { max-width: 680px; padding-top: 80px; }
  .access-form { padding: 32px 36px 24px; }
}
