/* ===================================================
   EarphoneNap — design system
   =================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-badge-bg: #eff6ff;
  --color-badge-text: #1d4ed8;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin-top: 1.5em;
  margin-bottom: 0.375rem;
}

p {
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  text-decoration: underline;
}

/* ---------- Layout ---------- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.brand {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-primary);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: var(--color-primary-dark);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
}

.nav a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 150ms ease;
}

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

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #eff6ff 0%, var(--color-bg) 100%);
  padding: 3.5rem 0;
  text-align: center;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: clamp(1.875rem, 5vw, 2.25rem);
  max-width: 680px;
}

.hero p {
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background: var(--color-badge-bg);
  color: var(--color-badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

/* ---------- Main ---------- */
.main {
  padding: 2rem 0 3rem;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ---------- Card ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.25rem;
}

.card:last-child {
  margin-bottom: 0;
}

.card h2:first-child {
  margin-top: 0;
}

.card h3:first-child {
  margin-top: 0;
}

/* Cards inside .grid have no margin-bottom (gap handles spacing) */
.grid .card {
  margin-bottom: 0;
}

/* ---------- Button ---------- */
.button {
  display: inline-block;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 150ms ease;
  line-height: 1.4;
}

.button:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
  color: #ffffff;
}

/* ---------- Lists ---------- */
.list-tight {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.list-tight:last-child {
  margin-bottom: 0;
}

.list-tight li {
  margin-bottom: 0.375rem;
}

.list-tight li:last-child {
  margin-bottom: 0;
}

.list-tight li::marker {
  color: var(--color-primary);
}

/* ---------- Note ---------- */
.note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  background: var(--color-surface);
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* When footer has only one child div, keep it right-aligned */
.footer .container > div {
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.625rem;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .card {
    padding: 1.25rem 1.25rem;
  }
}
