/* Standalone pages (privacy, terms, support) — lightweight styles.
   Uses design token CSS variables from /dist/design-tokens.css for
   visual consistency with Graph Paper. */

@font-face {
  font-family: "GraphPaperSatoshi";
  src: url("/dist/fonts/Satoshi-Variable.woff2")
    format("woff2-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GraphPaperSatoshi";
  src: url("/dist/fonts/Satoshi-VariableItalic.woff2")
    format("woff2-variations");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--_tycho-font-system);
  font-size: var(--_tycho-font-size-lg);
  line-height: 1.6;
  color: var(--_tycho-color-text);
  background: var(--_tycho-color-bg);
}

/* ── Header (matches Graph Paper app-frame header) ── */

.static-header {
  position: sticky;
  top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  height: 52px;
  max-width: 767px;
  margin: 4px auto 0;
  z-index: 10;
  border-radius: 100px;
  /* Floating-glass tier (mirrors glassSurfaceStyles("floating") in
     src/ui/tokens/glass.ts — the tokens ship in /dist/design-tokens.css). */
  background: var(--_tycho-glass-bg);
  -webkit-backdrop-filter: var(--_tycho-glass-backdrop);
  backdrop-filter: var(--_tycho-glass-backdrop);
  box-shadow: var(--_tycho-glass-highlight), var(--_tycho-glass-shadow);
}

/* Directional rim ring (mirrors glassRimRule in src/ui/tokens/glass.ts). */
.static-header::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px; /* ring thickness */
  border-radius: inherit;
  background: var(--_tycho-glass-rim);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Forced colors strips gradients and box-shadows; a real border on the
   ring pseudo restores the header boundary (mirrors glassRimRule). */
@media (forced-colors: active) {
  .static-header::before {
    padding: 0;
    background: none;
    -webkit-mask: none;
    mask: none;
    border: 1px solid CanvasText;
  }
}

@media (max-width: 768px) {
  .static-header {
    /* relative, not static: the rim ring ::before positions against the
       header (sticky establishes that on wide viewports). */
    position: relative;
    top: 0;
    margin: 0;
    border-radius: 0;
    max-width: none;
  }
}

.static-header a {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--_tycho-transition-fast);
}

.static-header a:hover {
  opacity: 0.7;
}

/* ── Content ── */

.static-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.static-content h1 {
  font-size: var(--_tycho-font-size-3xl);
  font-weight: var(--_tycho-font-weight-semibold);
  margin: 0 0 8px;
  line-height: 1.3;
}

.static-content .last-updated {
  color: var(--_tycho-color-text-subtle);
  font-size: var(--_tycho-font-size-base);
  margin: 0 0 32px;
}

.static-content h2 {
  font-size: var(--_tycho-font-size-xl);
  font-weight: var(--_tycho-font-weight-semibold);
  margin: 32px 0 12px;
  line-height: 1.3;
}

.static-content p {
  margin: 0 0 16px;
}

.static-content ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.static-content li {
  margin-bottom: 6px;
}

.static-content a {
  color: var(--_tycho-color-link);
  text-decoration: none;
}

.static-content a:hover {
  text-decoration: underline;
}

/* ── Footer ── */

/* Shared footer chrome (scripts/lib/site/site-chrome.mjs) — used by every
 * static page. Mirrors the SPA footer (.gp-footer*) in site-footer.ts:
 * centered brand tagline on top, then a single centered row of nav links,
 * constrained to the header width. */
.static-footer {
  max-width: 767px;
  margin: 0 auto;
  padding: 42px 24px 56px;
  text-align: center;
  border-top: 1px solid var(--_tycho-color-border-subtle);
  font-size: var(--_tycho-font-size-base);
  color: var(--_tycho-color-text-muted);
}

.static-footer > p {
  margin: 0 0 28px;
  font-family: var(--_tycho-font-system);
  font-size: 1.2rem;
  color: var(--_tycho-color-text-muted);
}

.static-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.static-footer nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

.static-footer a {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--_tycho-color-text-muted);
  text-decoration: none;
}

