/*
 * After Hours styles for the static Support, Privacy and Terms pages.
 * Values mirror afterHoursTokens in src/theme.ts. The pages follow the
 * saved light/dark choice (localStorage "themeMode"), otherwise the system setting.
 */
:root {
  --ink: #0d1114;
  --header: #080d11;
  --surface: #141c23;
  --raised: #18212a;
  --line: #2c3339;
  --text: #f8f9fb;
  --muted: #b2bac2;
  --body: #c0c8d4;
  --action: #096cdd;
  --link: #2d9bff;
  --progress: #a666ff;
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --ink: #f4f6f8;
  --header: #ffffff;
  --surface: #ffffff;
  --raised: #e9edf1;
  --line: #d9dee3;
  --text: #0d1114;
  --muted: #4a5560;
  --body: #2f3742;
  --link: #0a5fc2;
  --progress: #7339d0;
  color-scheme: light;
}

/* No saved choice: follow the visitor's system setting. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --ink: #f4f6f8;
    --header: #ffffff;
    --surface: #ffffff;
    --raised: #e9edf1;
    --line: #d9dee3;
    --text: #0d1114;
    --muted: #4a5560;
    --body: #2f3742;
    --link: #0a5fc2;
    --progress: #7339d0;
    color-scheme: light;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--ink);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
}

a:focus-visible {
  outline: 3px solid var(--progress);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(45, 155, 255, 0.3);
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

header .container {
  max-width: 1160px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background-image: url('/app-icon.png');
  background-size: cover;
  background-position: center;
  border-radius: 9px;
}

.logo-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.back-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
}

.back-btn:hover {
  color: var(--link);
}

/* Document (main also carries .container, so match both to keep the vertical padding) */
main.container {
  padding-top: 56px;
  padding-bottom: 72px;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
}

.last-updated,
.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.subtitle {
  font-size: 17px;
}

.last-updated strong {
  color: var(--text);
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 48px 0 18px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.last-updated + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

h2[id] {
  scroll-margin-top: 24px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 30px 0 12px;
  color: var(--text);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

p {
  margin-bottom: 15px;
  font-size: 15px;
  color: var(--body);
}

ul,
ol {
  margin: 15px 0 18px 24px;
}

li {
  margin-bottom: 9px;
  padding-left: 4px;
  font-size: 15px;
  color: var(--body);
}

li::marker {
  color: var(--link);
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* Callouts */
.highlight,
.contact-method {
  background: var(--raised);
  border-left: 2px solid var(--link);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
}

.highlight > :first-child,
.contact-method > :first-child {
  margin-top: 0;
}

.highlight > :last-child,
.contact-method > :last-child,
.contact-info > :last-child,
.support-card > :last-child,
.faq-item > :last-child {
  margin-bottom: 0;
}

.contact-info,
.support-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  margin: 32px 0;
}

.contact-info h3,
.support-card h3 {
  margin-top: 0;
}

.support-card a,
.contact-method a,
.faq-answer a {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.support-card a:hover,
.contact-method a:hover,
.faq-answer a:hover {
  color: var(--text);
}

.contact-method h4 {
  font-size: 1.05rem;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 20px 0 6px;
  margin: 0;
}

.faq-item:last-of-type {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.faq-question {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-answer {
  color: var(--body);
}

/* support.html sets one paragraph colour inline for the old dark-only design. */
main p[style] {
  color: var(--muted) !important;
}

/* Footer */
footer {
  background: var(--header);
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  color: var(--muted);
}

footer p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

footer .trademarks {
  font-size: 11px;
  line-height: 1.6;
  margin-top: 10px;
  max-width: 760px;
}

.logo-text .tm {
  font-size: 0.5em;
  font-weight: 500;
  margin-left: 1px;
}

@media (max-width: 620px) {
  .container {
    padding: 0 16px;
  }

  .header-content {
    min-height: 64px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .logo-text {
    font-size: 19px;
  }

  main.container {
    padding-top: 36px;
    padding-bottom: 56px;
  }

  h2 {
    font-size: 1.3rem;
    margin-top: 40px;
    padding-top: 26px;
  }

  .contact-info,
  .support-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  :root {
    --ink: #fff;
    --header: #fff;
    --surface: #fff;
    --raised: #fff;
    --text: #000;
    --muted: #333;
    --body: #222;
  }

  header,
  footer {
    display: none;
  }
}
