/* CatchTime — editorial field-notebook aesthetic.
   Palette lifted from the iOS app's asset catalog so the website and the
   app feel like the same object. */

:root {
  color-scheme: light;

  /* Neutrals */
  --paper: #e9e4dc;
  --surface: #f3ede2;
  --mute-bg: #e7e0d2;
  --rule: #dcd6c8;
  --ink: #272d28;
  --mute: #6c736a;

  /* Brand */
  --olive: #496b49;
  --olive-strong: #3c5a3c;
  --olive-soft: #d2dfd1;
  --rust: #d3824b;
  --rust-soft: #f3dfc6;

  /* Score tints — the same pills Today shows in the app */
  --score-poor: #a8523d;
  --score-fair: #c68243;
  --score-good: #6b8951;
  --score-excellent: #3c5a3c;

  /* Typography */
  --display: ui-serif, "New York", "Charter", "Iowan Old Style", Georgia, serif;
  --body: ui-serif, "New York", "Charter", Georgia, serif;
  --label: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;

  --shell: min(1100px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1400px 600px at 15% -10%, rgb(211 130 75 / 6%), transparent 60%),
    radial-gradient(ellipse 1400px 600px at 90% 110%, rgb(73 107 73 / 6%), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><g fill='none' stroke='%23272d28' stroke-width='0.6' opacity='0.05'><path d='M-20 60 Q50 30 110 60 T240 55'/><path d='M-20 100 Q60 75 110 105 T240 95'/><path d='M-20 140 Q55 115 115 140 T240 140'/><path d='M-20 180 Q65 150 120 185 T240 180'/></g></svg>");
  background-size: 260px 260px;
  z-index: -1;
}

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

a:hover { color: var(--rust); }

img { max-width: 100%; display: block; }

/* =========== Layout shells =========== */

.site-header,
.site-footer,
main > section,
main.document {
  width: var(--shell);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-family: var(--label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 140ms ease;
}

.brand:hover { opacity: 0.72; }

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  box-shadow: 0 10px 24px rgb(39 45 40 / 14%), 0 1px 0 rgb(255 255 255 / 60%) inset;
}

.brand .wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.brand .wordmark .name { letter-spacing: 0.24em; }

.brand .wordmark .tagline {
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--mute);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 24px;
  font-family: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav a {
  color: var(--mute);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--rust);
}

/* =========== Editorial section labels =========== */

.eyebrow {
  margin: 0 0 18px;
  color: var(--mute);
  font-family: var(--label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "§  ";
  color: var(--rust);
  font-weight: 700;
}

/* =========== Hero =========== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: 72px;
  align-items: start;
  padding: 72px 0 96px;
  border-bottom: 1px solid var(--rule);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-copy .lead {
  margin: 30px 0 0;
  max-width: 36ch;
  font-size: 20px;
  line-height: 1.55;
  color: var(--mute);
}

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

.button,
.button-secondary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  font-family: var(--label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: transform 120ms ease;
}

.button {
  background: var(--ink);
  color: var(--surface);
  border: 1px solid var(--ink);
}

.button:hover { transform: translateY(-1px); background: var(--olive-strong); border-color: var(--olive-strong); }

.button-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}

.button-secondary:hover { transform: translateY(-1px); border-color: var(--ink); }

.button .arrow,
.button-secondary .arrow,
.link-stack .arrow {
  font-family: var(--display);
  font-style: italic;
  letter-spacing: 0;
}

/* Right column — stylized almanac entry that mirrors the iOS Today tab */

.almanac {
  display: grid;
  gap: 20px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 22px 40px rgb(39 45 40 / 8%), 0 1px 0 rgb(255 255 255 / 70%) inset;
  transform: rotate(-0.35deg);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease;
  position: relative;
}

.almanac::before {
  content: "";
  position: absolute;
  inset: -6px -6px auto auto;
  width: 72px;
  height: 3px;
  background: var(--rust);
  transform: rotate(42deg);
  opacity: 0.85;
}

.almanac:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 32px 60px rgb(39 45 40 / 14%), 0 1px 0 rgb(255 255 255 / 70%) inset;
}

.almanac-mast {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.almanac-score {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.almanac-score .num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 92px;
  line-height: 0.9;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.almanac-score .num::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-top: 12px;
  background: var(--rust);
}

.almanac-score .meta {
  display: grid;
  gap: 6px;
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--label);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid currentcolor;
  width: fit-content;
}

.tier-poor { color: var(--score-poor); background: rgb(168 82 61 / 8%); }
.tier-fair { color: var(--score-fair); background: rgb(198 130 67 / 10%); }
.tier-good { color: var(--score-good); background: rgb(107 137 81 / 12%); }
.tier-excellent { color: var(--score-excellent); background: rgb(60 90 60 / 14%); }

.almanac-score .caption {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  color: var(--mute);
  max-width: 26ch;
}

.almanac-window {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}

.almanac-window:last-of-type { border-bottom: 1px dashed var(--rule); }