.static-footer a:hover {
  color: var(--_tycho-color-link);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .static-footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
}

/* ── Landing page ──
 * Mirrors the SPA onboarding (src/graph-paper/onboarding/styles.ts): same
 * sections, same design tokens, so the no-JS landing matches the SPA and is
 * theme-reactive (works in dark mode). The two rule sets are kept separate
 * (one runtime-injected, one static) but parallel. */

#static-landing {
  min-height: 100vh;
  background-image:
    linear-gradient(rgb(90 110 150 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(90 110 150 / 0.04) 1px, transparent 1px);
  background-position: center top;
  background-size: 24px 24px;
}

.landing {
  color: var(--_tycho-color-text);
}

/* ── Hero ── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(480px, 1.18fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.landing-hero-copy {
  min-width: 0;
}

.landing-eyebrow {
  margin: 0 0 18px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--_tycho-color-primary);
}

.landing-hero h1 {
  max-width: 530px;
  margin: 0 0 24px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: clamp(3.35rem, 5.4vw, 4.9rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0;
  color: var(--_tycho-color-text);
}

/* Rainbow-blob fill clipped to the hero heading, mirrored from the Farfield
   Studio landing (and the SPA's .hero-heading in onboarding/styles.ts — keep
   the two in step). The opaque base linear layer guarantees no glyph ever
   clips to nothing; three radial blobs add depth and drift slowly across the
   letters via the oversized background-size. The base rule above keeps a
   solid theme-aware color as the fallback for engines without clip:text. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .landing-hero h1 {
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image:
      radial-gradient(38% 64% at 22% 28%, #f87c85 0%, transparent 56%),
      radial-gradient(42% 70% at 74% 72%, #4981bf 0%, transparent 56%),
      radial-gradient(36% 60% at 88% 22%, #86a035 0%, transparent 56%),
      linear-gradient(
        115deg,
        #e84333 0%,
        #e4ba27 22%,
        #86a035 42%,
        #4981bf 62%,
        #924789 82%,
        #b5285f 100%
      );
    background-size: 220% 220%;
    background-position: 0% 25%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: heroRainbowDrift 18s ease-in-out infinite;
  }
}

@keyframes heroRainbowDrift {
  0% {
    background-position: 0% 25%;
  }

  25% {
    background-position: 55% 100%;
  }

  50% {
    background-position: 100% 60%;
  }

  75% {
    background-position: 45% 0%;
  }

  100% {
    background-position: 0% 25%;
  }
}

.landing-hero .tagline {
  max-width: 480px;
  margin: 0 0 30px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--_tycho-color-text-muted);
}

.landing-positioning {
  max-width: 500px;
  margin: -14px 0 30px;
  padding-left: 16px;
  border-left: 2px solid
    color-mix(in srgb, var(--_tycho-color-primary) 46%, transparent);
  color: var(--_tycho-color-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.landing-cta-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--_tycho-color-text-muted);
}

.landing-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--_tycho-color-secondary);
  border-radius: 100px;
  font: 700 1rem/1 var(--_tycho-font-system);
  text-decoration: none;
  transition:
    background var(--_tycho-transition-fast),
    color var(--_tycho-transition-fast),
    transform var(--_tycho-transition-fast);
}

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

.landing-button-primary {
  color: white;
  background: var(--_tycho-color-secondary);
}

.landing-button-secondary {
  color: var(--_tycho-color-secondary);
  background: color-mix(in srgb, var(--_tycho-color-bg) 88%, transparent);
}

.landing-button-secondary:hover {
  background: color-mix(
    in srgb,
    var(--_tycho-color-secondary) 8%,
    var(--_tycho-color-bg)
  );
}

/* ── Hero screenshot carousel ──
   Data-driven stacked-card rotation mirroring the SPA (.hero-carousel-stage in
   src/graph-paper/onboarding/styles.ts — keep the two in sync). The cards
   (Showcase links), progress dots, and legend are generated from HERO_CAROUSEL
   by the landing build; each card's per-slot pose + phase delay and the shared
   --hero-cycle duration are inline, and the @keyframes (heroCarouselCycle /
   heroCarouselDot / heroCarouselLegend) are injected per-page for the current
   card count. ── */
