/* taurenbrown.com booking page and its admin.
   One family in four sizes (13, 15, 17, 26) and three weights (400, 500, 600).
   One radius for controls. Grey fill means "you can choose this"; ink means "chosen". */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ground: #f4f5f7;
  --surface: #ffffff;
  --ink: #11151c;
  --ink-hover: #2a303b;
  --on-ink: #ffffff;
  --text-2: #58616e;
  --text-3: #8b939f;
  --line: #e3e6eb;
  --line-strong: #c8cdd6;
  --fill: #eff1f4;
  --fill-hover: #e1e5eb;
  --ok: #0b7b3c;
  --ok-fill: #e6f3ec;
  --error: #c21f2e;
  --ring: rgb(17 21 28 / 0.14);
  --shadow: 0 1px 2px rgb(17 21 28 / 0.04), 0 18px 44px -18px rgb(17 21 28 / 0.14);
  --r: 10px;
  --r-panel: 16px;
  --small: 0.8125rem;
  --large: 1.0625rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d0f13;
    --surface: #15181e;
    --ink: #f1f3f6;
    --ink-hover: #d5dae2;
    --on-ink: #11151c;
    --text-2: #a2aab7;
    --text-3: #69717e;
    --line: #252a33;
    --line-strong: #3a414d;
    --fill: #1f242c;
    --fill-hover: #2a303a;
    --ok: #55c58e;
    --ok-fill: #15291f;
    --error: #ff8f85;
    --ring: rgb(241 243 246 / 0.2);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 44px -18px rgb(0 0 0 / 0.6);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  /* The panel hangs from a fixed top edge, so it never jumps when a step is taller or shorter. */
  place-items: start center;
  align-content: start;
  padding: clamp(40px, 17vh, 180px) 24px 40px;
  background: var(--ground);
  color: var(--ink);
  font: 400 0.9375rem/1.5 "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--ink);
  scrollbar-color: var(--line-strong) transparent;
}

::selection { background: var(--ink); color: var(--on-ink); }

h1, h2, p, ul, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1 { font-size: 1.625rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.022em; text-wrap: balance; }
h2 { font-size: var(--large); line-height: 1.4; font-weight: 600; letter-spacing: -0.011em; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

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

/* ------------------------------------------------------------ the panel */

.panel {
  width: min(100%, 1040px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
}

.host { display: flex; flex-direction: column; padding: 36px 32px 24px; }
.lede { margin-top: 12px; color: var(--text-2); text-wrap: pretty; }
.panel[data-step="details"] .lede { display: none; }

.facts { margin: 28px 0 32px; display: grid; gap: 14px; }
.facts li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.facts .icon { margin-top: 2px; color: var(--text-2); }
.facts li > span { display: grid; }
.facts strong { font-weight: 600; }
#fact-when .icon { color: var(--ink); }
#fact-time { color: var(--text-2); font-weight: 400; font-variant-numeric: tabular-nums; }

/* The time zone picker: a real select, drawn as a quiet line of text. */
.tz {
  position: relative;
  align-self: flex-start;
  max-width: calc(100% + 20px);
  margin: 0 -10px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--r);
  color: var(--text-2);
  transition: background-color 150ms, color 150ms;
}
.host .tz { margin-top: auto; }
.tz:hover { background: var(--fill); color: var(--ink); }
.tz:focus-within { outline: 2px solid var(--ink); outline-offset: 0; color: var(--ink); }
.tz #tz-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz .chevron { width: 14px; height: 14px; margin-left: -6px; }
.tz select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; appearance: none; }

/* ------------------------------------------------------------ step 1: pick a time */

.pick { display: grid; grid-template-columns: minmax(0, 1fr) 264px; border-left: 1px solid var(--line); }
.calendar { padding: 32px 32px 28px; }
.times { padding: 32px 0 0; border-left: 1px solid var(--line); min-width: 0; }

