@font-face {
  font-family: "Young Serif";
  src: url("young-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* These are the app's own colors, from Theme.swift. */
:root {
  --paper: #dbe6d4;
  --paper-raised: #e9f0e4;
  --paper-ink: #262e24;
  --paper-muted: #4f5a4d;
  --rule: rgb(38 46 36 / 0.16);
  --ink: #000;
  --ink-raised: #24242b;
  --on-ink: #fff;
  --on-ink-muted: rgb(255 255 255 / 0.62);
  --plum: #38305a;
  --plum-text: #f5f0fc;
  --plum-muted: rgb(245 240 252 / 0.7);
  --coral: #f26b4f;
  --amber: #edab47;
  --serif: "Young Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rounded: ui-rounded, system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--paper-ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover { background: var(--plum); }

/* The notch panel. The top of the page stands in for the top of the screen. */
.stage { display: flex; justify-content: center; padding-inline: 26px; }
.panel {
  position: relative;
  width: min(940px, 100%);
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 0 0 24px 24px;
  animation: notch-open 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s backwards;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  top: 0;
  width: 10px;
  height: 10px;
}
.panel::before { right: 100%; background: radial-gradient(circle at 0 100%, transparent 10px, var(--ink) 10.5px); }
.panel::after { left: 100%; background: radial-gradient(circle at 100% 100%, transparent 10px, var(--ink) 10.5px); }
.panel-inner { padding: 16px 16px 14px; animation: panel-fade 0.4s ease 0.75s backwards; }
@keyframes notch-open {
  from { clip-path: inset(0 calc(50% - 100px) calc(100% - 30px) calc(50% - 100px) round 0 0 12px 12px); }
  to { clip-path: inset(0 0 -40px 0 round 0 0 24px 24px); }
}
@keyframes panel-fade { from { opacity: 0; } }

.panel-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.mark {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4.5px;
  background: var(--coral);
}
.mark::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2.5px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: rgb(255 255 255 / 0.92);
}
.today-label { font-size: 12px; color: var(--on-ink-muted); }
.tabs {
  display: flex;
  gap: 2px;
  margin-inline: auto;
  padding: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
}
.tab {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--on-ink-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--on-ink); }
.tab[aria-selected="true"] { background: rgb(255 255 255 / 0.14); color: var(--on-ink); }

.view { height: 372px; }
.view[hidden] { display: none; }
.view-today { display: grid; grid-template-columns: 240px 1fr; gap: 12px; }
.focus-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--plum);
  color: var(--plum-text);
}
.focus-title { font-size: 13px; font-weight: 600; opacity: 0.78; }
.focus-time { font: 500 50px/1 var(--rounded); font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; }
.chip { padding: 4px 9px; border-radius: 999px; background: rgb(255 255 255 / 0.07); font-size: 11px; font-weight: 600; }
.chip.on { background: rgb(255 255 255 / 0.2); }
.focus-start { padding: 9px; border-radius: 999px; background: rgb(255 255 255 / 0.14); text-align: center; font-size: 14px; font-weight: 600; }
.events { margin-top: auto; display: grid; gap: 6px; font-size: 12px; }
.events b { color: var(--amber); font: 500 11px var(--rounded); margin-right: 8px; }

.sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--paper-ink);
}
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sheet-head strong { font-size: 16px; font-weight: 600; }
.sheet-head span { font-size: 11px; color: var(--paper-muted); }
.tasks { flex: 1; margin: 8px 0; padding: 0; list-style: none; overflow-y: auto; }
.tasks li { display: flex; gap: 8px; padding: 5px 4px; }
.check { flex: none; width: 15px; height: 15px; margin-top: 2px; border: 1.5px solid var(--paper-muted); border-radius: 50%; }
.task-title { display: block; font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.task-meta { display: block; white-space: pre-wrap; font-size: 10px; font-weight: 500; line-height: 1.5; color: var(--paper-muted); }
.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.5);
}
.composer span { color: var(--paper-muted); font-weight: 700; font-size: 14px; }
.composer input { flex: 1; min-width: 0; border: 0; background: none; font-size: 13px; outline: none; }
.composer input::placeholder { color: var(--paper-muted); }
.composer:focus-within { box-shadow: 0 0 0 2px var(--plum); }

.view-week { display: grid; grid-template-columns: 150px repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { min-width: 0; padding: 8px; border-radius: 12px; background: rgb(255 255 255 / 0.04); }
.day.now { background: rgb(255 255 255 / 0.09); }
.day h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; color: var(--on-ink-muted); }
.day h4 b { display: block; color: var(--on-ink); font: 600 18px var(--rounded); }
.day.now h4 { color: var(--coral); }
.card { margin-top: 5px; padding: 6px; border-radius: 7px; background: rgb(255 255 255 / 0.08); font-size: 11px; font-weight: 500; line-height: 1.3; }

.view-notes { padding: 18px; border-radius: 18px; background: var(--paper); color: var(--paper-ink); font-size: 14px; }
.view-notes strong { display: block; margin-bottom: 10px; font-size: 16px; font-weight: 600; }
.view-notes p + p { margin-top: 6px; }
.view-clips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; padding: 4px; }
.clip { height: 118px; display: flex; align-items: flex-end; padding: 8px; border-radius: 12px; background: var(--ink-raised); font-size: 10px; color: var(--on-ink-muted); }
.view-insights { display: flex; flex-direction: column; padding: 4px; }
.insight-total { font: 600 28px var(--rounded); }
.insight-label { font-size: 13px; color: var(--on-ink-muted); }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 100%; text-align: center; font-size: 10px; color: var(--on-ink-muted); }
.bars i { display: block; border-radius: 6px; background: rgb(255 255 255 / 0.18); }
.bars .current i { background: var(--coral); }

