/* Wellmet: the Swiss grid. White sheet, black rules, one signal yellow. */

@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #767676;
  --rule: #111111;
  --hair: #dddddd;
  --wash: #f4f4f2;
  --signal: #ffd400;
  --error: #c4161c;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus); }
code { font-family: var(--mono); font-size: 0.86em; }
p { margin: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -48px; padding: 8px 12px;
  background: var(--ink); color: var(--paper); z-index: 10;
}
.skip:focus { top: 12px; }

/* --- The sheet: two columns split by a 2px rule ---------------------------- */

.sheet {
  display: grid;
  grid-template-columns: 7fr 5fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}
.sheet__left { padding: 36px 48px 56px 56px; border-right: 2px solid var(--rule); min-width: 0; }
.sheet__right { padding: 36px 56px 56px 48px; min-width: 0; }

.toprow {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--rule);
  font-size: 14px;
}
.wordmark { font-weight: 700; letter-spacing: 0.01em; text-decoration: none; }

.eyebrow {
  margin: 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}

.headline {
  margin: 28px 0 0;
  font-size: clamp(40px, 4.2vw, 56px); line-height: 0.98; font-weight: 700; letter-spacing: -0.035em;
}
.headline__second { display: block; color: var(--ink-3); }
.headline--index { margin-top: 40px; font-size: clamp(44px, 5vw, 72px); }
.headline--index .headline__second { font-size: 0.5em; letter-spacing: -0.02em; margin-bottom: 4px; }

.lede { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 52ch; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px;
  margin: 26px 0 0; padding-top: 10px; border-top: 1px solid var(--rule);
}
.facts dt { font-size: 14px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; }

.notice {
  margin-top: 20px; padding: 10px 14px;
  background: var(--wash); border-left: 4px solid var(--ink);
  font-size: 15px;
}

/* --- Timezone switcher (details element: no script needed) --------------- */

