/* Hard Truth: Screen Time. Shared styles for every page.
   Colors match the app's Palette tokens. Dark is the default, paper is the light theme. */

:root {
  color-scheme: dark light;

  /* Color: dark (default) */
  --bg: #0A0A0B;
  --surface: #141416;
  --text: #EDEAE3;      /* bone, 16.5:1 on bg */
  --muted: #9A978F;     /* 6.8:1 on bg */
  --hairline: #26262A;  /* dividers only, never text */
  --signal: #E8411F;    /* the cost. 4.9:1 on bg, safe for text */
  --reclaim: #0E7A4F;   /* the way back. 3.7:1 on dark bg: graphics only here, never text */

  /* Type */
  --font-display: "New York", ui-serif, Georgia, serif;
  --font-body: -apple-system, system-ui, sans-serif;

  --step--1: 0.875rem;                                   /* 14px: eyebrows, captions, footer */
  --step-0: 1.0625rem;                                   /* 17px: body */
  --step-1: 1.25rem;                                     /* 20px: h3, wordmark */
  --step-2: clamp(1.625rem, 1.35rem + 1.2vw, 2.125rem);  /* h2 */
  --step-3: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);       /* h1 */
  --step-4: clamp(4rem, 2.4rem + 8vw, 8rem);             /* the big number */

  /* Space: 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --gutter: var(--space-4);
  --measure: 40rem;
  --radius: 2px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F1EA;      /* paper */
    --surface: #EBE7DE;
    --text: #121212;    /* ink, 16.6:1 on paper */
    --muted: #5C5A55;   /* 6.1:1 on paper */
    --hairline: #D9D4C8;
    --signal: #C42510;  /* 5.1:1 on paper */
    --reclaim: #0E7A4F; /* 4.8:1 on paper */
  }
}

@media (min-width: 48rem) {
  :root { --gutter: var(--space-5); }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--step-3); line-height: 1.05; }
h2 { font-size: var(--step-2); line-height: 1.15; }

h3 {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
}

p, li, dd { text-wrap: pretty; }

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

strong { font-weight: 600; }

/* Layout */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: var(--space-2);
  z-index: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

/* Header and footer */

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

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-1);
}

.wordmark {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  text-decoration: none;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2);
  color: var(--muted);
  text-decoration: none;
}

.site-header .nav-list {
  flex-wrap: nowrap;
  margin-right: calc(-1 * var(--space-2));
}

.nav-list a:hover { color: var(--text); }

.nav-list a[aria-current="page"] {
  color: var(--text);
  text-decoration-line: underline;
}

.site-footer {
  margin-top: var(--space-8);
  padding-block: var(--space-6) var(--space-7);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}

.site-footer .nav-list { margin-inline: calc(-1 * var(--space-2)); }

/* Shared text pieces */

.eyebrow {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.4;
}

.meta {
  color: var(--muted);
  font-size: var(--step--1);
}

.flow > * + * { margin-top: var(--space-4); }
.flow > * + h2 { margin-top: var(--space-7); }
.flow > * + h3 { margin-top: var(--space-6); }
.flow > h2 + *,
.flow > h3 + * { margin-top: var(--space-3); }

.flow ul,
.flow ol { padding-left: var(--space-5); }

.flow li + li { margin-top: var(--space-2); }

/* Page sections */

.intro {
  padding-block: var(--space-7) var(--space-6);
}

.intro > * + * { margin-top: var(--space-4); }

.section {
  padding-block: var(--space-7);
  border-top: 1px solid var(--hairline);
}

.section > * + * { margin-top: var(--space-4); }
.section > h2 + * { margin-top: var(--space-5); }

@media (min-width: 48rem) {
  .intro { padding-block: var(--space-9) var(--space-7); }
  .section { padding-block: var(--space-8); }
}

/* The example: 4 hours a day for 20 years */

.example { padding-bottom: var(--space-7); }

.example > * + * { margin-top: var(--space-3); }

.big {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
  line-height: 1;
}

.big-number {
  color: var(--signal);
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
}

.big-unit {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
}

.example-text {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

/* Life grid: one dot per week, 52 per row. Drawn with an SVG pattern. */

.grid {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--space-6);
}

.dot-future { fill: var(--muted); }
.dot-screen { fill: var(--signal); }
.dot-reclaim { fill: var(--reclaim); }

.caption {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--step--1);
}

/* What it does */

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

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: var(--space-3);
  padding-block: var(--space-5);
  border-top: 1px solid var(--hairline);
}

.steps > li:first-child { border-top: 0; padding-top: 0; }

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.3;
}

.steps > li > * { grid-column: 2; }
.steps > li > * + * { margin-top: var(--space-2); }

/* How the math works */

.method { margin-top: var(--space-5); }

.method dt {
  margin-top: var(--space-5);
  font-weight: 600;
}

.method dt:first-child { margin-top: 0; }

.method dd {
  margin-top: var(--space-1);
  font-variant-numeric: lining-nums tabular-nums;
}

/* FAQ */

.faq > div + div {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
}

.faq h3 + p { margin-top: var(--space-2); }
.faq p + p { margin-top: var(--space-3); }

/* 404 */

.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

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