/*
  Shared public-site chrome.
  Tokens match the in-app web layout: getPageLayoutGradient('web'),
  darkColors (gold #FDB913, surface rgba(15,23,43,0.92), white text).
*/

:root {
  --page-gradient: linear-gradient(
    90deg,
    rgba(28, 42, 72, 0.97) 0%,
    rgba(52, 98, 208, 0.98) 50%,
    rgba(28, 42, 72, 0.97) 100%
  );
  --gold: #fdb913;
  --gold-dark: #f39c12;
  --gold-light: #fdd557;
  --gold-border: rgba(253, 185, 19, 0.3);
  --gold-divider: rgba(253, 185, 19, 0.5);
  --text: #ffffff;
  --muted: #cad5e2;
  --muted-2: #90a1b9;
  --surface: rgba(15, 23, 43, 0.92);
  --background: #0f172b;
  --line: #314158;
  --max: 1160px;
  /* Shared with in-app ARCADE_CORNER_RADIUS so cards and buttons stay square-ish. */
  --arcade-radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background-color: var(--background);
  /* Same left-to-right page wash as the in-app LinearGradient; stays put while content scrolls. */
  background-image: var(--page-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

/* Compact in-app header: logo + Cerebot + one Open App button. */
.app-header {
  padding: 12px 0 0;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-header-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.open-app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--arcade-radius);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0f172b;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, filter 160ms ease;
}

.open-app-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.app-header-divider {
  height: 1px;
  margin: 0 16px;
  background: var(--gold-divider);
}

/* Landing-only: larger logo, title, and CTA. */
.app-header--hero {
  padding: 28px 0 0;
}

.app-header--hero .app-header-inner {
  gap: 28px;
  padding-bottom: 22px;
}

.app-header--hero .app-header-brand {
  gap: 20px;
}

.app-header--hero .app-header-logo {
  width: 112px;
  height: 112px;
}

/* Keep the landing tagline on one line next to the logo. */
.app-header--hero .app-header-title {
  font-size: clamp(0.72rem, 2.15vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: none;
  white-space: nowrap;
}

.app-header--hero .open-app-button {
  min-height: 72px;
  padding: 0 44px;
  border-radius: var(--arcade-radius);
  font-size: 1.35rem;
}

.page-main {
  --max: 960px;
  padding: 28px 0 56px;
}

.page-main h1 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.page-main p,
.page-main li {
  color: var(--muted);
  line-height: 1.65;
}

.page-main > p a:not(.button) {
  color: var(--gold-light);
  text-decoration: underline;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--arcade-radius);
  border: 1px solid var(--gold-border);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(253, 185, 19, 0.55);
}

.button.primary,
.button.success,
.button.danger,
.button.info {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--arcade-radius);
  color: #ffffff;
  font-weight: 800;
  font-style: normal;
  /* Same 1rem / 44px ratio as in-app arcade labels. */
  font-size: 1rem;
  letter-spacing: 0.06em;
  line-height: 1;
  /* Bottom inset so descenders stay inside the glossy fill. */
  padding-top: 0;
  padding-bottom: 4px;
  text-shadow: 0 1px 0 rgba(255, 155, 26, 0.35), 0 2px 8px rgba(80, 25, 0, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(255, 155, 26, 0.4),
    inset 0 -3px 0 rgba(160, 60, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(240, 120, 0, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

/* Orange arcade fill for gold/yellow CTAs. */
.button.primary {
  border: 2px solid #ff9b1a;
  background:
    linear-gradient(
      118deg,
      rgba(255, 155, 26, 0.55) 0%,
      rgba(255, 120, 0, 0.18) 34%,
      rgba(180, 70, 0, 0.28) 44%,
      rgba(140, 50, 0, 0.4) 100%
    ),
    linear-gradient(180deg, #ff9b1a 0%, #f07800 52%, #e06a00 100%);
}

/* Green arcade fill for success CTAs. */
.button.success {
  border: 2px solid #22c55e;
  background:
    linear-gradient(
      118deg,
      rgba(34, 197, 94, 0.5) 0%,
      rgba(22, 163, 74, 0.16) 34%,
      rgba(21, 128, 61, 0.3) 44%,
      rgba(5, 80, 35, 0.42) 100%
    ),
    linear-gradient(180deg, #22c55e 0%, #16a34a 52%, #15803d 100%);
  text-shadow: 0 1px 0 rgba(34, 197, 94, 0.35), 0 2px 8px rgba(5, 40, 18, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(34, 197, 94, 0.4),
    inset 0 -3px 0 rgba(5, 80, 35, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(22, 163, 74, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

/* Red arcade fill for destructive CTAs. */
.button.danger {
  border: 2px solid #ef4444;
  background:
    linear-gradient(
      118deg,
      rgba(239, 68, 68, 0.5) 0%,
      rgba(220, 38, 38, 0.16) 34%,
      rgba(185, 28, 28, 0.3) 44%,
      rgba(120, 15, 15, 0.42) 100%
    ),
    linear-gradient(180deg, #ef4444 0%, #dc2626 52%, #b91c1c 100%);
  text-shadow: 0 1px 0 rgba(239, 68, 68, 0.35), 0 2px 8px rgba(70, 10, 10, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(239, 68, 68, 0.4),
    inset 0 -3px 0 rgba(120, 15, 15, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(220, 38, 38, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

/* Sky-blue arcade fill for secondary CTAs such as Log in. */
.button.info {
  border: 2px solid #38bdf8;
  background:
    linear-gradient(
      118deg,
      rgba(56, 189, 248, 0.5) 0%,
      rgba(14, 165, 233, 0.16) 34%,
      rgba(2, 132, 199, 0.3) 44%,
      rgba(7, 89, 133, 0.42) 100%
    ),
    linear-gradient(180deg, #38bdf8 0%, #0ea5e9 52%, #0284c7 100%);
  text-shadow: 0 1px 0 rgba(56, 189, 248, 0.35), 0 2px 8px rgba(8, 47, 73, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(56, 189, 248, 0.4),
    inset 0 -3px 0 rgba(7, 89, 133, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(14, 165, 233, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

.button.secondary {
  background: rgba(15, 23, 43, 0.45);
}

/*
  Shared 3D navy card chrome — same fold as the GO buttons.
  Blue is the default. Gold / green / red / purple only change the rim and fade.
*/
.arcade-card,
.panel,
.welcome,
.mode-card,
.cta-card,
.hero-copy,
.hero-card,
.faq-item,
.footer-panel,
.list > li,
.signal,
.crawler-card,
.app-card {
  --arcade-rim: #38bdf8;
  --arcade-gloss-0: rgba(56, 189, 248, 0.18);
  --arcade-gloss-1: rgba(14, 116, 166, 0.08);
  --arcade-gloss-2: rgba(7, 55, 90, 0.36);
  --arcade-gloss-3: rgba(8, 13, 26, 0.55);
  --arcade-inset-top: rgba(125, 211, 252, 0.22);
  --arcade-inset-bottom: rgba(2, 48, 80, 0.55);
  --arcade-glow: rgba(14, 165, 233, 0.18);
  border-radius: var(--arcade-radius);
  border: 2px solid var(--arcade-rim);
  background:
    linear-gradient(
      118deg,
      var(--arcade-gloss-0) 0%,
      var(--arcade-gloss-1) 34%,
      var(--arcade-gloss-2) 44%,
      var(--arcade-gloss-3) 100%
    ),
    linear-gradient(180deg, #243b55 0%, #152036 48%, #0b1220 100%);
  box-shadow:
    inset 0 2px 0 var(--arcade-inset-top),
    inset 0 -3px 0 var(--arcade-inset-bottom),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 12px var(--arcade-glow),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

.arcade-card--gold {
  --arcade-rim: #fdb913;
  --arcade-gloss-0: rgba(253, 185, 19, 0.18);
  --arcade-gloss-1: rgba(243, 156, 18, 0.08);
  --arcade-gloss-2: rgba(120, 80, 10, 0.36);
  --arcade-inset-top: rgba(253, 213, 87, 0.22);
  --arcade-inset-bottom: rgba(92, 61, 8, 0.55);
  --arcade-glow: rgba(253, 185, 19, 0.22);
}

.arcade-card--green {
  --arcade-rim: #22c55e;
  --arcade-gloss-0: rgba(34, 197, 94, 0.18);
  --arcade-gloss-1: rgba(22, 163, 74, 0.08);
  --arcade-gloss-2: rgba(20, 83, 45, 0.36);
  --arcade-inset-top: rgba(134, 239, 172, 0.22);
  --arcade-inset-bottom: rgba(5, 46, 22, 0.55);
  --arcade-glow: rgba(22, 163, 74, 0.18);
}

.arcade-card--red {
  --arcade-rim: #ef4444;
  --arcade-gloss-0: rgba(239, 68, 68, 0.18);
  --arcade-gloss-1: rgba(220, 38, 38, 0.08);
  --arcade-gloss-2: rgba(127, 29, 29, 0.36);
  --arcade-inset-top: rgba(252, 165, 165, 0.22);
  --arcade-inset-bottom: rgba(69, 10, 10, 0.55);
  --arcade-glow: rgba(220, 38, 38, 0.18);
}

.arcade-card--purple {
  --arcade-rim: #a855f7;
  --arcade-gloss-0: rgba(168, 85, 247, 0.18);
  --arcade-gloss-1: rgba(139, 92, 246, 0.08);
  --arcade-gloss-2: rgba(88, 28, 135, 0.36);
  --arcade-inset-top: rgba(216, 180, 254, 0.22);
  --arcade-inset-bottom: rgba(59, 7, 100, 0.55);
  --arcade-glow: rgba(168, 85, 247, 0.18);
}

.page-main .panel {
  margin-top: 16px;
  padding: 20px;
}

.meta {
  color: var(--gold-light);
  font-weight: 600;
}

.list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.list > li {
  padding: 14px;
}

.list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.list a:hover {
  color: var(--gold-light);
}

.prose h2 {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 500;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold-divider);
}

.prose h3 {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 500;
  margin: 20px 0 8px;
}

.prose p,
.prose li {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.prose a {
  color: var(--gold-light);
  text-decoration: underline;
}

.prose strong {
  color: #ffffff;
}

.prose ul {
  margin: 0 0 16px 24px;
}

.contact-box {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: rgba(15, 23, 43, 0.55);
  border: 1px solid var(--gold-border);
  border-left: 4px solid var(--gold);
}

.page-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--gold-divider);
  color: var(--muted-2);
}

.last-updated {
  color: var(--muted-2);
  font-size: 0.92rem;
}

.highlight-box {
  margin: 20px 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(253, 185, 19, 0.12);
  border: 1px solid var(--gold-border);
  border-left: 4px solid var(--gold);
  color: var(--muted);
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 22px), var(--max));
  }

  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .app-header-brand {
    justify-content: center;
  }

  .open-app-button {
    width: 100%;
  }

  .app-header--hero .app-header-logo {
    width: 88px;
    height: 88px;
  }

  .app-header--hero .open-app-button {
    min-height: 64px;
    font-size: 1.2rem;
  }
}
