/* Kilomotion website. One stylesheet for every page; no external requests. */

/* Fonts from the app (apps/mobile/assets/fonts, OFL), subset to Latin with Danish letters and converted to WOFF2. */
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/SpaceGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Colours: the identity (apps/mobile/brand/brand.json) and the app theme (lib/theme/hybridly_theme.dart). */
:root {
  color-scheme: light;
  --bg: #f4f5f0; /* Chalk */
  --surface: #ffffff;
  --raised: #eef1ef;
  --ink: #0e1411;
  --muted: #56625d;
  --line: #d5dcd8;
  --brand: #0e7550; /* Spruce */
  --link: #0e7550;
  --on-brand: #ffffff;
  --soft: rgba(14, 117, 80, 0.08);
  --hero-from: #0e7550;
  --hero-to: #073826; /* Deep spruce */
  --hero-ink: #f4f5f0;
  --hero-mark: #f4f5f0;
  --hero-muted: #d9ece3;
  --hero-line: transparent;
  --chip-bg: rgba(255, 255, 255, 0.14);
  --todo-bg: #fff4d6;
  --todo-ink: #5c4100;
  --todo-line: #8a6100;
  --focus: #0e7550;
  --radius: 16px;
  --gutter: 16px;
  --heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0f0e;
    --surface: #151a18;
    --raised: #1d2321;
    --ink: #eef2f0;
    --muted: #9aa6a1;
    --line: #2a3330;
    --brand: #8fe3bc; /* Mint */
    --link: #8fe3bc;
    --on-brand: #0c0f0e;
    --soft: rgba(143, 227, 188, 0.1);
    --hero-from: #0f3a2a; /* Spruce, deepened for dark */
    --hero-to: #08130e;
    --hero-ink: #eef2f0;
    --hero-mark: #8fe3bc;
    --hero-muted: #c2d6cc;
    --hero-line: rgba(143, 227, 188, 0.18);
    --chip-bg: rgba(143, 227, 188, 0.12);
    --todo-bg: #2b2410;
    --todo-ink: #f2d27a;
    --todo-line: #e0b13a;
    --focus: #8fe3bc;
  }
}

/* The same dark tokens, for a page that sets data-theme="dark" (used by the preview script). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f0e;
  --surface: #151a18;
  --raised: #1d2321;
  --ink: #eef2f0;
  --muted: #9aa6a1;
  --line: #2a3330;
  --brand: #8fe3bc;
  --link: #8fe3bc;
  --on-brand: #0c0f0e;
  --soft: rgba(143, 227, 188, 0.1);
  --hero-from: #0f3a2a; /* Spruce, deepened for dark */
  --hero-to: #08130e;
  --hero-ink: #eef2f0;
  --hero-mark: #8fe3bc;
  --hero-muted: #c2d6cc;
  --hero-line: rgba(143, 227, 188, 0.18);
  --chip-bg: rgba(143, 227, 188, 0.12);
  --todo-bg: #2b2410;
  --todo-ink: #f2d27a;
  --todo-line: #e0b13a;
  --focus: #8fe3bc;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: balance;
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

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

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

li + li {
  margin-top: 0.35em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

strong {
  font-weight: 600;
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  font-size: 0.9em;
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--surface);
  color: var(--ink);
  padding: 0.6em 1em;
  border-radius: 10px;
  border: 2px solid var(--focus);
}

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

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

.narrow {
  max-width: 760px;
}

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  padding: 8px 0;
}

.wordmark {
  display: block;
  height: 24px;
  width: auto;
}

.wordmark .brand-accent,
.mark .brand-accent {
  fill: var(--brand);
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.975rem;
}

.site-nav a:hover {
  background: var(--soft);
}

.site-nav a[aria-current="page"] {
  color: var(--link);
  background: var(--soft);
}

@media (max-width: 480px) {
  .site-header .wrap {
    gap: 8px;
  }

  .wordmark {
    height: 20px;
  }

  .site-nav a {
    padding: 8px;
    font-size: 0.9rem;
  }
}

main {
  display: block;
  padding: 32px 0 56px;
}

/* Home: hero */
.hero {
  background: linear-gradient(150deg, var(--hero-from), var(--hero-to));
  color: var(--hero-ink);
  border: 1px solid var(--hero-line);
  border-radius: 24px;
  padding: 28px 20px 0;
  display: grid;
  gap: 28px;
  align-items: center;
  overflow: hidden;
}

.hero .mark {
  display: block;
  width: 72px;
  height: auto;
  margin-bottom: 20px;
}

.hero .mark .brand-accent {
  fill: var(--hero-mark);
}

.hero h1 {
  max-width: 14em;
  margin-bottom: 0.4em;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--hero-muted);
  max-width: 34em;
  margin-bottom: 1.25em;
}

/* A status, not a button: a soft chip with no border or pointer. */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-weight: 600;
  font-size: 0.95rem;
}

.status-chip svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* Two app screens in phone frames drawn with CSS; they sit on the hero's bottom edge. */
.phones {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.phones li + li {
  margin-top: 0;
}

.phone {
  margin: 0;
  background: #050807;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 7px 7px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 900;
  object-fit: cover;
  object-position: top;
  border-radius: 21px 21px 0 0;
}

/* The second screen is cut a little shorter, so the two stand staggered on the hero's edge. */
.phones li + li .phone img {
  aspect-ratio: 480 / 820;
}

/* On a phone, one screen (the week) at a readable size; the second joins it from 520 px. */
@media (max-width: 519px) {
  .phones {
    grid-template-columns: 1fr;
    max-width: 230px;
  }

  .phones li + li {
    display: none;
  }
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 48px 48px 0;
    align-items: end;
  }

  .hero-text {
    align-self: center;
    padding-bottom: 48px;
  }

  .hero .mark {
    width: 88px;
  }

  .phones {
    max-width: 520px;
  }
}

