/* KeepHold marketing/compliance site — shared styles.
   Tokens mirror src/constants/theme.ts so this site and the app read as one brand. */

:root {
  --text: #14181F;
  --background: #F5F7FA;
  --surface: #ffffff;
  --surface-faint: #EEF1F5;
  --text-secondary: #5C6470;
  --tint: #0154E5;
  --danger: #D0342C;
  --warning: #B45309;
  --border: #E2E8F0;
  --max-width: 760px;
}

/* System preference is the default (no explicit choice made yet). Guarded with
   :not([data-theme="light"]) so an explicit light pick always wins over a dark OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #EAF0FB;
    --background: #0A0F1C;
    --surface: #121B2E;
    --surface-faint: #0E1524;
    --text-secondary: #8E9FB8;
    --tint: #1583FD;
    --danger: #FF6259;
    --warning: #FBBF24;
    --border: #1E2A42;
  }
}

/* Explicit dark choice (theme-toggle.js sets this) - wins regardless of OS setting. */
:root[data-theme="dark"] {
  --text: #EAF0FB;
  --background: #0A0F1C;
  --surface: #121B2E;
  --surface-faint: #0E1524;
  --text-secondary: #8E9FB8;
  --tint: #1583FD;
  --danger: #FF6259;
  --warning: #FBBF24;
  --border: #1E2A42;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

.theme-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.theme-toggle button svg {
  width: 16px;
  height: 16px;
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--tint);
  color: #fff;
}

.theme-toggle button:hover:not([aria-pressed="true"]) {
  color: var(--text);
}

.site-nav a {
  color: var(--text-secondary);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.eyebrow {
  color: var(--tint);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.updated {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 60ch;
}

section {
  margin-top: 40px;
}

section h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

section h3 {
  font-size: 1.05rem;
  margin: 20px 0 8px;
}

p,
li {
  color: var(--text);
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.card + .card {
  margin-top: 16px;
}

.button {
  display: inline-block;
  background: var(--tint);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 8px;
}

.button:hover,
.button:focus-visible {
  text-decoration: none;
  filter: brightness(1.05);
}

.hero {
  text-align: center;
  padding: 56px 0 24px;
}

.hero img {
  width: 72px;
  height: 72px;
  /* drop-shadow (not box-shadow) follows the icon's own rounded alpha shape
     instead of casting a rectangular shadow behind it. */
  filter: drop-shadow(0 8px 16px rgba(1, 84, 229, 0.35));
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 20px 0 8px;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 46ch;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.feature-grid .card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.feature-grid .card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 6px 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note {
  background: var(--surface-faint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

@media (max-width: 480px) {
  .site-header__inner,
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
