:root {
  --portal-bg: #04010a;
  --portal-panel: rgba(10, 8, 18, 0.85);
  --portal-accent: #ff2667;
  --portal-border: rgba(255, 255, 255, 0.08);
  --portal-text: #f5f5f7;
}

.portal-shell {
  min-height: 100vh;
  margin: 0;
  font-family: 'Space Grotesk', 'Chakra Petch', sans-serif;
  color: var(--portal-text);
  background: radial-gradient(circle at top, rgba(255, 38, 103, 0.15), transparent 45%),
    radial-gradient(circle at bottom, rgba(255, 255, 255, 0.08), transparent 40%),
    #020005;
}

#portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.portal-nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 5vw;
  z-index: 5;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.portal-nav .logo {
  font-weight: 600;
}

.portal-nav .nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
}

.portal-nav .nav-links a {
  color: inherit;
  text-decoration: none;
  position: relative;
}

.portal-nav .nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 2px;
  background: var(--portal-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.portal-nav .nav-links a:hover::after {
  transform: scaleX(1);
}

.portal-shell[data-portal-mode='welcome'] .portal-grid,
.portal-shell[data-portal-mode='welcome'] .portal-auth,
.portal-shell[data-portal-mode='welcome'] .portal-modules {
  pointer-events: none;
  opacity: 0;
  transform: translateY(40px);
}

.portal-shell[data-portal-mode='auth'] .portal-hero {
  opacity: 0;
  pointer-events: none;
}

.portal-shell[data-portal-mode='welcome'] .portal-hero {
  opacity: 1;
}

.portal-shell[data-portal-mode='welcome'] .portal-grid {
  display: none;
}

.portal-shell[data-portal-mode='console'] .portal-hero {
  display: none;
}


.portal-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 5vw;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .portal-grid {
    grid-template-columns: 1fr;
    padding: 10vw 5vw;
  }
}

.portal-hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 8vw 5vw 6vw;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.portal-hero h1 {
  font-size: clamp(6rem, 18vw, 14rem);
  margin: 0.25rem 0 0.5rem;
  text-align: center;
  line-height: 0.95;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.portal-hero .portal-subtitle {
  margin-top: 0.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  justify-content: center;
}

.auth-shell {
  min-height: 100vh;
  margin: 0;
  font-family: 'Space Grotesk', 'Chakra Petch', sans-serif;
  color: var(--portal-text);
  background: #020005;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--portal-panel);
  border: 1px solid var(--portal-border);
  border-radius: 24px;
  padding: 3rem;
  width: min(420px, 90vw);
  text-align: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.auth-form input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--portal-text);
}

.auth-meta {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.eyebrow {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--portal-accent);
}

.portal-auth,
.portal-modules {
  background: var(--portal-panel);
  border: 1px solid var(--portal-border);
  border-radius: 20px;
  padding: 2.75rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.portal-auth h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 0.75rem 0 1.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.auth-tabs {
  display: inline-flex;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  overflow: hidden;
}

.auth-tabs .tab {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.5rem 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  cursor: pointer;
}

.auth-tabs .tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--portal-accent);
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-form input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--portal-text);
  font-size: 1rem;
}

.btn,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  background: transparent;
  color: var(--portal-text);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--portal-accent);
  border-color: transparent;
}

.btn[disabled],
.btn-link[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-hint {
  min-height: 1.25rem;
  font-size: 0.8rem;
  color: var(--portal-muted, #d3d3d6);
}

.session-meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--portal-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.module-card {
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(4, 3, 10, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 220px;
  transition: transform 0.2s ease, border 0.2s ease;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--portal-accent);
}

.module-card h2 {
  margin: 0.35rem 0 0;
}

.module-card p {
  flex: 1;
  color: rgba(255, 255, 255, 0.75);
}

.module-card--admin {
  border-style: dashed;
}

.portal-shell[data-state='auth'] .portal-modules .btn-link,
.portal-shell[data-state='auth'] .module-card {
  cursor: pointer;
}

.portal-shell[data-state='locked'] .module-card {
  opacity: 0.5;
}

.portal-shell[data-state='locked'] .module-card .btn-link {
  cursor: not-allowed;
}

.portal-shell[data-state='auth'] #portal-login-form {
  display: none;
}

.portal-shell[data-state='locked'] #portal-session-meta {
  display: none;
}

.portal-shell[data-state='auth'] #portal-session-meta {
  display: flex;
}

.simple-page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 8vw 5vw 6vw;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.simple-page header h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin: 0.5rem 0;
}

.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.product-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.product-grid article,
.service-grid article {
  background: rgba(8, 6, 16, 0.8);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 180px;
}
.portal-title-glitch {
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

.portal-title {
  text-align: center;
  font-size: clamp(11rem, 32vw, 24rem);
  letter-spacing: 0.2em;
  margin: 0;
}

.portal-title-glitch .text,
.portal-title-glitch .fragment {
  display: block;
}

.portal-title-glitch .fragment {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0.5;
}

.portal-title-glitch .fragment-a {
  transform: translateX(-3px);
  color: rgba(255, 38, 103, 0.8);
}

.portal-title-glitch .fragment-b {
  transform: translateX(3px);
  color: rgba(60, 255, 100, 0.8);
}

.portal-title-glitch .fragment-c {
  transform: translateY(3px);
  color: rgba(255, 255, 255, 0.4);
}
.btn-glow {
  box-shadow: 0 0 20px rgba(255, 38, 103, 0.6), 0 0 40px rgba(255, 38, 103, 0.3);
}

.portal-subtitle {
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 0.25em;
  margin: 0;
  text-transform: uppercase;
  display: block;
  transform: translateX(-2vw);
}

.portal-hero-inner {
  max-width: min(900px, 90vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
