@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c0810;
  color: #f7f0f7;
  --bg: #120b16;
  --bg-deep: #08060b;
  --vortex: #bf8cff;
  --vortex-soft: #ddbcff;
  --signal: #71ddd0;
  --signal-soft: #a8f2e6;
  --acid: #c5f26b;
  --paper: #211522;
  --paper-warm: #2a1b28;
  --panel: rgba(255, 244, 249, 0.055);
  --panel-strong: rgba(255, 244, 249, 0.1);
  --text: #f7f0f7;
  --muted: #c8b9c8;
  --soft: #ad94bd;
  --line: rgba(241, 219, 240, 0.2);
  --title-font: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 12%, rgba(191, 140, 255, 0.2), transparent 29rem),
    radial-gradient(circle at 8% 76%, rgba(113, 221, 208, 0.11), transparent 26rem),
    linear-gradient(145deg, #0a070d 0%, #160c18 52%, #09070c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 11px);
  mask-image: radial-gradient(circle at 50% 38%, black, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  top: 70px;
  right: -15vw;
  bottom: auto;
  left: auto;
  width: min(760px, 92vw);
  aspect-ratio: 1;
  border: 1px dotted rgba(221, 188, 255, 0.2);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.5;
  background: transparent;
}

a {
  color: inherit;
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.home-shell {
  min-height: 100vh;
  padding-top: 40px;
}

.brand {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 16px 8px 8px;
  background: var(--paper);
  color: var(--text);
  text-decoration: none;
  box-shadow: 6px 7px 0 rgba(4, 3, 6, 0.35);
}

.brand img {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 18px rgba(191, 140, 255, 0.45));
}

.brand span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand:hover {
  border-color: var(--signal);
  background: var(--paper-warm);
}

.hero {
  padding: 56px 0 28px;
}

.home-hero {
  position: relative;
  max-width: 980px;
  padding: 78px 0 22px;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
.portal strong {
  font-family: var(--title-font);
}

h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(4.4rem, 16vw, 12rem);
  font-style: italic;
  font-weight: 500;
  line-height: 0.78;
  letter-spacing: -0.075em;
}

h1 span {
  display: block;
}

h1 span:nth-child(2) {
  margin-left: clamp(2.2rem, 15vw, 12rem);
  color: var(--vortex-soft);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 0.95;
  color: var(--vortex-soft);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.lead,
.page-intro {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.7;
}

.home-hero .lead {
  max-width: 690px;
  margin-left: clamp(0rem, 12vw, 8rem);
  border-left: 1px solid var(--acid);
  padding-left: 20px;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 40px;
}

.home-menu {
  position: relative;
  z-index: 3;
  margin-top: 20px;
  margin-bottom: 28px;
}

.menu a {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 12px;
  background: rgba(33, 21, 34, 0.76);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.menu a:hover,
.card:hover,
.portal:hover {
  background: var(--paper-warm);
  border-color: var(--signal);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 3px;
  border-left: 3px solid var(--vortex);
  padding: 24px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.025), transparent 46%),
    var(--paper);
  text-decoration: none;
  transition: 160ms ease;
}

.card span {
  display: block;
  margin-bottom: 18px;
  font-size: 1.35rem;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.card small {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.constellation {
  position: relative;
  z-index: 2;
  min-height: 560px;
  margin-top: 42px;
}

.portal {
  position: absolute;
  width: min(280px, 78vw);
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 3px;
  border-left: 4px solid var(--vortex);
  padding: 22px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.045), transparent 55%),
    var(--paper);
  text-decoration: none;
  box-shadow: 8px 10px 0 rgba(4, 3, 6, 0.42);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.portal:hover {
  transform: translateY(-7px) rotate(0deg) scale(1.015);
}

.portal-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border: 1px solid rgba(197, 242, 107, 0.34);
  border-radius: 2px;
  color: var(--acid);
  background: rgba(197, 242, 107, 0.055);
}

.portal strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.portal small {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.portal-fragments { left: 0; top: 28px; transform: rotate(-2.4deg); }
.portal-glyphs { left: 30%; top: 0; transform: rotate(1.6deg); }
.portal-nekarius { right: 0; top: 54px; transform: rotate(-1deg); }
.portal-field-notes { left: 9%; top: 265px; transform: rotate(1.2deg); }
.portal-lab { left: 39%; top: 230px; transform: rotate(-1.8deg); }
.portal-archives { right: 5%; top: 300px; transform: rotate(2deg); }
.portal-chaos {
  right: 22%;
  top: 455px;
  width: min(340px, 82vw);
  min-height: 190px;
  border-color: rgba(142, 240, 231, 0.24);
  transform: rotate(-2deg);
}
.portal-about { left: 2%; top: 492px; transform: rotate(2.2deg); }

.vortex-orb {
  position: absolute;
  z-index: 1;
  right: -10%;
  top: 92px;
  width: min(560px, 70vw);
  aspect-ratio: 1;
  border: 1px dotted rgba(221, 188, 255, 0.26);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(197, 242, 107, 0.2), transparent 9%),
    conic-gradient(from 110deg, transparent, rgba(191, 140, 255, 0.24), transparent, rgba(113, 221, 208, 0.17), transparent);
  filter: blur(0.2px);
  opacity: 0.72;
  animation: slow-spin 44s linear infinite;
}

.star {
  position: absolute;
  z-index: 1;
  color: rgba(244, 241, 255, 0.52);
  font-size: 1.4rem;
  animation: float 8s ease-in-out infinite;
}

.star-a { left: 8%; top: 46px; }
.star-b { right: 9%; top: 36px; animation-delay: -2s; }
.star-c { left: 48%; top: 420px; animation-delay: -5s; }

.page {
  max-width: 860px;
}

.page-body {
  margin-top: 32px;
  border-left: 2px solid var(--signal);
  padding-left: 24px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.8;
}

.page-body pre,
.page > pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px;
  background: #08070a;
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.65;
}

.back-link {
  display: inline-flex;
  margin-top: 40px;
  color: var(--soft);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

@keyframes slow-spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.42; }
  50% { transform: translateY(-14px); opacity: 0.86; }
}

@media (max-width: 900px) {
  .constellation {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: unset;
  }

  .portal,
  .portal-fragments,
  .portal-glyphs,
  .portal-nekarius,
  .portal-field-notes,
  .portal-lab,
  .portal-archives,
  .portal-chaos,
  .portal-about {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
  }

  .vortex-orb {
    right: 0;
    top: 120px;
    width: min(560px, 72vw);
    opacity: 0.45;
  }
}

@media (max-width: 560px) {
  .brand span {
    display: none;
  }

  .brand {
    padding-right: 8px;
  }

  .home-hero {
    padding-top: 42px;
  }
}
