/* =============================================================================
   landing.css — the marketing landing page shown at "/" for logged-out users.
   Ported from the standalone bases/webapp/resources/public/landing.html (#7).

   EVERYTHING is scoped under `.landing-root` so the bespoke editorial look (its
   own palette, type, full-bleed layout) cannot leak into the dark-themed app —
   several class names (.feature, .system, .masthead, .label) collide with app
   CSS, so the wrapper scope is load-bearing. The landing brings its own colour
   tokens (--lp-*) and does not touch the app's design tokens.
   ============================================================================= */

.landing-root {
  /* Palette — warm near-black "paper" with cream ink. */
  --lp-bg:         #0b0a09;
  --lp-bg-soft:    #15130f;
  --lp-bg-elev:    #1c1a16;
  --lp-ink:        #f2ede0;
  --lp-ink-muted:  #8a8375;
  --lp-ink-dim:    #45423c;
  --lp-accent:     #e63946;
  --lp-accent-dim: #9c2128;
  --lp-rule:       #1f1d19;

  --lp-bleed:      clamp(24px, 5.5vw, 96px);
  --lp-gutter:     clamp(14px, 1.8vw, 28px);
  --lp-section-pad: clamp(80px, 12vh, 180px);
  --lp-ease: cubic-bezier(0.22, 0.68, 0.1, 1);

  position: relative;
  min-height: 100vh;
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "liga", "kern";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.landing-root * { box-sizing: border-box; }
.landing-root ::selection { background: var(--lp-accent); color: #fff; }

/* --- Grain: a thin film of paper texture (same-origin SVG, CSP-safe). --- */
.landing-root .lp-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("/landing-grain.svg");
}

/* --- Fixed, always-visible Sign In button (the prominent login CTA, #7). --- */
.landing-root .lp-login-fixed {
  position: fixed;
  top: 14px;
  right: var(--lp-bleed);
  z-index: 60;
}

/* =============================================================================
   MASTHEAD
   ============================================================================= */
.landing-root .lp-masthead {
  position: sticky; top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--lp-gutter);
  padding: 14px var(--lp-bleed);
  background: rgba(11, 10, 9, 0.88);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--lp-rule);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--lp-ink-muted);
}

.landing-root .lp-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  color: var(--lp-ink);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.landing-root .lp-wordmark::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--lp-accent);
  transform: translateY(-1px);
}

.landing-root .lp-tagline {
  justify-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48ch;
  color: var(--lp-ink-muted);
}

/* Right slot in the masthead reserved so the centred tagline stays centred;
   the real login control is the fixed .lp-login-fixed button. */
.landing-root .lp-masthead-end { justify-self: end; }

@media (max-width: 880px) {
  .landing-root .lp-masthead { grid-template-columns: 1fr auto; }
  .landing-root .lp-tagline { display: none; }
}

/* =============================================================================
   SHARED — section numbers, rules, labels.
   ============================================================================= */
.landing-root .lp-section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: clamp(20px, 3vw, 48px);
  margin-bottom: clamp(40px, 6vh, 88px);
}

.landing-root .lp-section-number {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 400;
  color: var(--lp-accent);
  letter-spacing: -0.02em;
  line-height: 0.85;
}

.landing-root .lp-section-title {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 700;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.0;
  margin: 0;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.landing-root .lp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lp-ink-muted);
  font-weight: 500;
}

/* =============================================================================
   HERO — oversized three-line display type.
   ============================================================================= */
.landing-root .lp-hero {
  position: relative;
  padding: clamp(72px, 13vh, 168px) var(--lp-bleed) clamp(56px, 9vh, 128px);
  border-bottom: 1px solid var(--lp-rule);
  overflow: hidden;
}

.landing-root .lp-hero-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: clamp(40px, 8vh, 100px);
}

/* Overflow fix (#7): the original clamp(72px, 15.5vw, 260px) + a 1.7em indent
   on line 3 pushed the display type past the right bleed on wide viewports.
   Smaller vw factor + cap + gentler indents keep it on-page. */