.month { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.month-nav { display: flex; gap: 4px; margin-right: -6px; }
.icon-button {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: var(--r); background: none; color: var(--ink);
  transition: background-color 150ms;
}
.icon-button:hover:not(:disabled) { background: var(--fill); }
.icon-button:disabled { color: var(--text-3); opacity: 0.55; cursor: default; }

.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.weekdays { margin-top: 20px; font-size: var(--small); font-weight: 500; color: var(--text-2); }
.days { margin-top: 10px; row-gap: 6px; grid-auto-rows: 44px; min-height: 294px; align-content: start; }

.day {
  position: relative;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: var(--r); background: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.day:disabled { cursor: default; }
.day:not(:disabled) { background: var(--fill); color: var(--ink); font-weight: 600; transition: background-color 150ms, color 150ms, transform 150ms var(--ease); }
.day:not(:disabled):hover { background: var(--fill-hover); }
.day:not(:disabled):active { transform: scale(0.96); }
.day[aria-pressed="true"], .day[aria-pressed="true"]:hover { background: var(--ink); color: var(--on-ink); }
.day.today::after {
  content: ""; position: absolute; bottom: 7px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}

.times h2 { height: 32px; display: flex; align-items: center; padding: 0 24px; }
/* One column of times that runs to the panel's bottom edge, so a cut-off row shows there is more. */
.slots {
  margin-top: 20px;
  display: grid; gap: 8px; align-content: start;
  max-height: 356px; overflow-y: auto; scrollbar-width: thin;
  padding: 2px 24px 24px;
}
.slot {
  height: 40px; border: 0; border-radius: var(--r);
  background: var(--fill); color: var(--ink);
  font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background-color 150ms, color 150ms, transform 150ms var(--ease);
}
.slot:hover { background: var(--fill-hover); }
.slot:active { transform: scale(0.98); }
.slot[aria-pressed="true"], .slot[aria-pressed="true"]:hover { background: var(--ink); color: var(--on-ink); }

.notice { margin: 16px 24px 0; color: var(--error); font-size: var(--small); font-weight: 500; }
.notice + .slots { margin-top: 12px; }

/* Loading: the shape of the calendar, before the times arrive. */
.skeleton { background: var(--fill); border-radius: var(--r); animation: breathe 1.4s ease-in-out infinite; }
.days .skeleton { width: 44px; height: 44px; }
.slots .skeleton { height: 40px; }
@keyframes breathe { 50% { opacity: 0.45; } }

.empty { grid-column: 1 / -1; padding: 32px; display: grid; align-content: center; justify-items: start; gap: 8px; min-height: 420px; }
.empty p { color: var(--text-2); max-width: 44ch; }
.empty .button { margin-top: 12px; }

/* ------------------------------------------------------------ step 2: your details */

.details { border-left: 1px solid var(--line); padding: 28px 40px 36px; display: grid; gap: 20px; align-content: start; }
.details > * { max-width: 640px; width: 100%; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; align-items: start; }

.text-button {
  justify-self: start; width: auto !important;
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: -10px; padding: 6px 12px 6px 6px;
  border: 0; border-radius: var(--r); background: none;
  color: var(--text-2); font-weight: 500;
  transition: background-color 150ms, color 150ms;
}
.text-button:hover { background: var(--fill); color: var(--ink); }

.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 500; }
.field legend { padding: 0; margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="time"], textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 150ms, box-shadow 150ms;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="time"], .select { height: 46px; }
textarea { display: block; min-height: 112px; resize: vertical; line-height: 1.5; }
input:hover, textarea:hover, .select:hover { border-color: var(--text-3); }
input:focus-visible, textarea:focus-visible, .select:focus-visible {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring);
}
[aria-invalid="true"] { border-color: var(--error) !important; }

.hint { font-size: var(--small); color: var(--text-2); }
.field:has(.error:not([hidden])) .hint { display: none; }
.error { font-size: var(--small); font-weight: 500; color: var(--error); }

