/* Where is Ryan?
   One colour field carries the status (green = home, orange = travelling);
   the place name is the largest thing on the page; everything else is quiet. */

:root {
  --ground: #f1f3f4;
  --ink: #12181d;
  --muted: #55616c;
  --line: #d9dfe3;
  --neutral: #5d6872;
  --home: #135846;
  --away: #b13c12;
  --focus: #0b5fff;
  /* Trip colours for the look-ahead calendar: blue, amber, magenta, aqua, bronze, lavender.
     Every pair checked for colour-blind separation; day numbers are white on the dark three
     and ink on the light three, all at 4.5:1 or better. */
  --trip-0: #2563d9;
  --trip-1: #e3a800;
  --trip-2: #c0347a;
  --trip-3: #00a98a;
  --trip-4: #8f5a00;
  --trip-5: #a98cf0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c1014;
    --ink: #edf1f4;
    --muted: #9aa7b2;
    --line: #232c34;
    --neutral: #2a343c;
    --home: #0f4638;
    --away: #9a3512;
    --focus: #8bb2ff;
    --trip-0: #2f6be0;
    --trip-1: #c99400;
    --trip-2: #b8327a;
    --trip-3: #0db592;
    --trip-4: #9a6200;
    --trip-5: #a08aea;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(16px, 5vw, 48px) 16px 56px;
}

/* ---- status field ---- */

.panel {
  background: var(--neutral);
  color: #fff;
  border-radius: 24px;
  padding: clamp(24px, 6vw, 40px);
  transition: background-color 0.5s ease;
}
.panel[data-state="home"]   { background: var(--home); }
.panel[data-state="travel"] { background: var(--away); }

.kicker {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 500;
}