.tz { position: relative; text-align: right; }
.tz summary { cursor: pointer; list-style: none; color: var(--ink-2); padding: 2px 0; }
.tz summary::-webkit-details-marker { display: none; }
.tz__change { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.tz__form {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 2;
  display: flex; gap: 8px; padding: 12px;
  background: var(--paper); border: 2px solid var(--rule);
}
.tz__form select { width: 220px; }

/* --- Month calendar -------------------------------------------------------- */

.month { margin-top: 32px; }
.month__head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px; border-bottom: 2px solid var(--rule);
}
.month__title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.month__nav { display: flex; gap: 20px; font-size: 15px; font-weight: 600; }
.month__nav a { text-decoration: none; padding: 6px 0; }
.month__nav a:hover { text-decoration: underline; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__wd {
  padding: 10px 0 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.cal__cell {
  position: relative; display: block; height: 60px; padding: 6px 8px;
  border-top: 1px solid var(--hair);
  font-size: 20px; font-weight: 600; text-decoration: none;
}
.cal__cell--blank { border-top-color: transparent; }
.cal__cell--past { color: #8f8f8f; }
.cal__cell--closed { color: var(--ink-3); }
.cal__cell--open:hover { background: var(--wash); }
.cal__cell--selected { background: var(--signal); }
/* Bar length shows how much is open that day. */
.cal__bar { position: absolute; left: 8px; bottom: 8px; height: 4px; width: calc(var(--n) * 8px); background: var(--ink); }

/* --- Selected day and its times --------------------------------------------- */

.day__title { margin: 4px 0 0; font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.day { margin-top: 28px; }

.times { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.times--compact { margin-top: 12px; }
.time {
  display: flex; justify-content: space-between; align-items: baseline;
  min-height: 56px; padding: 12px 4px 8px 0;
  border-bottom: 1px solid var(--rule); text-decoration: none;
}
.time__label { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.time__go { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.time:hover { background: var(--signal); }
.time:hover .time__go::after { content: " →"; }

.empty { margin-top: 18px; color: var(--ink-2); font-size: 17px; }
.empty a { color: var(--ink); font-weight: 600; }

/* --- All open times (plain links for agents and for scanning) ------------- */

.upcoming { margin-top: 40px; padding-top: 10px; border-top: 2px solid var(--rule); }
.upcoming__list { list-style: none; margin: 8px 0 0; padding: 0; }
.upcoming__day {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--hair);
}
.upcoming__date { font-weight: 700; font-size: 15px; padding-top: 2px; }
.upcoming__times { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.upcoming__times a { font-size: 15px; text-decoration: none; padding: 2px 0; display: inline-block; }
.upcoming__times a:hover { background: var(--signal); }

/* --- Note for AI assistants -------------------------------------------------- */

.agent { margin-top: 40px; padding-top: 10px; border-top: 2px solid var(--rule); font-size: 15px; color: var(--ink-2); }
.agent__title { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.agent p { margin-bottom: 10px; }
.copy { display: grid; gap: 10px; justify-items: start; padding: 12px; background: var(--wash); }
.copy__text { font-size: 12.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.agent__more { margin-top: 12px; }
.agent__more summary { cursor: pointer; color: var(--ink); font-weight: 600; padding: 4px 0; }
.agent__more[open] summary { margin-bottom: 8px; }
.endpoints { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.endpoints li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.endpoints code { color: var(--ink); overflow-wrap: anywhere; }

/* --- Buttons ------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  font: 700 15px/1 var(--sans); letter-spacing: 0.02em;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 0; cursor: pointer; text-decoration: none;
}
.button:hover { background: #000; }
.button--small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.button--signal { background: var(--signal); color: var(--ink); }
.button--signal:hover { background: #ffdf33; }
.button--quiet { background: var(--paper); color: var(--ink); }
.button--quiet:hover { background: var(--wash); }
.button--danger { background: var(--error); border-color: var(--error); color: #fff; }
.button--danger:hover { background: #a01015; }
.button[data-done] { background: var(--signal); color: var(--ink); }

/* --- Confirm ------------------------------------------------------------------ */

.chosen { margin-top: 32px; }
.chosen__block {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 8px; padding: 16px 18px 14px;
  background: var(--signal);
}
.chosen__date { font-size: 18px; font-weight: 600; }
.chosen__time { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.chosen__tz { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.chosen--taken .chosen__block { background: var(--wash); color: var(--ink-3); }
.chosen--taken .chosen__date, .chosen--taken .chosen__time { text-decoration: line-through; text-decoration-thickness: 2px; }
.backlink { display: inline-block; margin-top: 14px; padding: 4px 0; font-weight: 600; text-decoration: none; }
.backlink:hover { text-decoration: underline; }

.section-title { margin: 28px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.alert { margin-top: 28px; padding: 14px 16px 16px; border: 2px solid var(--error); }
.alert p { font-weight: 600; }

.form { display: grid; gap: 22px; margin-top: 18px; max-width: 480px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  font: 500 18px/1.35 var(--sans); color: var(--ink);
  background: var(--paper);
  border: 0; border-bottom: 2px solid var(--rule); border-radius: 0;
  padding: 10px 2px 8px; min-height: 46px;
}
select { font-size: 15px; border: 2px solid var(--rule); padding: 8px 10px; }
textarea { resize: vertical; border: 2px solid var(--rule); padding: 10px 12px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { box-shadow: none; background: var(--wash); }
.field--error input, .field--error textarea { border-color: var(--error); }
.field__error { color: var(--error); font-size: 15px; font-weight: 600; }
.field__hint { color: var(--ink-2); font-size: 14px; }
.form__actions { display: grid; gap: 12px; justify-items: start; margin-top: 4px; }
.form__fine { color: var(--ink-2); font-size: 14px; max-width: 46ch; }

/* --- Index -------------------------------------------------------------------- */

.types { list-style: none; margin: 10px 0 0; padding: 0; border-top: 2px solid var(--rule); }
.type {
  display: grid; grid-template-columns: 1fr auto; column-gap: 20px;
  padding: 18px 0 16px; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.type__title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.type__meta { grid-column: 1; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.type__desc { grid-column: 1; margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 46ch; }
.type__go { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: 26px; font-weight: 700; }
.type:hover { background: var(--signal); }

/* --- Status --------------------------------------------------------------------- */

.status {
  margin: 40px 0 0;
  font-size: clamp(56px, 7vw, 104px); line-height: 0.92; font-weight: 700; letter-spacing: -0.045em;
}
.status--pending span, .status--pending { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 0.18em; text-underline-offset: 0.08em; }
.status--declined, .status--expired, .status--cancelled { color: var(--ink-3); }
.status + .lede { margin-top: 22px; }
.sheet__left > p:has(.button) { margin-top: 24px; }

.rows { margin: 22px 0 0; border-top: 2px solid var(--rule); }
.rows > div { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.rows dt { font-size: 14px; color: var(--ink-2); padding-top: 2px; }
.rows dd { margin: 0; font-size: 17px; font-weight: 600; }
.rows .num { font-size: 22px; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); font-weight: 400; font-size: 15px; }

.manage { margin-top: 36px; }
.manage__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 12px 0; }
.confirm-cancel summary { list-style: none; }
.confirm-cancel summary::-webkit-details-marker { display: none; }
.confirm-cancel[open] summary { background: var(--wash); }
.confirm-cancel form { display: grid; gap: 10px; margin-top: 12px; width: min(400px, 100%); }
.confirm-cancel label { font-size: 14px; color: var(--ink-2); }

/* --- Narrow screens: stack the two columns ------------------------------------------ */

@media (max-width: 960px) {
  .sheet { grid-template-columns: 1fr; min-height: 0; }
  .sheet__left { padding: 20px 20px 28px; border-right: 0; border-bottom: 2px solid var(--rule); }
  .sheet__right { padding: 24px 20px 40px; }
  .headline { margin-top: 20px; font-size: 38px; }
  .headline--index { font-size: 44px; }
  .facts dd { font-size: 16px; }
  .month { margin-top: 24px; }
  .cal__cell { height: 52px; padding: 5px 6px; font-size: 17px; }
  .cal__bar { left: 6px; bottom: 7px; width: calc(var(--n) * 5px); }
  .day { margin-top: 0; }
  .day__title { font-size: 34px; }
  .times { column-gap: 16px; margin-top: 16px; }
  .time__label { font-size: 26px; }
  .status { font-size: 64px; margin-top: 28px; }
  .tz__form select { width: 170px; }
  /* Weeks already over are noise on a phone; the times matter more. */
  .cal__cell--pastweek { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* --- Length choice -------------------------------------------------------- */
.lengths { display: flex; gap: 8px; margin-top: 16px; }
.lengths__item { padding: 8px 14px; border: 2px solid var(--rule); font-weight: 700; text-decoration: none; }
.lengths__item--current { background: var(--signal); }
.lengths a.lengths__item:hover { background: var(--wash); }
