/* Kardio website — shared styles. Brand tokens mirror constants/tokens.ts in the app. */

:root {
  --navy: #0B364E;
  --navy-deep: #0E4A6B;
  --amber: #FFAC2A;
  --coral: #F44E23;
  --cream: #FEF4E9;
  --ink: #0B1F2E;

  --bg: var(--cream);
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F7EADB;
  --text: var(--navy);
  --text-muted: #4F6B85;
  --primary: var(--navy);
  --on-primary: #FFFFFF;
  --accent: var(--amber);
  --border: #EFE1CB;
  --border-strong: #CFC0A8;
  --shadow: rgba(11, 54, 78, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --gutter: 20px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --bg-elevated: #14293A;
    --bg-subtle: #1B3348;
    --text: #F5EFE6;
    --text-muted: #B9C6D3;
    --primary: var(--amber);
    --on-primary: var(--navy);
    --accent: var(--coral);
    --border: #24384D;
    --border-strong: #35506A;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

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

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

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.2em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.6em;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

li {
  margin-bottom: 0.35em;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: var(--bg-subtle);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img.mark {
  height: 36px;
  width: auto;
}

.brand img.wordmark {
  height: 26px;
  width: auto;
}

.brand .wordmark-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand .wordmark-light {
    display: none;
  }

  .brand .wordmark-dark {
    display: inline;
  }
}

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

.site-nav a {
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
}

main {
  flex: 1;
}

/* Landing */
.hero {
  padding: clamp(48px, 9vw, 96px) 0 40px;
  text-align: center;
}

.hero img.hero-mark {
  height: clamp(96px, 18vw, 150px);
  width: auto;
  margin-bottom: 20px;
}

.hero .pitch {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--text-muted);
  max-width: 34ch;
  margin: 0 auto 28px;
}

.hero h1 {
  margin-bottom: 8px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: #FFFFFF;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  min-height: 56px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}

.store-badge small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.store-badge svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: currentColor;
}

.store-note {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.features {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin: 24px 0 64px;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: 0 6px 18px var(--shadow);
}

.feature .icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.feature .icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h2 {
  font-size: 1.15rem;
  margin: 0 0 6px;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Document pages (privacy, terms, support, delete) */
.doc {
  max-width: var(--measure);
  padding: 32px var(--gutter) 64px;
  margin: 0 auto;
}

.doc .meta {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.notice {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 12px;
  min-height: 32px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95rem;
}

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

th {
  font-weight: 700;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

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

.site-footer a {
  color: var(--text-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

/* Mark variants follow the colour scheme, like the wordmark. */
.mark-dark { display: none; }
@media (prefers-color-scheme: dark) { .mark-light { display: none; } .mark-dark { display: inline-block; } }
