/* TrivTime — web styles.
   Tokens mirror apps/mobile/constants/ui.ts so the site reads as the same product. */

@font-face {
  font-family: 'Open Sans';
  src: url('/assets/fonts/OpenSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/assets/fonts/OpenSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/assets/fonts/OpenSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg-start: #ffffff;
  --bg-end: #f7f6f3;
  --ink: #171717;
  --muted: #6b6b6b;
  --subtle: #9c9c9c;
  --border: #e8e2d9;
  --card: #ffffff;
  --accent-soft: #f3f1ee;
  --danger: #e44b4b;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-start) 55%, var(--bg-end) 100%);
  background-attachment: fixed;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

p,
li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ---------- shell ---------- */

.site-shell {
  width: min(1040px, calc(100% - 44px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.site-shell-legal {
  width: min(720px, calc(100% - 40px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 6px 0 34px;
}

.brand,
.footer-brand {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.topnav a,
.footer-links a {
  color: var(--subtle);
  font-size: 0.82rem;
  transition: color 140ms ease;
}

.topnav a:hover,
.footer-links a:hover {
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 0 8px;
}

.hero-mark {
  width: clamp(112px, 17vw, 168px);
  height: auto;
  margin-bottom: 30px;
}

/* Keeps a single h1 for search engines and screen readers without showing it. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.eyebrow,
.panel-label,
.legal-updated {
  margin: 0 0 14px;
  color: var(--subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 16ch;
  font-size: clamp(2.3rem, 6vw, 3.65rem);
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.1rem, 2.2vw, 1.32rem);
  letter-spacing: -0.02em;
}

.lede {
  max-width: 44ch;
  margin: 20px 0 0;
  font-size: 1.02rem;
}

/* On the home page the lede is the only hero copy, so it carries more weight. */
.hero .lede {
  max-width: 30ch;
  margin-top: 0;
  color: var(--ink);
  font-size: clamp(1.32rem, 3vw, 1.72rem);
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  color: #ffffff;
  background: var(--ink);
}

.button-primary:hover {
  background: #000000;
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--accent-soft);
}

/* ---------- feature rows ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 68px;
}

.panel,
.legal-link,
.legal-page section {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.panel h2 {
  margin-bottom: 10px;
}

.panel p:last-child,
.legal-page section p:last-child,
.legal-page section ul:last-child {
  margin-bottom: 0;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.legal-link {
  display: block;
  transition: background 140ms ease, border-color 140ms ease;
}

.legal-link:hover {
  background: var(--accent-soft);
  border-color: var(--subtle);
}

.legal-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.legal-copy {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ---------- legal pages ---------- */

.legal-page {
  display: grid;
  gap: 14px;
  padding-bottom: 40px;
}

.legal-page h1 {
  max-width: none;
  font-size: clamp(2rem, 5vw, 2.9rem);
}

.legal-page > .legal-updated {
  margin: 4px 0 12px;
}

.legal-page section h2 {
  margin-bottom: 12px;
}

.legal-page ul {
  margin: 0;
  padding-left: 20px;
}

.legal-page li + li {
  margin-top: 6px;
}

.legal-page a:not(.button) {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.legal-page a:not(.button):hover {
  border-bottom-color: var(--ink);
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.footer-copy {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 0.82rem;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .feature-grid,
  .legal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 32px, 1040px);
  }

  .topbar {
    padding-bottom: 26px;
  }

  .panel,
  .legal-link,
  .legal-page section {
    padding: 22px;
  }

  .button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
