/*
 * Shelf landing page. Tokens and the landing styles are ported from the app's
 * design system (web/src/styles/global.css) so the two look the same; keep
 * them in step when the app's change.
 */

:root {
  --accent: #eab308;
  --accent-ink: #1c1500;
  /* The accent as text: yellow on white needs darkening to stay readable. */
  --accent-text: color-mix(in oklab, var(--accent) 80%, black 15%);
  --bg: #ffffff;
  --bg-soft: color-mix(in oklab, var(--fg) 3%, var(--bg));
  --fg: #14140f;
  --fg-soft: #57564c;
  --muted: color-mix(in oklab, var(--fg-soft) 65%, var(--bg));
  --line: rgba(20, 20, 15, 0.12);
  --line-soft: rgba(20, 20, 15, 0.07);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 10px;
  --shadow: 0 1px 0 rgba(20, 20, 19, 0.04), 0 8px 24px -16px rgba(20, 20, 19, 0.18);

  --maxw: 960px;
  --maxw-wide: 1180px;
  --pad-x: clamp(20px, 5vw, 64px);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* Dark: set on <html> by js/theme.js and the toggle; without JS, follow the
   OS setting. The two blocks must stay identical. */
[data-theme="dark"] {
  --accent: #facc15;
  --accent-ink: #171300;
  --accent-text: var(--accent);
  --bg: #121210;
  --bg-soft: #1a1a17;
  --fg: #f3f2ea;
  --fg-soft: #a8a79c;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 8px 24px -16px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --accent: #facc15;
    --accent-ink: #171300;
    --accent-text: var(--accent);
    --bg: #121210;
    --bg-soft: #1a1a17;
    --fg: #f3f2ea;
    --fg-soft: #a8a79c;
    --line: rgba(255, 255, 255, 0.12);
    --line-soft: rgba(255, 255, 255, 0.07);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 8px 24px -16px rgba(0, 0, 0, 0.6);

    color-scheme: dark;
  }
}

/* Base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

html,
body {
  margin: 0;
  padding: 0;
  transition: background-color 220ms ease, color 220ms ease;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

p {
  color: var(--fg-soft);
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--pad-x) * 2);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.container--wide {
  max-width: calc(var(--maxw-wide) + var(--pad-x) * 2);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}

/* Type */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}

.section-eyebrow {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  max-width: 840px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--fg);
}

.display em,
.section-title em {
  font-style: italic;
  color: var(--accent-text);
}

.lede {
  max-width: 60ch;
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.7;
  text-wrap: pretty;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(26px, 3.5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
}

h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 140ms ease, background-color 140ms ease, border-color 140ms ease,
    color 140ms ease;
}

.btn:disabled {
  opacity: 0.55;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn--primary {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover:not(:disabled),
.btn--accent:hover:not(:disabled) {
  opacity: 0.82;
}

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

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--fg-soft);
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.nav-brand {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.nav-brand-dot {
  color: var(--accent-text);
}

.nav-brand-mark {
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-soft);
  transition: background-color 140ms ease, color 140ms ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--bg-soft);
  color: var(--fg);
}

.nav-links .btn {
  margin-left: 4px;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg-soft);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--fg-soft);
  color: var(--fg);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* Landing */

.hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 10vw, 120px);
  animation: fade-up 360ms var(--ease-out) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.section {
  padding: clamp(64px, 10vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-sub {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.65;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 160ms ease;
}

.feature-card:hover {
  border-color: var(--accent);
}

.feature-card .kicker {
  display: block;
  margin-bottom: 18px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */

.footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-lockup,
.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  border-bottom: 1px solid transparent;
  font-size: 13px;
  color: var(--fg-soft);
  transition: color 140ms ease, border-color 140ms ease;
}

.footer-links a:hover {
  border-bottom-color: var(--accent-text);
  color: var(--accent-text);
}

.footer-copy {
  flex-basis: 100%;
  text-align: right;
}

/* Landing-only */

[hidden] {
  display: none !important;
}

/* The toggle shows the theme you would switch to. */
.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Narrow phones (390px): brand, the account button and the toggle share one
   line. */
@media (max-width: 480px) {
  .nav-inner {
    gap: 2px;
  }

  .nav-brand-mark {
    width: 18px;
    height: 18px;
    margin-right: 4px;
  }

  .theme-toggle {
    flex: none;
    width: 32px;
    height: 32px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .footer-copy {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
