/* Happy Trailing website — Green Deck design system (see DESIGN.md). Dark-first, green accent. */

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --primary: #1DB954;
  --primary-hover: #1ED760;
  --secondary: #535353;
  --neutral: #B3B3B3;
  --background: #121212;
  --surface: #181818;
  --surface-2: #282828;
  --surface-3: #333333;
  --text-primary: #FFFFFF;
  --text-secondary: #A7A7A7;
  --border: #282828;
  --warning: #F59B23;
  --error: #E22134;
  --font-sans: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--background);
}

body {
  background: var(--background);
  color: var(--neutral);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.57; /* 14/22 */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

img {
  max-width: 100%;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 0 0 4px 0;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */

.site-header {
  background: #000000;
  height: 63px;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--neutral);
  font-weight: 700;
  font-size: 14px;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.is-active {
  color: var(--text-primary);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 32px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 150ms ease, background-color 150ms ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--text-primary);
  transform: scale(1.04);
}

.btn-secondary {
  border: 1px solid #727272;
  color: var(--text-primary);
  background: transparent;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-small {
  height: 32px;
  padding: 0 24px;
  font-size: 12px;
}

.btn.is-disabled {
  color: var(--text-secondary);
  border-color: var(--surface-3);
  cursor: default;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* ---------- Hero ---------- */

.hero {
  max-width: 1600px;
  margin: 0 auto;
  padding: 96px 32px 64px;
}

.hero h1 {
  color: var(--text-primary);
  font-size: 64px;
  line-height: 1.125; /* 64/72 */
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 900px;
}

.hero .lead {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 640px;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Sections & cards ---------- */

.section {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 32px;
}

.overline {
  color: var(--primary);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section h2 {
  color: var(--text-primary);
  font-size: 32px;
  line-height: 1.25; /* 32/40 */
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section > p {
  max-width: 720px;
  margin-bottom: 16px;
}

.manual-grid {
  margin-top: 40px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  transition: background-color 200ms ease;
  display: block;
  color: inherit;
}

.card:hover {
  background: var(--surface-2);
  color: inherit;
}

.card h3 {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.375; /* 16/22 */
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-secondary);
}

/* ---------- Store badges ---------- */

.store-badges {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.store-badges .caption {
  width: 100%;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

/* ---------- Article (manual + legal) ---------- */

.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 32px;
}

.article-header .overline {
  margin-bottom: 8px;
}

.article h1 {
  color: var(--text-primary);
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.article .lead {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.article-section {
  margin-top: 40px;
}

.article-section h2 {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.333; /* 24/32 */
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.article-section p {
  margin-bottom: 16px;
}

.points {
  list-style: none;
  margin-bottom: 16px;
}

.points li {
  padding: 8px 0 8px 24px;
  position: relative;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--primary);
}

.see-also {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.see-also .label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 9999px;
  padding: 4px 12px;
  margin: 0 8px 8px 0;
  font-weight: 500;
}

.chip:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.legal-note {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---------- Footer ---------- */

.site-footer {
  background: #000000;
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.footer-links a {
  color: var(--neutral);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-rights {
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.45;
}

/* ---------- Language redirect fallback ---------- */

.redirect-fallback {
  max-width: 720px;
  margin: 96px auto;
  padding: 0 32px;
  text-align: center;
}

.redirect-fallback a {
  color: var(--primary);
  font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .header-inner,
  .hero,
  .section,
  .article,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero .lead {
    font-size: 16px;
  }

  .site-nav {
    gap: 12px;
  }

  .btn {
    padding: 0 20px;
  }

  .site-footer {
    padding: 24px 0;
  }

  .footer-inner {
    gap: 16px;
  }

  .footer-links {
    gap: 16px;
  }
}

@media (max-width: 420px) {
  .brand span {
    display: none;
  }
}