.landing-root .lp-hero-title {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 40, "wght" 900;
  font-size: clamp(56px, 11.5vw, 172px);
  line-height: 0.84;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 100%;
  color: var(--lp-ink);
  font-weight: 900;
}
.landing-root .lp-hero-title .lp-line { display: block; }
.landing-root .lp-hero-title .lp-line-2 { padding-left: 0.1em; }
.landing-root .lp-hero-title .lp-line-3 { padding-left: 0.9em; }
.landing-root .lp-hero-title .lp-dot { color: var(--lp-accent); display: inline-block; }

.landing-root .lp-hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 80px);
  margin-top: clamp(48px, 8vh, 100px);
  align-items: end;
}

.landing-root .lp-hero-kicker {
  font-family: "Source Serif 4", serif;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.45;
  max-width: 38ch;
  color: var(--lp-ink);
  margin: 0;
}
.landing-root .lp-hero-kicker em { font-style: italic; color: var(--lp-ink-muted); }

.landing-root .lp-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-self: end;
  text-align: right;
}
@media (max-width: 720px) {
  .landing-root .lp-hero-bottom { grid-template-columns: 1fr; }
  .landing-root .lp-hero-cta { justify-self: stretch; text-align: left; }
}

.landing-root .lp-hero-hex {
  position: absolute;
  right: calc(var(--lp-bleed) * 0.35);
  bottom: clamp(24px, 4vh, 60px);
  width: clamp(80px, 10vw, 160px);
  height: auto;
  opacity: 0.5;
  pointer-events: none;
  transform: rotate(-8deg);
}
@media (max-width: 880px) { .landing-root .lp-hero-hex { display: none; } }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.landing-root .lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 14px 22px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--lp-accent);
  background: var(--lp-accent);
  color: #fff;
  cursor: pointer;
  transition: transform 220ms var(--lp-ease), background 220ms var(--lp-ease);
  position: relative;
}
.landing-root .lp-btn:hover {
  background: #fff;
  color: var(--lp-accent);
  transform: translate(-2px, -2px);
}
.landing-root .lp-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--lp-accent);
  transform: translate(2px, 2px);
  z-index: -1;
  transition: transform 220ms var(--lp-ease);
}
.landing-root .lp-btn:hover::before { transform: translate(4px, 4px); }
.landing-root .lp-btn .lp-arrow { display: inline-block; transition: transform 220ms var(--lp-ease); }
.landing-root .lp-btn:hover .lp-arrow { transform: translateX(3px); }

.landing-root .lp-btn.lp-ghost {
  background: transparent;
  color: var(--lp-ink);
  border-color: var(--lp-ink-dim);
}
.landing-root .lp-btn.lp-ghost::before { border-color: var(--lp-ink-dim); }
.landing-root .lp-btn.lp-ghost:hover {
  background: var(--lp-ink);
  color: var(--lp-bg);
  border-color: var(--lp-ink);
}

/* Fixed login button: a touch smaller, with a subtle drop so it reads as
   pinned chrome rather than page content. */
.landing-root .lp-login-fixed .lp-btn {
  padding: 11px 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* =============================================================================
   DISPATCH — three editorial feature blurbs.
   ============================================================================= */
.landing-root .lp-dispatch {
  padding: var(--lp-section-pad) var(--lp-bleed);
  border-bottom: 1px solid var(--lp-rule);
}

.landing-root .lp-features {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  margin-top: clamp(32px, 5vh, 60px);
}

.landing-root .lp-feature {
  grid-column: span 12;
  padding: clamp(32px, 5vh, 56px) 0;
  border-top: 1px solid var(--lp-rule);
  display: grid;
  grid-template-columns: auto 1fr 1.2fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: baseline;
}
.landing-root .lp-feature:last-child { border-bottom: 1px solid var(--lp-rule); }

.landing-root .lp-feature-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--lp-ink-muted);
  letter-spacing: 0.1em;
}