.hero-carousel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-carousel {
  position: relative;
  width: 100%;
  min-height: 590px;
}

.hero-carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 580px);
  border-radius: 12px;
  text-decoration: none;
  animation: heroCarouselCycle var(--hero-cycle, 24s)
    cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.hero-carousel-card:focus-visible {
  outline: 2px solid var(--_tycho-color-primary);
  outline-offset: 4px;
}

.hero-carousel-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

/* Let visitors linger: pause the whole synced animation (cards, dots, legend). */
.hero-carousel-stage:hover .hero-carousel-card,
.hero-carousel-stage:hover .hero-carousel-dot,
.hero-carousel-stage:hover .hero-carousel-legend-item {
  animation-play-state: paused;
}

/* ── Progress dots ── */
.hero-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 4px;
}

.hero-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--_tycho-color-text-muted);
  opacity: 0.32;
  animation: heroCarouselDot var(--hero-cycle, 24s)
    cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

/* ── Legend (front item's title + caption, cross-fading) ── */
.hero-carousel-legend {
  position: relative;
  width: min(100%, 580px);
  min-height: 3.4em;
  margin-top: 14px;
  text-align: center;
}

.hero-carousel-legend-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: heroCarouselLegend var(--hero-cycle, 24s)
    cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.hero-carousel-legend-title {
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--_tycho-color-text);
}

.hero-carousel-legend-caption {
  margin-top: 2px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--_tycho-color-text-muted);
}

.hero-carousel-more {
  margin-top: 16px;
  color: var(--_tycho-color-link);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.hero-carousel-more:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  /* Freeze the carousel in its initial arrangement: cards keep their inline
     per-slot pose, and the first dot/legend item (the front card) stays lit. */
  .hero-carousel-card,
  .hero-carousel-dot,
  .hero-carousel-legend-item {
    animation: none;
  }
  .hero-carousel-dot:first-child {
    opacity: 1;
    background: var(--_tycho-color-primary);
  }
  .hero-carousel-legend-item:first-child {
    opacity: 1;
  }

  /* Keep the rainbow fill, freeze the drift. */
  .landing-hero h1 {
    animation: none;
  }
}

/* ── Featured gallery ── */
.landing-gallery {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
  border-top: 1px solid var(--_tycho-color-border-subtle);
}

.landing-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.landing-section-heading h2 {
  margin: 0 0 8px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--_tycho-color-text);
}

.landing-section-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--_tycho-color-text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.landing-section-heading > a {
  white-space: nowrap;
  color: var(--_tycho-color-link);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.landing-section-heading > a:hover {
  text-decoration: underline;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.landing-card {
  display: block;
  border: 1px solid var(--_tycho-color-border);
  border-radius: 7px;
  overflow: hidden;
  background: color-mix(in srgb, var(--_tycho-color-bg) 94%, transparent);
  box-shadow: var(--_tycho-shadow-md);
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow var(--_tycho-transition-fast),
    transform var(--_tycho-transition-fast);
}

.landing-card:hover {
  box-shadow: var(--_tycho-shadow-lg);
  transform: translateY(-2px);
}

.landing-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.landing-card-body {
  padding: 16px 18px 20px;
}

.landing-card h3 {
  margin: 0 0 6px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--_tycho-color-text);
}

.landing-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--_tycho-color-text-muted);
}

/* ── Feature band ── */
.landing-feature-band {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
  border-top: 1px solid var(--_tycho-color-border-subtle);
}

.landing-feature-band h2 {
  margin: 0 0 36px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--_tycho-color-text);
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-feature-grid article {
  min-width: 0;
  padding: 0 28px;
  border-left: 1px solid var(--_tycho-color-border-subtle);
}

.landing-feature-grid article:first-child {
  padding-left: 0;
  border-left: 0;
}

.landing-feature-icon {
  display: flex;
  align-items: center;
  height: 84px;
  margin-bottom: 18px;
  color: var(--_tycho-color-primary);
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 4rem;
  line-height: 1;
}

