/* Palette Town — landing page. Loaded after style.css; relies on its tokens. */

html, body { height: auto; overflow: auto; }
body.landing { min-height: 100vh; }
a { color: inherit; }
.logo-link, .nav-link { text-decoration: none; }
.toolbar-right { flex-wrap: wrap; justify-content: flex-end; }

.landing-main {
  max-width: 1040px; margin: 0 auto; padding: 24px 18px 72px;
  display: flex; flex-direction: column; gap: 72px;
}
.landing-main h1, .landing-main h2, .landing-main h3, .landing-footer h2 { font-family: var(--font-display); }
.landing-main p { color: var(--ink-2); font-weight: 600; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* hero */
.hero-block { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: 24px; }
.hero-block h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -.01em; max-width: 14ch; }
.hero-block .lead { font-size: 18px; max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn-lg { padding: 14px 24px; font-size: 16px; text-decoration: none; }
.btn.btn-lg:not(.btn-primary) { background: var(--clay); }

.hero-palette {
  display: grid; grid-template-columns: repeat(5, 1fr);
  width: 100%; margin-top: 14px; min-height: 260px;
  border-radius: var(--r); overflow: hidden; box-shadow: var(--clay-shadow);
  text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.hero-palette:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow-hover); }
.hero-palette:active { transform: translateY(1px); box-shadow: var(--clay-pressed); }
.hero-palette:focus-visible { outline: 3px solid var(--pop-4); outline-offset: 3px; }
.hero-col { display: flex; align-items: flex-end; justify-content: center; padding: 18px 8px; transition: background .35s var(--ease-out); min-width: 0; }
.hero-hex { font-family: var(--font-display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.hero-hint { font-size: 13px; }

/* sections */
.section h2 { font-size: 28px; margin-bottom: 22px; }
.grid { list-style: none; display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Tools: 3 on top, 2 on the bottom row nested in the gaps between 1-2 and 2-3. */
.grid-tools { grid-template-columns: repeat(6, 1fr); }
.grid-tools li:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.grid-tools li:nth-child(2) { grid-column: 3 / 5; grid-row: 1; }
.grid-tools li:nth-child(3) { grid-column: 5 / 7; grid-row: 1; }
.grid-tools li:nth-child(4) { grid-column: 2 / 4; grid-row: 2; }
.grid-tools li:nth-child(5) { grid-column: 4 / 6; grid-row: 2; }
.card {
  display: block; background: var(--clay); border-radius: var(--r); padding: 22px;
  box-shadow: var(--clay-shadow); text-decoration: none; height: 100%;
}
.card h3, .plain h3 { font-size: 17px; margin-bottom: 6px; }
.card p, .plain p { font-size: 14px; }
.card-link { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow-hover); }
.card-link:active { transform: translateY(1px); box-shadow: var(--clay-pressed); }
.plain li { padding: 4px 0; }

/* footer */
.landing-footer {
  max-width: 1040px; margin: 0 auto; padding: 0 18px 40px;
  display: flex; flex-direction: column; gap: 14px; color: var(--muted); font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.more-apps h2 { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.more-apps ul { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; }
.more-apps a { text-decoration: none; }
.more-apps[hidden] { display: none; }

@media (max-width: 760px) {
  .desktop-only { display: none; }
  .landing-main { gap: 52px; padding-bottom: 48px; }
  .grid-3, .grid-4, .grid-tools { grid-template-columns: 1fr; }
  .grid-tools li:nth-child(n) { grid-column: auto; grid-row: auto; }
  .hero-palette { min-height: 64px; height: 84px; }
  .hero-col { padding: 8px 4px; }
  .hero-hex { font-size: 11px; }
  .section h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-palette, .hero-col, .card-link { transition: none; }
}

/* Cursor tile-flip background (landing-tiles.js). Sits above body's own
   background (which paints ahead of negative z-index) but below all real
   content, which is why the content wrappers get z-index: 1 here. */
.tile-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.landing-main, .landing-footer { position: relative; z-index: 1; }
/* Only the bare text that has no card/chrome of its own needs an opaque
   backing (so the trail can't render through/behind it) — everything else
   (gaps, margins, the hero, cards) stays open for the trail to animate over. */
.grid.plain li, .footer-links, .more-apps h2, .more-apps li { background: var(--bg); }