.landing-root .lp-feature-title {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 20, "wght" 700;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--lp-ink);
  max-width: 18ch;
}

.landing-root .lp-feature-body {
  font-size: 17px;
  line-height: 1.62;
  color: var(--lp-ink-muted);
  max-width: 54ch;
  margin: 0;
}
.landing-root .lp-feature-body strong { color: var(--lp-ink); font-weight: 600; }
.landing-root .lp-feature-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  background: var(--lp-bg-elev);
  padding: 0 6px;
  color: var(--lp-ink);
  border-radius: 1px;
}

@media (max-width: 900px) {
  .landing-root .lp-feature { grid-template-columns: 1fr; gap: 18px; }
}

/* =============================================================================
   SYSTEMS — catalog grid.
   ============================================================================= */
.landing-root .lp-systems {
  padding: var(--lp-section-pad) var(--lp-bleed);
  border-bottom: 1px solid var(--lp-rule);
  background: var(--lp-bg-soft);
}

.landing-root .lp-systems-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: clamp(32px, 5vh, 60px);
  border-top: 1px solid var(--lp-rule);
  border-left: 1px solid var(--lp-rule);
}
@media (max-width: 1000px) { .landing-root .lp-systems-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .landing-root .lp-systems-grid { grid-template-columns: 1fr; } }

.landing-root .lp-system {
  padding: clamp(24px, 3vw, 42px);
  border-right: 1px solid var(--lp-rule);
  border-bottom: 1px solid var(--lp-rule);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
  transition: background 220ms var(--lp-ease);
}
/* Cards are links to fan pages — strip the anchor look, keep the card. */
.landing-root a.lp-system {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.landing-root a.lp-system:hover .lp-system-foot { color: var(--lp-accent); }
.landing-root .lp-system:hover { background: var(--lp-bg); }
.landing-root .lp-system:hover .lp-system-name { color: var(--lp-accent); }

.landing-root .lp-system-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.landing-root .lp-system-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--lp-ink-dim);
}

.landing-root .lp-system-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--lp-accent);
  border: 1px solid var(--lp-accent-dim);
  padding: 2px 7px;
}

.landing-root .lp-system-name {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 700;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 8px 0 0;
  color: var(--lp-ink);
  transition: color 220ms var(--lp-ease);
}

.landing-root .lp-system-sub {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--lp-ink-muted);
  margin: 0;
}

.landing-root .lp-system-foot {
  margin-top: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--lp-ink-muted);   /* muted (not dim) so the credit + "View →" meet AA contrast */
  display: flex;
  justify-content: space-between;
}

.landing-root .lp-system.lp-more .lp-system-name { color: var(--lp-ink-dim); }
.landing-root .lp-system.lp-more .lp-system-sub { color: var(--lp-ink-dim); }

/* =============================================================================
   MANIFESTO
   ============================================================================= */
.landing-root .lp-manifesto {
  padding: var(--lp-section-pad) var(--lp-bleed);
  border-bottom: 1px solid var(--lp-rule);
}

.landing-root .lp-manifesto-body {
  max-width: 56ch;
  margin-top: clamp(32px, 5vh, 60px);
  font-family: "Source Serif 4", serif;
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.52;
  color: var(--lp-ink);
}
.landing-root .lp-manifesto-body p { margin: 0 0 1.2em; }
.landing-root .lp-manifesto-body p:last-child { margin-bottom: 0; }
.landing-root .lp-manifesto-body strong {
  font-weight: 600;
  color: var(--lp-ink);
  background: linear-gradient(transparent 65%, rgba(230, 57, 70, 0.25) 65%);
  padding: 0 2px;
}
.landing-root .lp-manifesto-body em { color: var(--lp-ink-muted); }

/* =============================================================================
   CTA — open-registration call.
   ============================================================================= */