/* Meet or phone: a choice, not an action, so the chosen one gets an ink ring rather than the button's fill. */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
  height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r);
  background: var(--fill); color: var(--text-2); font-weight: 500;
  transition: background-color 150ms, color 150ms, box-shadow 150ms;
}
.segmented input:hover + span { background: var(--fill-hover); color: var(--ink); }
.segmented input:checked + span { color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 2px var(--ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.button {
  justify-self: start;
  height: 46px; padding: 0 22px;
  border: 0; border-radius: var(--r);
  background: var(--ink); color: var(--on-ink);
  font-weight: 600;
  transition: background-color 150ms, transform 150ms var(--ease), opacity 150ms;
}
.button:hover:not(:disabled) { background: var(--ink-hover); }
.button:active:not(:disabled) { transform: scale(0.98); }
.button:disabled { opacity: 0.55; cursor: default; }
.details .button { width: auto; min-width: 148px; margin-top: 4px; }

/* ------------------------------------------------------------ step 3: booked */

.panel[data-step="done"] { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.panel[data-step="done"] .host { display: none; }
.done { padding: 44px 44px 40px; }
.badge { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-fill); color: var(--ok); }
.badge .icon { width: 22px; height: 22px; stroke-width: 2; }
.done h1 { margin-top: 20px; outline: none; }
.done-when { margin-top: 20px; display: grid; gap: 2px; }
.done-when strong { font-size: var(--large); font-weight: 600; }
.done-when span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.done-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-2); text-wrap: pretty; overflow-wrap: anywhere; }
.done-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.done-links a, .link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color 150ms; }
.done-links a:hover, .link:hover { text-decoration-color: var(--ink); }

.noscript { grid-column: 1 / -1; padding: 24px 32px; border-top: 1px solid var(--line); color: var(--text-2); }

/* Two quiet links under the panel. */
.legal { display: flex; gap: 20px; margin-top: 20px; font-size: var(--small); }
.legal a { color: var(--text-2); text-decoration: none; }
.legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Privacy and terms: the settings sheet, with paragraphs held to a reading width. */
.prose .block { gap: 8px; }
.prose p { max-width: 68ch; text-wrap: pretty; }
.prose > .quiet { max-width: none; padding-top: 24px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ admin */

.admin { padding-top: 40px; }
.sheet { max-width: 760px; grid-template-columns: minmax(0, 1fr); padding: 8px 40px 36px; }
.signin { padding: 28px 0 0; display: grid; gap: 4px; justify-items: start; }
.signin .lede { margin: 8px 0 20px; max-width: 52ch; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }

.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding: 28px 0 24px; }
.sheet-head nav { display: flex; align-items: center; gap: 16px; }
.sheet-head .text-button { margin: 0; padding: 6px 10px; }

.block { padding: 24px 0; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.quiet { color: var(--text-2); max-width: 64ch; text-wrap: pretty; }
.block-actions { display: flex; align-items: center; gap: 12px; }
.block-actions:not(:has(> :not([hidden]))) { display: none; }
.block-actions .text-button { margin-left: 0; padding: 6px 10px; }

.calls { display: grid; }
.call { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 0; }
.call + .call { border-top: 1px solid var(--line); }
.call:first-child { padding-top: 0; }
.call:last-child { padding-bottom: 0; }
.call-when, .call-who { display: grid; gap: 2px; justify-items: start; }
.call-when span, .call-who > span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.call strong { font-weight: 600; }
.call .link { font-weight: 400; overflow-wrap: anywhere; }
.call-topic { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 60ch; }
/* Wide enough for "Cancel this call?", so the first press does not rewrap the row. */
.call .text-button { margin: -6px -10px 0 0; padding: 6px 10px; min-width: 140px; justify-content: flex-end; }
.text-button.danger, .text-button.danger:hover { color: var(--error); }

.week { display: grid; gap: 8px; }
.weekday { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; min-height: 46px; gap: 16px; }
.hours { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.hours input[type="time"] { width: 136px; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; justify-self: start; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b939f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  text-overflow: ellipsis;
}

.save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.save p { color: var(--text-2); }
.save p.error { color: var(--error); }

/* ------------------------------------------------------------ motion */

/* A step arriving: one short settle, from content that is already there. */
.step.arrive { animation: arrive 260ms var(--ease) backwards; }
.slots.arrive > * { animation: arrive 220ms var(--ease) backwards; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } }

/* The one authored moment: the tick draws itself when the call is booked. */
.done.arrive .badge { animation: pop 420ms var(--ease) backwards; }
.done.arrive .badge .icon { stroke-dasharray: 20; animation: draw 420ms 160ms var(--ease) backwards; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 20; } }

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

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1080px) {
  .panel { grid-template-columns: 288px minmax(0, 1fr); }
  .host { padding: 32px 28px 20px; }
  .pick { grid-template-columns: minmax(0, 1fr) 232px; }
  .calendar { padding: 28px 20px 24px; }
  .times { padding-top: 28px; }
  .times h2 { padding: 0 20px; }
  .slots { padding-inline: 20px; }
  .notice { margin-inline: 20px; }
  .details { padding: 24px 28px 32px; }
}