.hero { padding-block: clamp(36px, 6vw, 64px) clamp(56px, 9vw, 104px); }
.hero h1 { font-size: clamp(3rem, 10.4vw, 7.6rem); line-height: 0.98; letter-spacing: -0.02em; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: clamp(24px, 4vw, 36px); }
.hero-foot p { max-width: 34em; }
.hero-note { font-size: 14px; color: var(--paper-muted); }

/* A day, laid out as a planner page. The hours are real: each row is a moment in that day. */
.day-page { padding-block: 0 clamp(64px, 10vw, 120px); }
.day-page > .wrap > h2, .plans h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; }
.hours { margin: clamp(28px, 5vw, 48px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.hours li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px 32px;
  align-items: center;
  padding-block: 28px;
  border-bottom: 1px solid var(--rule);
}
.hours time { font: 400 1.5rem/1 var(--serif); }
.hours h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 6px; }
.hours p { color: var(--paper-muted); max-width: 30em; }

.typed { padding: 14px 16px; border-radius: 12px; background: var(--paper-raised); font-size: 15px; }
.typed small { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--paper-muted); }
.hang {
  position: relative;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 420px);
  min-height: 52px;
  padding: 8px 14px;
  border-radius: 0 0 18px 18px;
  background: var(--ink);
  color: var(--on-ink);
}
.hang-time { font: 600 16px var(--rounded); font-variant-numeric: tabular-nums; }
.hang-text { flex: 1; min-width: 0; font-size: 12px; color: var(--on-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hang-text b { display: block; color: var(--on-ink); font-size: 13px; }
.hang-bell { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--amber); }
.pill { padding: 5px 9px; border-radius: 999px; background: rgb(255 255 255 / 0.1); font-size: 11px; font-weight: 600; }
.pill.go { background: var(--coral); color: var(--ink); }
.pause { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--coral); }
.pause::before { content: ""; width: 8px; height: 10px; border-inline: 3px solid var(--ink); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-strip span { padding: 8px 2px; border-radius: 8px; background: var(--paper-raised); text-align: center; font-size: 12px; font-weight: 600; }
.week-strip .has { background: var(--plum); color: var(--plum-text); }

.plans { background: var(--plum); color: var(--plum-text); padding-block: clamp(56px, 9vw, 104px); }
.plans-lede { margin-top: 12px; max-width: 34em; color: var(--plum-muted); }
.plans table { width: 100%; margin-top: clamp(24px, 4vw, 40px); border-collapse: collapse; font-size: 16px; }
.plans th, .plans td { padding: 12px 16px 12px 0; border-bottom: 1px solid rgb(245 240 252 / 0.16); text-align: left; vertical-align: top; }
.plans thead th { font: 400 1.5rem var(--serif); }
.plans tbody th { font-weight: 500; width: 44%; }
.plans td { color: var(--plum-muted); }
.plans td.yes { color: var(--plum-text); }
.plans-foot { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.plans .button { background: var(--paper); color: var(--paper-ink); }
.plans .button:hover { background: var(--plum-text); }

.yours { padding-block: clamp(56px, 9vw, 104px); }
.yours h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; max-width: 14em; }
.yours p { margin-top: 16px; max-width: 36em; color: var(--paper-muted); }

.foot { border-top: 1px solid var(--rule); padding-block: 28px 36px; font-size: 14px; color: var(--paper-muted); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.foot .brand { color: var(--paper-ink); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }

/* Legal pages */
.legal-top { padding-block: 20px; }
.legal main { padding-bottom: clamp(56px, 8vw, 96px); }
.legal h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; }
.legal .updated { margin-top: 10px; font-size: 14px; color: var(--paper-muted); }
.legal article { max-width: 40em; margin-top: 32px; }
.legal h2 { font-size: 1.5rem; line-height: 1.2; margin: 32px 0 8px; }
.legal article p + p, .legal article ul { margin-top: 10px; }
.legal article ul { padding-left: 1.2em; }

@media (max-width: 900px) {
  .hours li { grid-template-columns: 80px minmax(0, 1fr); }
  .hours li > :last-child { grid-column: 2; justify-self: stretch; }
  .hang { justify-self: stretch; width: 100%; }
  .view-week { grid-template-columns: 1fr; overflow-y: auto; }
  .view-week .day:nth-child(n + 4) { display: none; }
}
@media (max-width: 680px) {
  .stage { padding-inline: 16px; }
  .panel::before, .panel::after { display: none; }
  .panel { border-radius: 0 0 20px 20px; }
  .panel-inner { padding: 12px 10px 10px; }
  .today-label { display: none; }
  .panel-head { flex-wrap: wrap; }
  .tabs { margin: 0; width: 100%; justify-content: space-between; overflow-x: auto; }
  .tab { padding: 5px 8px; }
  .view { height: 360px; }
  .view-today { grid-template-columns: 1fr; }
  .focus-card { display: none; }
  .view-clips { grid-template-columns: repeat(2, 1fr); }
  .hours li { grid-template-columns: 1fr; gap: 10px; padding-block: 22px; }
  .hours li > :last-child { grid-column: 1; }
  .plans th, .plans td { padding-right: 10px; font-size: 14px; }
  .foot nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .panel-inner { animation: none; }
  .button { transition: none; }
}