.almanac-window .tag {
  font-family: var(--label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

.almanac-window .time {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
}

.almanac-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 4px;
  margin: 0;
}

.almanac-meta dt {
  font-family: var(--label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

.almanac-meta dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
}

/* =========== Feature band =========== */

.features {
  padding: 80px 0;
  border-bottom: 1px solid var(--rule);
}

.features .section-intro {
  max-width: 680px;
  margin-bottom: 56px;
}

.features .section-intro h2 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1.1;
  color: var(--ink);
}

.features .section-intro p {
  margin: 18px 0 0;
  color: var(--mute);
  max-width: 56ch;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.feature {
  padding: 36px 28px 40px 0;
  border-right: 1px solid var(--rule);
  transition: transform 240ms ease;
}

.feature:hover { transform: translateY(-2px); }
.feature:hover .index { color: var(--ink); }

.feature:last-child {
  border-right: none;
  padding-right: 0;
}

.feature + .feature { padding-left: 28px; }

.feature .index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rust);
  transition: color 220ms ease;
}

.feature .index::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentcolor;
  display: inline-block;
}

.feature h3 {
  margin: 18px 0 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  color: var(--ink);
}

.feature p {
  margin: 0;
  color: var(--mute);
  font-size: 17px;
  line-height: 1.55;
}

/* =========== Score ladder =========== */

.ladder {
  padding: 80px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 72px;
  align-items: center;
}

.ladder .section-intro h2 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.12;
  color: var(--ink);
}

.ladder .section-intro p {
  max-width: 48ch;
  color: var(--mute);
  margin: 18px 0 0;
}

.pill-stack {
  display: grid;
  gap: 12px;
}

.pill-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.pill-row:hover {
  transform: translateX(3px);
  border-color: var(--rust);
  background: #ffffff;
}

.pill-row .num {
  font-family: var(--display);
  font-style: italic;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}

.pill-row .text {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  color: var(--mute);
  letter-spacing: 0;
  text-transform: none;
}

/* =========== Launch pages =========== */

.launch {
  padding: 64px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: center;
}

.launch h2 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.12;
  color: var(--ink);
}

.launch p {
  margin: 18px 0 0;
  color: var(--mute);
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-stack a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-family: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  transition: border-color 120ms ease, color 120ms ease;
}

.link-stack a .arrow { transition: transform 220ms ease; }
.link-stack a:hover { border-color: var(--rust); color: var(--rust); background: #ffffff; }
.link-stack a:hover .arrow { transform: translateX(4px); }

/* =========== Document pages (privacy / support) =========== */

main.document {
  max-width: 760px;
  padding: 64px 0 96px;
}

main.document > .eyebrow { margin-bottom: 8px; }

main.document h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.05;
  color: var(--ink);
}

main.document > .lead {
  margin: 0 0 44px;
  color: var(--mute);
  font-family: var(--label);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

main.document section {
  padding-top: 34px;
  margin-top: 34px;
  border-top: 1px solid var(--rule);
}

main.document h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink);
}

main.document h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

main.document p,
main.document li {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

main.document ul { padding-left: 22px; }
main.document li + li { margin-top: 8px; }

.support-callout {
  padding: 22px 24px;
  margin-top: 18px;
  background: var(--rust-soft);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.support-callout h2 {
  margin-top: 0;
  font-size: 20px;
}

.support-callout p {
  margin: 8px 0 0;
  color: var(--ink);
}

.faq-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--rule);
}

.faq-list article {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.faq-list article p { margin: 6px 0 0; color: var(--mute); }

/* =========== Footer =========== */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 32px 0 56px;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

.site-footer a {
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}

.site-footer a:hover { color: var(--ink); border-bottom-color: var(--rust); }

.site-footer .date {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--mute);
}

/* =========== Scroll reveal + hero flourish =========== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 680ms cubic-bezier(0.22, 1, 0.36, 1), transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.hero-copy h1 .accent { color: var(--rust); font-style: italic; }

/* Subtle bob on the almanac card so the page doesn't feel frozen */
@keyframes floaty {
  0%, 100% { transform: rotate(-0.35deg) translateY(0); }
  50%      { transform: rotate(-0.35deg) translateY(-3px); }
}

@media (prefers-reduced-motion: no-preference) {
  .almanac { animation: floaty 7s ease-in-out infinite; }
  .almanac:hover { animation-play-state: paused; }
}

/* Button arrow slide */
.button .arrow,
.button-secondary .arrow {
  transition: transform 220ms ease;
  display: inline-block;
}

.button:hover .arrow,
.button-secondary:hover .arrow { transform: translateX(4px); }

/* =========== Responsive =========== */

@media (max-width: 860px) {
  .hero,
  .ladder,
  .launch {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero { padding: 48px 0 64px; }
  .features { padding: 56px 0; }
  .ladder { padding: 56px 0; }
  .launch { padding: 48px 0 64px; }

  .feature-grid { grid-template-columns: 1fr; }

  .feature {
    padding: 28px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .feature:last-child { border-bottom: none; }
  .feature + .feature { padding-left: 0; }

  .almanac-score .num { font-size: 72px; }
}

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

  .site-header {
    padding: 20px 0 14px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav { gap: 18px; }

  .hero-copy .lead { font-size: 18px; }

  .actions { flex-direction: column; align-items: stretch; }

  .button,
  .button-secondary {
    justify-content: center;
    width: 100%;
  }

  .almanac { padding: 22px; }

  .almanac-meta { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
