:root {
  --bg-deep: #04111a;
  --bg-mid: #062a35;
  --teal: #14b8a6;
  --cyan: #38bdf8;
  --aqua: #5eead4;
  --gold: #fbbf24;
  --text: #f0fdfa;
  --muted: rgba(186, 230, 253, 0.72);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --card-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg-deep);
}

/* ── Ambient canvas ── */
.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(20, 184, 166, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 20%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(ellipse 45% 35% at 90% 15%, rgba(94, 234, 212, 0.12), transparent 55%),
    linear-gradient(165deg, var(--bg-deep) 0%, #051e28 40%, var(--bg-mid) 100%);
}

.portal-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.portal-bg__orb--1 {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
  animation-duration: 22s;
}

.portal-bg__orb--2 {
  width: 440px;
  height: 440px;
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.3), transparent 70%);
  animation-duration: 16s;
  animation-delay: -4s;
}

.portal-bg__orb--3 {
  width: 360px;
  height: 360px;
  bottom: 10%;
  left: 25%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.18), transparent 70%);
  animation-duration: 20s;
  animation-delay: -8s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.08); }
}

.portal-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black, transparent);
}

.portal-bg__waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
}

.portal-bg__waves svg {
  position: absolute;
  bottom: 0;
  width: 200%;
  height: 100%;
}

.portal-bg__waves .wave-1 {
  animation: wave-slide 14s linear infinite;
  opacity: 0.35;
}

.portal-bg__waves .wave-2 {
  animation: wave-slide 20s linear infinite reverse;
  opacity: 0.2;
  bottom: 8px;
}

@keyframes wave-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Page shell ── */
.portal {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 80px;
}

/* ── Header ── */
.portal-header {
  width: min(100%, 1080px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
  animation: fade-up 0.8s ease both;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.portal-brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  box-shadow: 0 0 32px rgba(20, 184, 166, 0.45);
  font-size: 20px;
}

.portal-brand__text {
  display: grid;
  gap: 1px;
}

.portal-brand__name {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.portal-brand__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.portal-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 10px var(--aqua);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ── Hero ── */
.portal-hero {
  width: min(100%, 1080px);
  text-align: center;
  margin-bottom: 56px;
  animation: fade-up 0.8s 0.1s ease both;
}

.portal-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--aqua);
}

.portal-hero__eyebrow::before,
.portal-hero__eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--aqua));
}

.portal-hero__eyebrow::after {
  background: linear-gradient(90deg, var(--aqua), transparent);
}

.portal-hero__title {
  margin: 0 0 18px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.portal-hero__title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--aqua) 0%, var(--cyan) 50%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-hero__sub {
  margin: 0 auto;
  max-width: 520px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
  font-weight: 400;
}

/* ── System cards ── */
.portal-systems {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  animation: fade-up 0.8s 0.25s ease both;
}

.system-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 32px 32px;
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease,
              box-shadow 0.45s ease;
  box-shadow: var(--card-shadow);
}

.system-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.system-card--shrimp::before {
  background: radial-gradient(ellipse 80% 60% at 20% 0%, rgba(20, 184, 166, 0.25), transparent 70%);
}

.system-card--fish::before {
  background: radial-gradient(ellipse 80% 60% at 80% 0%, rgba(56, 189, 248, 0.25), transparent 70%);
}

.system-card__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.system-card--shrimp .system-card__glow {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.5), transparent 50%, rgba(56, 189, 248, 0.2));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.system-card--fish .system-card__glow {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.5), transparent 50%, rgba(20, 184, 166, 0.2));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.system-card:hover,
.system-card:focus-visible {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 60px rgba(20, 184, 166, 0.12);
  outline: none;
}

.system-card:hover::before,
.system-card:focus-visible::before,
.system-card:hover .system-card__glow,
.system-card:focus-visible .system-card__glow {
  opacity: 1;
}

.system-card__icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.system-card--shrimp .system-card__icon-wrap {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(20, 184, 166, 0.08));
  border: 1px solid rgba(20, 184, 166, 0.35);
  box-shadow: 0 8px 32px rgba(20, 184, 166, 0.2);
}

.system-card--fish .system-card__icon-wrap {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.2);
}

.system-card__icon {
  width: 40px;
  height: 40px;
}

.system-card__label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.system-card__title {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
}

.system-card__desc {
  position: relative;
  z-index: 1;
  margin: 0 0 28px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}

.system-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: gap 0.3s ease;
}

.system-card:hover .system-card__cta,
.system-card:focus-visible .system-card__cta {
  gap: 14px;
}

.system-card--shrimp .system-card__cta { color: var(--aqua); }
.system-card--fish .system-card__cta { color: var(--cyan); }

.system-card__cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.system-card:hover .system-card__cta svg,
.system-card:focus-visible .system-card__cta svg {
  transform: translateX(4px);
}

.system-card__stat {
  font-size: 12px;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.45);
  letter-spacing: 0.04em;
}

/* ── Footer ── */
.portal-footer {
  width: min(100%, 1080px);
  margin-top: 64px;
  text-align: center;
  animation: fade-up 0.8s 0.4s ease both;
}

.portal-footer__line {
  width: 48px;
  height: 1px;
  margin: 0 auto 20px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.portal-footer p {
  margin: 0;
  font-size: 13px;
  color: rgba(186, 230, 253, 0.4);
  letter-spacing: 0.06em;
}

/* ── Entrance animation ── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .portal {
    padding: 28px 18px 60px;
  }

  .portal-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 36px;
  }

  .portal-hero {
    margin-bottom: 40px;
    text-align: left;
  }

  .portal-hero__eyebrow::before { display: none; }

  .portal-hero__sub {
    margin-left: 0;
  }

  .portal-systems {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .system-card {
    padding: 28px 24px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
