/*
 * Swappt website: shared tokens, base type, header, footer, buttons and the
 * legal pages. The look follows the 1.1 app (docs/design/fashion-1.1.md):
 * Outfit, the Stitch pinks, white and near-white surfaces, soft shadows,
 * pills, almost no borders. Home page styles are in home.css.
 */

:root {
  --primary: #b70054;
  --primary-strong: #8f0041;
  --primary-container: #e1126b;
  --on-primary: #ffffff;
  --primary-fixed: #ffd9e0;
  --primary-fixed-strong: #ffc5d2;
  --on-primary-fixed: #3f0019;
  --surface: #fcf8fd;
  --surface-lowest: #ffffff;
  --surface-low: #f6f2f7;
  --surface-container: #f1edf1;
  --surface-high: #ebe7eb;
  --on-surface: #1c1b1e;
  --on-surface-variant: #5b3f45;
  --secondary: #605e60;
  --inverse-surface: #313033;
  --inverse-on-surface: #f3eff4;
  --tertiary-fixed: #f3dde5;
  --on-tertiary-fixed: #24181e;
  --hairline: rgba(28, 27, 30, 0.08);

  --shadow-soft: 0 1px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(28, 27, 30, 0.04), 0 12px 32px -12px rgba(28, 27, 30, 0.12);
  --shadow-button: 0 8px 20px -8px rgba(183, 0, 84, 0.55);

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --page: 16px;
  --header-h: 64px;
  --font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: light;
}

@media (min-width: 768px) {
  :root {
    --page: 32px;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--primary-container);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: calc(1200px + 2 * var(--page));
  margin-inline: auto;
  padding-inline: var(--page);
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}

/* ---------- Brand lockup: the mark and the SWAPPT wordmark ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--on-surface);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.wordmark {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 248, 253, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: var(--shadow-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.site-nav {
  flex: 1;
}

.nav-links {
  display: none;
  margin: 0;
  padding: 0 0 0 16px;
  list-style: none;
  gap: 4px;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  color: var(--on-surface-variant);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--surface-low);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn-sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-tonal {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed);
}

.btn-tonal:hover {
  background: var(--primary-fixed-strong);
}

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

.site-footer {
  padding: 48px 0 40px;
  background: var(--surface-lowest);
  box-shadow: 0 -1px 0 var(--hairline);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.footer-tagline {
  margin-top: 4px;
  color: var(--on-surface-variant);
  font-size: 14px;
}

.footer-copy {
  margin-top: 16px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin: 0 0 0 -8px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

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

/* ---------- Legal pages (privacy, terms, delete account) ---------- */

.legal {
  padding: 48px 0 80px;
}

.legal .container {
  max-width: calc(720px + 2 * var(--page));
}

.legal h1 {
  font-size: clamp(34px, 6vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.legal .updated {
  margin: 12px 0 40px;
  color: var(--on-surface-variant);
  font-size: 14px;
}

.legal h2 {
  margin: 40px 0 12px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  font-size: 16px;
  line-height: 1.65;
}

.legal p {
  margin-bottom: 12px;
}

.legal ul,
.legal ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal li {
  margin-bottom: 6px;
}

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

.legal strong {
  font-weight: 600;
}

.legal a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legal a:hover {
  text-decoration-thickness: 2px;
}

.legal code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-container);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.legal .callout {
  margin-bottom: 16px;
  padding: 16px 20px;
  border-left: 4px solid var(--primary-container);
  border-radius: var(--radius-lg);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-card);
}

.legal .callout p:last-child {
  margin-bottom: 0;
}
