/* TomorrowForSure: the homepage and the not-found page, as drawn in
   "TomorrowForSure — home page directions" (November 2026). The unlisted Maki Notes
   pages keep their own stylesheets in assets/legacy/. */

/* Instrument Sans, SIL Open Font License (fonts/InstrumentSans-OFL.txt). Served from this
   site because the CSP allows fonts only from itself. Variable font, Latin subset. */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}

/* The design's two palettes. By default the page follows the device's setting; the header
   button (assets/theme.js) sets data-theme on <html> to override it. The dark palette is
   written twice: once for "device is dark and no light override", once for "dark override". */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b66;
  --rule: #e4e4e1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111111;
    --ink: #f2f2ef;
    --muted: #9a9a94;
    --rule: #2a2a28;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --ink: #f2f2ef;
  --muted: #9a9a94;
  --rule: #2a2a28;
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* The page: the seal at the top, the headline and products at the bottom, the footer below. */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 4.45vw, 64px);
}

/* The header: the seal on the left, the light/dark button on the right. */
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.seal {
  display: inline-block;
  color: var(--ink);
}

/* The light/dark button: a half-filled circle in the muted ink, turned over in dark mode.
   It stays hidden until assets/theme.js has run, so it never shows without working. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px -10px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--ink);
}

.theme-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 300ms ease;
}

.theme-toggle[aria-pressed="true"] svg {
  transform: rotate(180deg);
}

.seal svg {
  display: block;
  width: clamp(64px, 6.2vw, 88px);
  height: auto;
}

main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(48px, 6vw, 120px) 0 clamp(40px, 6vw, 96px);
}

h1 {
  margin: 0;
  max-width: 10em;
  font-size: clamp(42px, 9vw, 124px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.products {
  margin-top: clamp(40px, 5vw, 72px);
}

/* Labels: small tracked capitals in the muted ink. */
.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.products h2 {
  margin: 0 0 14px;
}

.products ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 420px;
  border-top: 1px solid var(--ink);
}

.products li {
  border-bottom: 1px solid var(--rule);
}

.products a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.products a span {
  font-weight: 500;
  color: var(--muted);
  transition: transform 150ms ease, color 150ms ease;
}

.products a:hover span,
.products a:focus-visible span {
  color: var(--ink);
  transform: translate(2px, -2px);
}

/* The not-found page's way home. */
.home-link {
  margin: clamp(24px, 3vw, 40px) 0 0;
  font-size: 18px;
  font-weight: 600;
}

.home-link a {
  color: var(--ink);
  text-underline-offset: 4px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* The phone drawing: the list runs full width and the footer stacks, "Tomorrow" first. */
@media (max-width: 640px) {
  .products ul {
    max-width: none;
  }

  footer {
    flex-direction: column;
  }

  .tomorrow {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .products a span,
  .theme-toggle svg {
    transition: none;
  }
}