.place {
  margin: 0;
  font-size: clamp(2.4rem, 11vw, 4.25rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.facts {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px 32px;
}
.facts:empty { display: none; }

.fact dt {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.92;
}
.fact dd {
  margin: 2px 0 0;
  font-size: 1.2rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.fact .note {
  display: block;
  font-size: 0.92rem;
  font-weight: 400;
}

.maplink {
  display: inline-block;
  margin-top: 22px;
  color: #fff;
  font-weight: 600;
  text-underline-offset: 0.2em;
}
.maplink:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 4px;
}

.backnow,
.pill {
  display: inline-block;
  margin: 22px 0 0;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #12181d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.maplink:not([hidden]) + .backnow { margin-left: 16px; }
.backnow:focus-visible,
.gate .pill:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---- sign-in and access requests (inside the status field) ---- */

.gate { margin-top: 18px; }
.gate-text { margin: 0 0 22px; max-width: 34em; font-size: 1.05rem; }
.gsi { min-height: 44px; }
.request label { display: block; margin-bottom: 8px; font-weight: 600; }
.request textarea {
  display: block;
  width: 100%;
  max-width: 32em;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #12181d;
  font: inherit;
  resize: vertical;
}
.request textarea:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.request .pill { margin-top: 14px; }
.pill:disabled { opacity: 0.6; cursor: default; }
.gate-error { margin: 16px 0 0; font-weight: 600; }

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.linkbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* ---- look ahead ----
   Each trip gets one of six colours (t0-t5, set in app.js so trips in the same month differ),
   its days run together as one bar, rounded where a trip (or a week) starts and ends. */

.ahead { margin-top: 36px; }
.ahead-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.ahead h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.monthnav { display: flex; align-items: center; gap: 6px; }
.month {
  min-width: 9.5em;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.navbtn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: 400 1.6rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.navbtn:disabled { opacity: 0.35; cursor: default; }

.dows, .days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.dows span {
  padding-bottom: 6px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.days { row-gap: 6px; }
.day {
  position: relative;
  height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.t0 { --trip: var(--trip-0); --trip-ink: #fff; }
.t1 { --trip: var(--trip-1); --trip-ink: #12181d; }
.t2 { --trip: var(--trip-2); --trip-ink: #fff; }
.t3 { --trip: var(--trip-3); --trip-ink: #12181d; }
.t4 { --trip: var(--trip-4); --trip-ink: #fff; }
.t5 { --trip: var(--trip-5); --trip-ink: #12181d; }
.day.away { background: var(--trip, var(--away)); color: var(--trip-ink, #fff); }
.day.away.rs { border-start-start-radius: 23px; border-end-start-radius: 23px; }
.day.away.re { border-start-end-radius: 23px; border-end-end-radius: 23px; }
.day:not(.away) { border-radius: 23px; }
.day:not(.away):not(:disabled):hover { background: var(--line); }
.day.today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: currentColor;
}
.day[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: -3px; z-index: 1; }
.day.away[aria-pressed="true"] { outline-color: var(--trip-ink, #fff); box-shadow: inset 0 0 0 5px var(--trip, var(--away)); }
.days .day[aria-pressed="true"] { border-radius: 14px; }
.day:disabled { cursor: default; opacity: 0.4; }
.day:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; z-index: 2; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.legend button::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--trip, var(--away));
}
.legend .when { font-size: 0.92rem; }
.hint { margin: 12px 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---- upcoming trips ---- */

.trips li[class] .where::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--trip);
  vertical-align: 0.05em;
}

.upcoming { margin-top: 36px; }
.upcoming h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.trips {
  list-style: none;
  margin: 0;
  padding: 0;
}
.trips li {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.trips li:last-child { border-bottom: 1px solid var(--line); }

.when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.where { font-weight: 600; overflow-wrap: anywhere; }
.rel {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .trips li {
    grid-template-columns: 1fr auto;
    grid-template-areas: "where rel" "when when";
  }
  .where { grid-area: where; }
  .rel   { grid-area: rel; }
  .when  { grid-area: when; }
}

.foot {
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- who can see this (Ryan only) ---- */

.access { margin-top: 36px; }
.access h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; }
.people { list-style: none; margin: 0; padding: 0; }
.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.person:last-child { border-bottom: 1px solid var(--line); }
.who { min-width: 0; }
.who > span { display: block; overflow-wrap: anywhere; }
.who .name { font-weight: 600; }
.who .email, .who .state { color: var(--muted); font-size: 0.92rem; }
.who .pnote { margin: 4px 0; }
.person[data-status="pending"] .state { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.access .pill { margin: 0; min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }
.pill-ink { background: var(--ink); color: var(--ground); }
.pill-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.access .pill:focus-visible, .addrow input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.addperson label { display: block; margin: 22px 0 8px; font-weight: 600; }
.addrow { display: flex; gap: 8px; max-width: 32em; }
.addrow input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.addrow .pill { min-height: 44px; }
@media (max-width: 520px) {
  .person { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
}

/* ---- Flights Wrapped teaser (December and January) ----
   Its own colours, taken from /wrapped/, so it reads as a different thing
   from the status field above; the roundel is drawn with one gradient. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/wrapped/fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

.wrapped {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  margin-top: 36px;
  padding: 24px clamp(24px, 6vw, 40px) 28px;
  border-radius: 24px;
  background: #2d3bf5;
  color: #fff;
  text-decoration: none;
}
.wrapped::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -56px;
  right: -56px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd200 0 21%, #2d3bf5 21.5% 45%, #ff4f9a 45.5%);
}
.wrapped-kicker { display: block; font-weight: 600; }
.wrapped-title {
  display: block;
  margin: 2px 0 14px;
  font: 900 clamp(2.4rem, 10vw, 3.75rem)/0.95 "Big Shoulders Display", system-ui, sans-serif;
  color: #ffd200;
}
.wrapped-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 0.92rem;
}
.wrapped-stats b {
  display: block;
  font: 900 2rem/1 "Big Shoulders Display", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrapped-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 11px 20px;
  border-radius: 999px;
  background: #fff;
  color: #191428;
  font-weight: 700;
}
.wrapped:hover .wrapped-cta { background: #ffd200; }
.wrapped:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.foot a { color: inherit; text-underline-offset: 0.2em; }

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

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}