/* Sections */
.section {
  margin-top: 48px;
}

.section-intro {
  color: var(--muted);
  max-width: 40em;
}

.features {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 16px;
}

.features li + li {
  margin-top: 0;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .features {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

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

.card h3 {
  margin-top: 14px;
  margin-bottom: 0.35em;
}

.prose .card h3,
.card h3:first-child {
  margin-top: 0;
}

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

.card p {
  color: var(--muted);
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--brand);
}

.icon-badge svg {
  width: 24px;
  height: 24px;
}

.promise-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 12px;
}

.promise-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
}

.promise-list li + li {
  margin-top: 0;
}

.promise-list svg {
  width: 24px;
  height: 24px;
  color: var(--brand);
  margin-top: 2px;
}

.two-col {
  display: grid;
  gap: 16px;
}

@media (min-width: 820px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

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

.contact-card .email {
  font-family: var(--heading);
  font-size: 1.35rem;
  line-height: 1.3;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Prose pages (privacy, support) */
.page-head {
  margin-bottom: 32px;
}

.page-head p {
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose h2 {
  margin-top: 2.2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.prose h3 {
  margin-top: 1.6em;
  scroll-margin-top: 16px;
}

.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.to-contents {
  margin: 1.5em 0 0;
  font-size: 0.9rem;
}

.to-contents a {
  color: var(--muted);
}

.summary-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 20px 4px;
  margin-bottom: 32px;
}

.summary-box h2 {
  border: 0;
  padding: 0;
  margin: 0 0 0.6em;
  font-size: 1.25rem;
}

.toc {
  background: var(--raised);
  border-radius: var(--radius);
  padding: 16px 20px 4px;
  margin-bottom: 32px;
}

.toc h2 {
  font-size: 1.05rem;
  margin: 0 0 0.6em;
  border: 0;
  padding: 0;
}

.toc ol {
  columns: 1;
  padding-left: 1.4em;
}

@media (min-width: 720px) {
  .toc ol {
    columns: 2;
    column-gap: 32px;
  }

  .toc li {
    break-inside: avoid;
  }
}

.callout {
  background: var(--soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 1em;
}

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

/* What never leaves for the AI coach: set apart so nobody reads the list of
   left-out data as data that is sent. */
.never-sent {
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0.6em 0 1em;
}

.never-sent p {
  margin: 0;
}

.never-sent strong {
  color: var(--brand);
}

.badge {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
  vertical-align: 0.2em;
  margin-left: 6px;
  border: 1px solid var(--brand);
  color: var(--brand);
  background: transparent;
}

/* A badge that opens a paragraph sits on the text's left edge. */
p > .badge:first-child {
  margin-left: 0;
  margin-right: 4px;
  vertical-align: 0.1em;
}

/* A fact Kristian must confirm or fill in. Remove each one before publishing. */
.todo {
  display: inline;
  background: var(--todo-bg);
  color: var(--todo-ink);
  border: 1px dashed var(--todo-line);
  border-radius: 6px;
  padding: 0.05em 0.4em;
  font-weight: 600;
  font-size: 0.92em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Tables that turn into stacked cards on narrow screens. */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: 0.975rem;
}

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

.table thead th {
  font-weight: 600;
  border-bottom: 2px solid var(--line);
}

.table tbody th {
  font-weight: 600;
}

@media (min-width: 720px) {
  .table .w-25 {
    width: 25%;
  }

  .table .w-35 {
    width: 35%;
  }

  .table .w-40 {
    width: 40%;
  }
}

@media (max-width: 719px) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 4px;
    margin-bottom: 12px;
  }

  .table th,
  .table td {
    border: 0;
    padding: 6px 12px;
  }

  /* The row header leads each stacked card; two-column tables need no further labels. */
  .table tbody th {
    font-family: var(--heading);
    font-size: 1.02rem;
    padding-top: 8px;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
  }
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--heading);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--brand);
}

.faq details[open] > summary::after {
  content: "\2212";
}

.faq details > div {
  padding: 0 16px 4px;
}

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

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  min-height: 32px;
}

.steps > li + li {
  margin-top: 14px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand);
  font-family: var(--heading);
  font-weight: 700;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
}

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

/* 404 */
.not-found {
  text-align: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.not-found .mark {
  width: 96px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}

.not-found p {
  color: var(--muted);
}

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

.site-footer .wrap {
  display: grid;
  gap: 16px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  color: var(--ink);
}

.site-footer p {
  margin: 0;
}

@media (min-width: 820px) {
  .site-footer .wrap {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .site-header nav,
  .skip-link {
    display: none;
  }

  .todo {
    border-style: solid;
  }
}

/* Home: the data and wellness cards share a row of equal height (each ends on a line of links pinned to its bottom), and the
   contact card runs the full width below them. */
.two-col.even-row {
  align-items: stretch;
}

.contact-band {
  margin-top: 16px;
  display: grid;
  gap: 8px 32px;
}

.contact-band h2,
.contact-band p {
  margin: 0;
}

.contact-band > div {
  display: grid;
  gap: 8px;
  align-content: center;
}

.contact-band .email {
  font-family: var(--heading);
  font-size: 1.35rem;
  line-height: 1.3;
}

@media (min-width: 820px) {
  .contact-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

/* Cards in a stretched row end on a line of links pinned to the bottom, so both rows of links sit at the same height. */
.pinned-card {
  display: flex;
  flex-direction: column;
}

.data-card .promise-list {
  margin-bottom: 20px;
}

.pinned-card .note {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 4px;
}

/* Each link in a note line, and the footer's TODO mark, wraps as a whole */
.note a,
.site-footer mark {
  white-space: nowrap;
}