/* Narrow windows and tablets: the host sits on top, the calendar and its times stay side by side. */
@media (max-width: 900px) {
  body { padding-top: 40px; }
  .panel { max-width: 720px; grid-template-columns: minmax(0, 1fr); }
  .panel[data-step="done"] { max-width: 520px; }
  .host { padding: 32px 28px 20px; }
  .facts { margin: 20px 0 12px; gap: 10px; }
  .pick, .details, .empty { border-left: 0; border-top: 1px solid var(--line); }
  .calendar { padding: 24px 28px; }
  .times { padding-top: 24px; }
  .empty { min-height: 0; padding: 32px 28px 48px; }
  .details { padding: 20px 28px 36px; }
  /* With a time chosen, the header shrinks to the title and the summary so the form starts higher. */
  .panel[data-step="details"] .tz { display: none; }
  .panel[data-step="details"] .facts { margin-bottom: 0; }
  .sheet { padding: 0 28px 36px; }
  .call { grid-template-columns: minmax(0, 1fr) auto; }
  .call-who { grid-column: 1 / -1; grid-row: 2; }
  /* 16px inputs stop iOS from zooming the page on focus */
  input[type="text"], input[type="email"], input[type="tel"], input[type="time"], textarea, .select { font-size: 1rem; }
}

/* Phones: the page is the panel, and everything stacks. */
@media (max-width: 599px) {
  body, body.admin { padding: 0; background: var(--surface); }
  .legal { margin: 0; padding: 0 20px 32px; justify-self: start; }
  .panel, .panel[data-step="done"] { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .host { padding: 32px 20px 12px; }
  .pick { grid-template-columns: minmax(0, 1fr); }
  .calendar { padding: 20px 20px 4px; }
  .days { min-height: 0; }
  .times { padding: 24px 20px 40px; border-left: 0; }
  .times h2 { height: auto; padding: 0; }
  .slots { margin-top: 12px; max-height: none; overflow: visible; padding: 0; }
  .notice { margin-inline: 0; }
  .slot { height: 46px; }
  .icon-button { width: 40px; height: 40px; }
  .month { height: 40px; }
  .empty { padding-inline: 20px; }
  .details { padding: 16px 20px 40px; }
  .details .button { width: 100%; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .panel[data-step="details"] .facts { margin-bottom: 12px; }
  .done { padding: 48px 20px; }
  .sheet { padding: 0 20px 40px; }
  /* Hours sit under the day's name, so the time fields have room. */
  .weekday { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 6px 0; }
  .weekday .off { display: none; }
  .hours input[type="time"] { width: auto; flex: 1; min-width: 0; }
}

@media (max-width: 359px) {
  .day, .days .skeleton { width: 38px; height: 38px; }
  .days { grid-auto-rows: 38px; }
}
