/* ════════ Lyterian — dimension portals ════════ */
:root {
  --void: #05060a;
  --ink: #e8eaf2;
  --muted: #8b90a3;
  --red: #c1121f;
  --red-deep: #3d0509;
  --sky: #eef4fb;
  --sky-ink: #14213d;
  --cyan: #22d3ee;
  --cyber: #020b12;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--void);
  color: var(--ink);
  overflow-x: hidden;
}
h1, h2, h3 { font-family: "Sora", system-ui, sans-serif; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }

/* ════════ HUB ════════ */
.hub {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hub-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 9vh 1rem 5vh;
}
.wordmark {
  font-size: clamp(1.9rem, 6vw, 4.6rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  margin-left: 0.28em; /* optically recenters letter-spaced text */
  background: linear-gradient(100deg, #f5f6fa 20%, #b02030 45%, #7dd3fc 70%, #22d3ee 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.tagline {
  margin-top: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.6vw, 0.85rem);
}

.portals {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  gap: 2px;
  padding: 0 clamp(0.5rem, 4vw, 4rem) 4vh;
}
.portal {
  position: relative;
  flex: 1;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  transition: flex 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  outline-offset: 4px;
}
.portal:hover, .portal:focus-visible { flex: 2.1; }

.portal-glow { position: absolute; inset: 0; z-index: -1; transition: opacity 0.5s; opacity: 0.85; }
.portal:hover .portal-glow { opacity: 1; }

.portal-games .portal-glow {
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(193, 18, 31, 0.55), transparent 60%),
    linear-gradient(180deg, #0b0507, #1c060a);
}
.portal-apps .portal-glow {
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(125, 211, 252, 0.5), transparent 60%),
    linear-gradient(180deg, #0a1220, #12325a);
}
.portal-labs .portal-glow {
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(34, 211, 238, 0.4), transparent 60%),
    linear-gradient(180deg, #020a10, #063441);
}

.portal-label {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  letter-spacing: 0.32em;
  margin-left: 0.32em;
}
.portal-games .portal-label { color: #ff8791; text-shadow: 0 0 28px rgba(193, 18, 31, 0.8); }
.portal-apps  .portal-label { color: #cfe8ff; text-shadow: 0 0 28px rgba(125, 211, 252, 0.7); }
.portal-labs  .portal-label { color: #9ef4ff; text-shadow: 0 0 28px rgba(34, 211, 238, 0.7); }

.portal-sub {
  color: rgba(232, 234, 242, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.68rem;
}
.portal-tease {
  max-width: 26ch;
  color: rgba(232, 234, 242, 0.85);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s 0.1s, transform 0.45s 0.1s;
}
.portal:hover .portal-tease, .portal:focus-visible .portal-tease {
  opacity: 1;
  transform: translateY(0);
}

.hub-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  padding: 0 1rem 3vh;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.hub-footer a { text-decoration: none; border-bottom: 1px solid rgba(139, 144, 163, 0.4); }
.hub-footer a:hover { color: var(--ink); }

/* ════════ Worlds (shared) ════════ */
.world {
  position: relative;
  min-height: 100vh;
  animation: worldIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes worldIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}
.world-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem clamp(1rem, 5vw, 3.5rem);
  backdrop-filter: blur(10px);
}
.world-nav button {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.75;
  transition: opacity 0.25s, transform 0.25s;
}
.world-nav button:hover { opacity: 1; transform: translateY(-1px); }
.jump { display: flex; gap: 0.6rem; }

.world-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 4vh clamp(1.2rem, 5vw, 2.5rem) 8vh;
}
.world-kicker {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.7rem;
  opacity: 0.6;
  margin-bottom: 1.2rem;
}
.world-title {
  font-size: clamp(1.7rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 3rem;
}

.feature-card {
  border-radius: 18px;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  margin-bottom: 2rem;
  line-height: 1.65;
}
.feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.feature-head h3 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  letter-spacing: 0.06em;
}
.badge {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}
.feature-meta {
  margin-top: 1.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}
.feature-quote {
  font-style: italic;
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
  opacity: 0.9;
}

.world-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid currentColor;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.6rem;
  font-size: 0.85rem;
}
.world-footer { border-top-color: rgba(128, 128, 128, 0.25); }
.socials { display: flex; gap: 1.1rem; }
.socials a { text-decoration: none; opacity: 0.75; letter-spacing: 0.06em; }
.socials a:hover { opacity: 1; text-decoration: underline; }
.mail { opacity: 0.75; }
.loc { margin-left: auto; opacity: 0.5; letter-spacing: 0.1em; }

/* ════════ GAMES world ════════ */
.world-games {
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(193, 18, 31, 0.22), transparent 65%),
    linear-gradient(180deg, #0a0507 0%, #12060a 55%, #05060a 100%);
  color: #f3e9ea;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.world-games .world-inner { position: relative; z-index: 2; }
.card-red {
  background: linear-gradient(160deg, rgba(61, 5, 9, 0.85), rgba(20, 6, 9, 0.9));
  border: 1px solid rgba(193, 18, 31, 0.45);
  box-shadow: 0 30px 80px -30px rgba(193, 18, 31, 0.45);
}
.badge-red { background: rgba(193, 18, 31, 0.2); border: 1px solid rgba(193, 18, 31, 0.6); color: #ff9aa3; }
.about-block {
  padding: 0 0.4rem;
  line-height: 1.7;
  color: rgba(243, 233, 234, 0.8);
}
.about-block h4 {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin-bottom: 0.8rem;
  color: #ff8791;
}

/* ════════ APPS world ════════ */
.world-apps {
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(125, 211, 252, 0.35), transparent 65%),
    linear-gradient(180deg, #f7fafd 0%, var(--sky) 60%, #dbe9f7 100%);
  color: var(--sky-ink);
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}
.card-light {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 24px 60px -28px rgba(20, 33, 61, 0.25);
  margin-bottom: 0;
}
.badge-green { background: #e3f7e8; border: 1px solid #34a853; color: #1e7a38; }
.badge-blue  { background: #e5effb; border: 1px solid #4285f4; color: #2b5fb8; }
.world-apps .world-footer { border-top-color: rgba(20, 33, 61, 0.15); }

/* ════════ LABS world ════════ */
.world-labs {
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(34, 211, 238, 0.14), transparent 60%),
    linear-gradient(180deg, #03141c 0%, var(--cyber) 70%);
  color: #d8fbff;
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(34, 211, 238, 0.035) 3px 4px);
}
.world-labs .world-inner { position: relative; z-index: 2; }
.card-cyber {
  background: linear-gradient(160deg, rgba(6, 52, 65, 0.5), rgba(2, 15, 22, 0.85));
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 30px 80px -32px rgba(34, 211, 238, 0.35);
}
.badge-cyan { background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.55); color: #7deeff; }
.lab-list {
  margin: 1.2rem 0 1.6rem 1.2rem;
  line-height: 2;
  color: rgba(216, 251, 255, 0.85);
}
.cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--cyan);
  color: #9ef4ff;
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
  transition: background 0.3s, transform 0.3s;
}
.cta:hover { background: rgba(34, 211, 238, 0.12); transform: translateY(-2px); }

.feature-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
.cta-red {
  border-color: rgba(193, 18, 31, 0.7);
  color: #ff9aa3;
}
.cta-red:hover { background: rgba(193, 18, 31, 0.18); }
.cta-red.ghost { border-color: rgba(255, 154, 163, 0.35); opacity: 0.8; }

/* ════════ Portal wipe transition ════════ */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  border-radius: 50%;
}
.wipe.run {
  animation: wipe 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes wipe {
  0%   { opacity: 1; transform: scale(0); border-radius: 50%; }
  100% { opacity: 1; transform: scale(3); border-radius: 0; }
}
.wipe.games { background: radial-gradient(circle, #3d0509, #0a0507); }
.wipe.apps  { background: radial-gradient(circle, #cfe8ff, #eef4fb); }
.wipe.labs  { background: radial-gradient(circle, #063441, #020b12); }
.wipe.hub   { background: radial-gradient(circle, #10121c, #05060a); }

/* ════════ Mobile ════════ */
@media (max-width: 720px) {
  .portals { flex-direction: column; padding-bottom: 3vh; }
  .portal { min-height: 20vh; }
  .portal:hover, .portal:focus-visible { flex: 1.6; }
  .portal-tease { display: none; }
  .loc { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