.landing-root .lp-cta {
  padding: var(--lp-section-pad) var(--lp-bleed);
  border-bottom: 1px solid var(--lp-rule);
}

.landing-root .lp-cta-headline {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 900;
  font-size: clamp(48px, 8.5vw, 132px);
  line-height: 0.86;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 12ch;
}
.landing-root .lp-cta-headline .lp-free {
  color: var(--lp-accent);
}

.landing-root .lp-cta-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 100px);
  margin-top: clamp(40px, 6vh, 80px);
  align-items: start;
}

.landing-root .lp-cta-prose {
  font-family: "Source Serif 4", serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--lp-ink-muted);
  max-width: 52ch;
}
.landing-root .lp-cta-prose p { margin: 0 0 1em; }
.landing-root .lp-cta-prose strong { color: var(--lp-ink); font-weight: 600; }

.landing-root .lp-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(28px, 4vh, 44px);
}

@media (max-width: 900px) {
  .landing-root .lp-cta-body { grid-template-columns: 1fr; }
}

/* =============================================================================
   COLOPHON — print-style footer.
   ============================================================================= */
.landing-root .lp-colophon {
  padding: clamp(60px, 10vh, 120px) var(--lp-bleed);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--lp-ink-muted);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 4vw, 80px);
  border-top: 1px solid var(--lp-rule);
}
@media (max-width: 900px) { .landing-root .lp-colophon { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .landing-root .lp-colophon { grid-template-columns: 1fr; } }

.landing-root .lp-colophon h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lp-accent);
  margin: 0 0 14px;
  font-weight: 500;
}
.landing-root .lp-colophon p { margin: 0 0 0.6em; line-height: 1.7; }
.landing-root .lp-colophon a { color: var(--lp-ink); text-decoration: none; border-bottom: 1px solid var(--lp-ink-dim); }
.landing-root .lp-colophon a:hover { color: var(--lp-accent); border-bottom-color: var(--lp-accent); }

.landing-root .lp-colophon-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--lp-rule);
  margin-top: 32px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--lp-ink-dim);
  font-size: 11px;
}

/* =============================================================================
   Inline links
   ============================================================================= */
.landing-root a.lp-inline {
  color: var(--lp-ink);
  text-decoration: none;
  background-image: linear-gradient(var(--lp-accent), var(--lp-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 260ms var(--lp-ease), color 260ms var(--lp-ease);
  padding-bottom: 1px;
}
.landing-root a.lp-inline:hover { background-size: 100% 100%; color: #fff; }

/* =============================================================================
   Hero load-in animation (pure CSS; the original IntersectionObserver scroll
   reveal is dropped — content renders visible by default so nothing depends on
   JS that the SPA doesn't ship for this view).
   ============================================================================= */
@keyframes lp-reveal-up {
  from { opacity: 0; transform: translateY(1.2em); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes lp-reveal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.landing-root .lp-hero .lp-animate {
  opacity: 0;
  animation: lp-reveal-up 1.1s var(--lp-ease) forwards;
}
.landing-root .lp-hero .lp-line-1 { animation-delay: 0.12s; }
.landing-root .lp-hero .lp-line-2 { animation-delay: 0.28s; }
.landing-root .lp-hero .lp-line-3 { animation-delay: 0.44s; }
.landing-root .lp-hero .lp-hero-kicker { animation-delay: 0.70s; }
.landing-root .lp-hero .lp-hero-cta    { animation-delay: 0.84s; }
.landing-root .lp-hero .lp-hero-hex {
  animation: lp-reveal-fade 1.6s 0.5s var(--lp-ease) forwards;
  opacity: 0;
}
.landing-root .lp-hero-meta > * {
  opacity: 0;
  animation: lp-reveal-fade 0.9s 0.05s var(--lp-ease) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .landing-root .lp-hero .lp-animate,
  .landing-root .lp-hero-meta > *,
  .landing-root .lp-hero .lp-hero-hex {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
