/* Self-hosted, so opening the site sends nothing to a font service. */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('fonts/familjen-grotesk-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Familjen Grotesk';
  src: url('fonts/familjen-grotesk-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  /* A cool desktop grey, the app's own indigo, and its "active now" green. */
  --desk: #e8ebf1;
  --desk-deep: #dde1ea;
  --ink: #1b1d26;
  --muted: #5b6172;
  --line: #c9ced9;
  --indigo: #3d5afe;
  --indigo-deep: #2a44d8;
  --live: #1f9d64;

  /* The widget, drawn as the app draws it. */
  --w-bg: #1e1f27;
  --w-surface: #272833;
  --w-border: #3a3c4a;
  --w-text: #ededf0;
  --w-muted: #a1a1aa;
  --w-faint: #71717a;
  --w-accent: #8195ff;
  --w-note: #252a45;

  --display: 'Familjen Grotesk', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;

  --gutter: clamp(20px, 4vw, 48px);
  --widget-width: 340px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

a {
  color: var(--indigo-deep);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* ───────────── Header and footer ───────────── */

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 16px;
}

.site-nav a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--ink);
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 12px;
}

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

/* ───────────── Buttons ───────────── */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--indigo);
  color: #fff;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.button:hover {
  background: var(--indigo-deep);
}

.button svg {
  width: 19px;
  height: 19px;
}

.button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 16px;
}

.button.plain {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink);
}

.button.plain:hover {
  background: var(--desk-deep);
}

/* ───────────── Home: text on the left, the widget pinned top-right ───────────── */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--widget-width);
  gap: clamp(32px, 6vw, 96px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.story {
  max-width: 640px;
}

.hero {
  padding: clamp(48px, 10vh, 120px) 0 clamp(56px, 9vh, 96px);
}

.hero h1 {
  font-size: clamp(48px, 7.2vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero .lead {
  max-width: 34em;
  margin-top: 28px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.fine {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
}

.feature {
  padding: clamp(56px, 9vh, 96px) 0;
  border-top: 1px solid var(--line);
}

.feature h2 {
  font-size: clamp(32px, 4.2vw, 48px);
}

.feature p {
  max-width: 34em;
  margin-top: 20px;
  color: var(--muted);
}

.feature p strong {
  color: var(--ink);
  font-weight: 600;
}

.feature ul {
  max-width: 34em;
  margin: 20px 0 0;
  padding-left: 1.1em;
  color: var(--muted);
}

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

.closing {
  padding: clamp(64px, 12vh, 140px) 0;
  border-top: 1px solid var(--line);
}

.closing h2 {
  font-size: clamp(40px, 5.6vw, 64px);
}

.closing p {
  max-width: 34em;
  margin-top: 20px;
  color: var(--muted);
}

.rail {
  position: relative;
}

.rail .widget {
  position: sticky;
  top: 24px;
  margin-top: 24px;
}

/* ───────────── The widget ───────────── */

.widget {
  width: 100%;
  border: 1px solid var(--w-border);
  border-radius: 14px;
  background: var(--w-bg);
  color: var(--w-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.35;
  box-shadow:
    0 24px 60px rgb(27 29 38 / 0.28),
    0 4px 12px rgb(27 29 38 / 0.16);
  overflow: hidden;
  user-select: none;
}

.w-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--w-border);
}

.w-head strong {
  font-size: 14px;
  font-weight: 600;
}

.w-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--w-surface);
  color: var(--w-muted);
  font-size: 12px;
}

.w-today {
  margin-left: auto;
  color: var(--w-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.w-body {
  padding: 8px;
}

.w-note {
  display: none;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: 10px;
  background: var(--w-note);
}

.w-note svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--w-accent);
}

.w-note-text {
  flex: 1;
  min-width: 0;
}

.w-note-title {
  display: block;
  font-weight: 600;
}

.w-note-detail {
  display: block;
  margin-top: 2px;
  color: var(--w-muted);
  font-size: 12.5px;
}

.w-go {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #6f86ff;
  color: #fff;
}

.w-go svg {
  width: 13px;
  height: 13px;
  margin: 0;
  color: inherit;
}

.w-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 9px;
}