.landing-feature-grid h3 {
  margin: 0 0 10px;
  font-family: "GraphPaperSatoshi", var(--_tycho-font-system);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--_tycho-color-text);
}

.landing-feature-grid p {
  margin: 0;
  color: var(--_tycho-color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.landing-js-required {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 56px;
  color: var(--_tycho-color-text-subtle);
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 1040px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-carousel {
    min-height: 460px;
  }

  .hero-carousel-card {
    width: min(86%, 500px);
  }

  .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 36px;
  }

  .landing-feature-grid article:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .landing-grid {
    grid-template-columns: 1fr;
  }

  .landing-section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
    row-gap: 28px;
  }

  .landing-feature-grid article {
    padding-left: 0;
    border-left: 0;
  }

  .landing-feature-icon {
    height: auto;
    margin-bottom: 12px;
    font-size: 3rem;
  }
}

/* ── Gallery: index page ── */

.gallery-index {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.gallery-index > h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 24px 0 12px;
  text-align: center;
}

.gallery-index > main > p,
.gallery-index > p {
  text-align: center;
  color: var(--_tycho-color-text-muted);
  margin: 0 0 48px;
}

.gallery-group {
  margin: 0 0 48px;
}

.gallery-group h2 {
  font-size: var(--_tycho-font-size-2xl);
  font-weight: 600;
  margin: 0 0 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.gallery-card {
  display: block;
  border-radius: 12px;
  border: 1px solid var(--_tycho-color-border);
  overflow: hidden;
  background: var(--_tycho-color-bg);
  text-decoration: none;
  color: var(--_tycho-color-text);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--_tycho-shadow-md);
  text-decoration: none;
}

.gallery-card picture,
.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--_tycho-color-bg);
}

.gallery-card h3 {
  margin: 0;
  padding: 12px 14px 4px;
  font-size: var(--_tycho-font-size-lg);
  font-weight: 600;
  line-height: 1.3;
}

.gallery-card p {
  margin: 0;
  padding: 0 14px 14px;
  font-size: var(--_tycho-font-size-base);
  color: var(--_tycho-color-text-muted);
  line-height: 1.4;
}

/* ── Gallery: item page ── */

.gallery-item {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.gallery-item > h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 24px 0 16px;
  line-height: 1.2;
}

.gallery-hero {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--_tycho-color-border);
  margin: 0 0 24px;
}

.gallery-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--_tycho-color-bg);
}

.gallery-desc {
  font-size: var(--_tycho-font-size-xl);
  color: var(--_tycho-color-text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.gallery-long-desc {
  margin: 0 0 32px;
}

.gallery-long-desc .tycho-md {
  font-size: var(--_tycho-font-size-lg);
  line-height: 1.6;
}

.gallery-noscript-msg {
  color: var(--_tycho-color-text-subtle);
  font-size: var(--_tycho-font-size-base);
  margin: 32px 0 0;
}

/* ── Gallery: related entries (renders in <noscript> on item pages, also
       used as a structural anchor for crawlers). The SPA replaces the
       <noscript> body on hydration. ── */

.gallery-related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--_tycho-color-border);
}

.gallery-related h2 {
  font-size: var(--_tycho-font-size-lg);
  font-weight: 600;
  margin: 0 0 16px;
}

.gallery-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-related-list a {
  display: block;
  border-radius: 10px;
  border: 1px solid var(--_tycho-color-border);
  overflow: hidden;
  text-decoration: none;
  color: var(--_tycho-color-text);
  background: var(--_tycho-color-bg);
}

.gallery-related-list picture,
.gallery-related-list img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--_tycho-color-bg);
}

.gallery-related-list span {
  display: block;
  padding: 10px 12px;
  font-size: var(--_tycho-font-size-base);
  font-weight: 500;
  line-height: 1.3;
}

/* Cross-document view transitions for the marketing pages (landing, showcase,
   tips) and into/out of the SPA shell, which opts in via its own inline style.
   Both ends of a navigation must opt in for the cross-fade to run. Progressive
   enhancement — unsupported browsers navigate normally. Disabled under
   prefers-reduced-motion (accessibility). */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
