:root {
  --ink: #07141c;
  --ink-soft: #0d2430;
  --mist: #9eb6c4;
  --foam: #e8f1f4;
  --accent: #d9772f;
  --accent-soft: rgba(217, 119, 47, 0.18);
  --line: rgba(232, 241, 244, 0.12);
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

.public-body {
  font-family: var(--font-body);
  color: var(--foam);
  background: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  /* Keep brand text visible; clip only the decorative grid layer below */
  overflow: visible;
  background:
    radial-gradient(ellipse 90% 60% at 70% 10%, rgba(46, 110, 132, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 90%, rgba(217, 119, 47, 0.14), transparent 50%),
    linear-gradient(165deg, var(--ink) 0%, var(--ink-soft) 45%, #0a1c26 100%);
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(232, 241, 244, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 241, 244, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent 75%);
  pointer-events: none;
  animation: grid-drift 28s linear infinite;
  z-index: 0;
}

@keyframes grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(72px); }
}

.sitemap-scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: 0 clamp(1rem, 3vw, 2.5rem) 0 0;
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 28%,
    rgba(0, 0, 0, 0.35) 48%,
    rgba(0, 0, 0, 0.7) 68%,
    rgba(0, 0, 0, 0.45) 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 28%,
    rgba(0, 0, 0, 0.35) 48%,
    rgba(0, 0, 0, 0.7) 68%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.sitemap-scroll-column {
  position: relative;
  width: min(28rem, 42vw);
  height: 100%;
  overflow: hidden;
  opacity: 0.34;
  filter: blur(0.15px);
}

.sitemap-scroll-column--b {
  width: min(22rem, 32vw);
  opacity: 0.18;
  transform: translateY(-8%);
}

.sitemap-scroll-track {
  margin: 0;
  padding: 2rem 0;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(0.62rem, 1.05vw, 0.78rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: rgba(180, 208, 220, 0.72);
  white-space: pre;
  will-change: transform;
}

.sitemap-scroll-column--a .sitemap-scroll-track {
  animation: sitemap-scroll-up 55s linear infinite;
}

.sitemap-scroll-column--b .sitemap-scroll-track {
  animation: sitemap-scroll-down 72s linear infinite;
  color: rgba(217, 119, 47, 0.45);
}

@keyframes sitemap-scroll-up {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -50%, 0); }
}

@keyframes sitemap-scroll-down {
  from { transform: translate3d(0, -50%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (max-width: 820px) {
  .sitemap-scroll {
    mask-image: linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 0, 0, 0.25) 18%,
      rgba(0, 0, 0, 0.35) 55%,
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 0, 0, 0.25) 18%,
      rgba(0, 0, 0, 0.35) 55%,
      transparent 100%
    );
    opacity: 0.55;
  }

  .sitemap-scroll-column--b {
    display: none;
  }

  .sitemap-scroll-column--a {
    width: min(100%, 36rem);
    opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing::before,
  .sitemap-scroll-track {
    animation: none !important;
  }
}

.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem clamp(1.25rem, 4vw, 3.5rem);
}

.landing-nav a {
  color: var(--mist);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.landing-nav a:hover {
  color: var(--foam);
}

.hero {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 8vh, 5rem) clamp(1.25rem, 4vw, 3.5rem) 3rem;
  max-width: min(100%, 62rem);
  width: 100%;
  overflow: visible;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4.75rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 1.5rem;
  max-width: 100%;
  overflow: visible;
  color: var(--foam);
  animation: brand-in 0.9s ease-out both;
}

.brand-mark {
  display: block;
}

.brand-mark--accent {
  color: #e09248;
}

@media (max-width: 560px) {
  .brand {
    font-size: clamp(2.4rem, 14vw, 3.1rem);
  }
}

.hero h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 1rem;
  max-width: 28ch;
  animation: rise-in 0.8s ease-out 0.15s both;
}

.hero .lede {
  margin: 0 0 2rem;
  color: var(--mist);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 38ch;
  animation: rise-in 0.8s ease-out 0.28s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  animation: rise-in 0.8s ease-out 0.4s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a0f05;
}

.btn-primary:hover {
  background: #e89145;
}

.btn-ghost {
  background: transparent;
  color: var(--foam);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--mist);
  background: rgba(232, 241, 244, 0.04);
}

.landing-footer {
  position: relative;
  z-index: 2;
  padding: 1.25rem clamp(1.25rem, 4vw, 3.5rem) 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--mist);
  font-size: 0.9rem;
}

.landing-footer a {
  color: var(--foam);
  text-decoration: none;
}

.landing-footer a:hover {
  text-decoration: underline;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bot / secondary public pages */
.public-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(46, 110, 132, 0.25), transparent 50%),
    var(--ink);
}

.public-page-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
}

.public-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 1.5rem 0 0.75rem;
}

.public-page h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.public-page p,
.public-page li {
  color: var(--mist);
}

.public-page code,
.public-page pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  background: rgba(232, 241, 244, 0.06);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
}

.public-page code {
  padding: 0.1rem 0.35rem;
}

.public-page pre {
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

.public-page ul {
  padding-left: 1.2rem;
}

.public-page a {
  color: #f0b27a;
}

.back-link {
  color: var(--mist) !important;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--foam) !important;
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(46, 110, 132, 0.28), transparent 55%),
    var(--ink);
}

.login-card {
  width: min(100%, 24rem);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(13, 36, 48, 0.85);
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
}

.login-card .hint {
  color: var(--mist);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.login-card label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--mist);
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(7, 20, 28, 0.8);
  color: var(--foam);
  font: inherit;
}

.login-card .error {
  color: #f0a0a0;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.login-card button {
  width: 100%;
  padding: 0.8rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--accent);
  color: #1a0f05;
  font-weight: 600;
  font: inherit;
  cursor: pointer;
}

.login-card button:hover {
  background: #e89145;
}