.w-row + .w-row {
  margin-top: 2px;
}

.w-check {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1.5px solid var(--w-faint);
  border-radius: 50%;
}

.w-task {
  flex: 1;
  min-width: 0;
}

.w-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.w-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
  color: var(--w-muted);
  font-size: 12px;
}

.w-time {
  color: var(--w-accent);
  font-variant-numeric: tabular-nums;
}

.w-step {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--w-muted);
  font-size: 12.5px;
}

.w-step::before {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--w-faint);
  border-radius: 3px;
  content: '';
}

.w-pause {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--w-muted);
}

.w-pause svg,
.w-wait svg {
  width: 14px;
  height: 14px;
}

.w-wait {
  display: none;
  gap: 8px;
  align-items: center;
  margin: 4px 10px 2px;
  color: var(--w-muted);
  font-size: 12.5px;
}

.w-wait svg {
  color: var(--w-accent);
}

.w-live {
  display: none;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgb(31 157 100 / 0.22);
}

.w-todo {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--w-border);
}

.w-todo-head {
  padding: 2px 10px 6px;
  color: var(--w-faint);
  font-size: 12px;
}

.w-todo-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  color: var(--w-text);
}

.w-sun {
  display: none;
  width: 13px;
  height: 13px;
  color: #f59e0b;
}

/* What each part of the page shows on the widget. */
.widget[data-state='notice'] .w-live.essay {
  display: block;
}

.widget[data-state='notice'] [data-note='notice'],
.widget[data-state='pickup'] [data-note='pickup'],
.widget[data-state='wait'] [data-note='wait'],
.widget[data-state='reply'] [data-note='reply'],
.widget[data-state='link'] [data-note='link'],
.widget[data-state='plan'] [data-note='plan'] {
  display: flex;
}

.widget[data-state='wait'] .w-row.release,
.widget[data-state='pickup'] .w-row.release {
  display: none;
}

.widget[data-state='wait'] .w-wait {
  display: flex;
}

/* Waiting pauses the build's task, so one is left in progress. */
.w-count.one,
.widget[data-state='wait'] .w-count.both {
  display: none;
}

.widget[data-state='wait'] .w-count.one {
  display: inline;
}

.widget[data-state='plan'] .w-sun {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .w-note {
    animation: note-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  @keyframes note-in {
    from {
      transform: translateY(-6px);
      opacity: 0;
    }
  }
}

/* ───────────── Narrow screens: the widget sits under the opening instead ───────────── */

@media (max-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    order: -1;
    max-width: var(--widget-width);
    margin-top: 8px;
  }

  .rail .widget {
    position: static;
    margin-top: 24px;
  }

  .stage .story {
    display: contents;
  }

  .hero {
    order: -2;
    padding-bottom: 8px;
  }

  .feature {
    padding: 56px 0;
  }

  .feature:first-of-type {
    margin-top: 56px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 17px;
  }

  .hero .lead {
    font-size: 19px;
  }

  .site-nav .hide-small {
    display: none;
  }
}

/* ───────────── Privacy policy and other plain pages ───────────── */

.document {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--gutter) 96px;
}

.document h1 {
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.03em;
}

.document .updated {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
}

.document .summary {
  margin-top: 32px;
  padding: 22px 24px;
  border-left: 4px solid var(--indigo);
  background: var(--desk-deep);
  font-size: 19px;
}

.document h2 {
  margin-top: 56px;
  font-size: 30px;
}

.document h3 {
  margin-top: 32px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.document p,
.document ul {
  margin-top: 14px;
  line-height: 1.65;
}

.document ul {
  padding-left: 1.2em;
}

.document li + li {
  margin-top: 8px;
}

.document code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--desk-deep);
  font-size: 0.88em;
}
