/* Furfilled, the site. The look is the app's (woolkin-ios Core/Design/Theme.swift):
   cream paper, white cards, ink type, pill shapes, one typeface with tracking that
   tightens as it grows, monospaced capitals for anything that reads like a gauge, and
   colour only as a small mark. Coral is the one accent and it sits only on the button. */

:root {
  --cream: #F5F1E4;
  --white: #FFFFFF;
  --sand: #E0DBCE;
  --mist: #D5D5D4;
  --ink-day: #2C2E2A;
  --stone: #696B67;
  --slate: #25262D;
  --slate-raised: #2E2F37;
  --graphite: #383A42;
  --bone: #F2F2F3;
  --fog: #9A9DA8;
  --ash: #54565F;
  --grass: #8ED462;
  --coral: #FF705D;

  /* What a screen draws with (Palette.day). A night beat swaps these. */
  --ink: var(--ink-day);
  --soft: var(--stone);
  --card: var(--white);
  --well: var(--white);
  --sunk: var(--sand);
  --line: var(--mist);
  --action: var(--ink-day);
  --on-action: var(--white);

  --ground: var(--cream);
  --bar-ink: var(--ink-day);
  --bar-soft: var(--stone);

  --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html[data-ground="night"] { --bar-ink: var(--bone); --bar-soft: var(--fog); }

[data-theme="night"] {
  --ink: var(--bone);
  --soft: var(--fog);
  --card: var(--graphite);
  --well: var(--slate-raised);
  --sunk: var(--slate-raised);
  --line: var(--ash);
  --action: var(--bone);
  --on-action: var(--slate);
  color: var(--ink);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: color-mix(in srgb, var(--bar-ink) 30%, transparent) transparent;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.014em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, p, ul, fieldset, legend { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -64px; z-index: 30; background: var(--ink-day); color: var(--white); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ type -- */

h1, h2 {
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 1.1rem + 4.4vw, 4.75rem); }
h2 { font-size: clamp(1.75rem, 1.05rem + 3vw, 3.5rem); letter-spacing: -0.045em; }

.lede { color: var(--soft); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem); max-width: 31em; text-wrap: pretty; }
.more { color: var(--soft); font-size: 0.9375rem; max-width: 34em; text-wrap: pretty; }
.note { color: var(--soft); font-size: 0.9375rem; min-height: 1.5em; }

.label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- top bar -- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: var(--bar-ink);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.mark {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.hours { display: none; }

.clock {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.clock__name { color: var(--bar-soft); }

/* On a phone the bar sits on the room, so its two ends are white capsules, like the
   chips along the top of the app's home screen. */
@media (max-width: 640px) {
  .mark, .clock {
    background: var(--white);
    color: var(--ink-day);
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
  }
  .mark { font-size: 1.0625rem; }
  .clock__name { color: var(--stone); }
}

@media (min-width: 641px) {
  .bar { padding: 22px var(--gutter) 0; transition: color 300ms var(--ease); }
  .hours {
    display: flex;
    gap: clamp(0.75rem, 1.8vw, 1.75rem);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .hours a {
    color: var(--bar-soft);
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1.5px solid transparent;
    transition: color 160ms var(--ease), border-color 160ms var(--ease);
  }
  .hours a[aria-current="true"] { color: var(--bar-ink); border-bottom-color: currentColor; }
  .clock__name { display: none; }
}
@media (min-width: 641px) and (hover: hover) and (pointer: fine) {
  .hours a:hover { color: var(--bar-ink); }
}
@media (min-width: 641px) and (max-width: 860px) {
  .clock { display: none; }
}

/* ----------------------------------------------------------- the button -- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 60px;
  padding: 8px 8px 8px 26px;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.cta__disc {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--on-action) 16%, transparent);
  color: var(--on-action);
}
/* Coral is for what can be clicked. Until the app is in the store the button is not a link. */
a.cta .cta__disc { background: var(--coral); color: var(--ink-day); }
a.cta { transition: transform 140ms var(--ease); }
a.cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  a.cta .cta__disc { transition: transform 180ms var(--ease); }
  a.cta:hover .cta__disc { transform: translate(2px, -2px); }
}

/* ------------------------------------------------- the page with no script -- */
/* A plain column. Each hour brings its own picture of the room. */

.room { display: none; }

.beat {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
  max-width: 78rem;
  margin: 0 auto;
}
.beat[data-theme="night"] { background: var(--slate); max-width: none; }
.beat[data-theme="night"] > * { max-width: 36rem; }
.beat:first-child { padding-top: clamp(6rem, 12vw, 9rem); }
.beat__still { width: 100%; height: auto; border-radius: 36px; max-width: 26rem; justify-self: center; }
.beat__copy { display: grid; gap: 1.125rem; justify-items: start; align-content: center; }
@media (min-width: 760px) {
  .beat { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); }
  .beat__still { order: 2; }
  .beat[data-theme="night"] { grid-template-columns: minmax(0, 36rem) minmax(0, 26rem); justify-content: center; }
}

/* ------------------------------------------------------- the small tools -- */

.picker { display: flex; gap: clamp(0.375rem, 1.2vw, 0.875rem); width: 100%; max-width: 26rem; }
.picker button { flex: 1 1 0; min-width: 0; display: grid; gap: 6px; justify-items: center; }
.picker img {
  width: 100%;
  max-width: 68px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  background: var(--well);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.picker span { font-family: var(--mono); font-size: 0.65625rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--soft); }
.picker button[aria-pressed="true"] img { box-shadow: inset 0 0 0 2.5px var(--ink); }
.picker button[aria-pressed="true"] span { color: var(--ink); }
.picker button:active img { transform: scale(0.95); }

.warmth { display: grid; gap: 10px; width: 100%; max-width: 26rem; }
.meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.meter i { height: 8px; border-radius: 4px; background: var(--sunk); transition: background-color 240ms var(--ease); }
.meter i.on { background: var(--grass); }
.things { display: grid; gap: 6px; margin-top: 4px; }
.things button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  min-height: 48px;
  padding: 8px 10px 8px 18px;
  border-radius: 18px;
  background: var(--well);
  font-size: 0.9375rem;
  transition: transform 140ms var(--ease);
}
.things button:active { transform: scale(0.98); }
.tick {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: transparent;
  transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease), color 200ms var(--ease);
}
.things button[aria-pressed="true"] .tick { background: var(--grass); box-shadow: none; color: var(--ink-day); }

.timer { display: grid; gap: 4px; width: 100%; max-width: 22rem; }
.timer .label { justify-content: flex-start; gap: 1.25rem; }
.timer__state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 0.6em; vertical-align: 0.08em; }
.timer__clock {
  font-size: clamp(4rem, 2.6rem + 6vw, 6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.ask { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask legend { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.ask button {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--well);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 140ms var(--ease);
}
.ask button:active { transform: scale(0.97); }
.ask button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* ---------------------------------------------------------------- footer -- */

.foot {
  background: var(--slate);
  color: var(--fog);
  padding: 2.5rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 0.875rem;
  font-size: 0.875rem;
}
.foot__mark { color: var(--bone); font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.035em; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot__links a { color: var(--bone); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.foot__note { max-width: 44em; }
@media (min-width: 760px) {
  .foot { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 3rem; }
  .foot__note { grid-column: 1 / -1; }
}

/* =========================================================================
   The live page. site.js adds .live to <html> and from here on there is one
   room, pinned for the whole story, and the scroll is the time of day.
   ========================================================================= */

html.live .day { height: calc(var(--track, 7.5) * 100vh + 100vh); height: calc(var(--track, 7.5) * 100svh + 100svh); }
html.live .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
html.live .beat__still { display: none; }
html.live .room { display: block; }
html.live .beat,
html.live .beat[data-theme="night"] { background: none; max-width: none; margin: 0; padding: 0; display: block; }
html.live .beat[data-theme="night"] > * { max-width: none; }
html.live .beat { will-change: opacity, transform; }
html.live .beat[data-off] { pointer-events: none; }

.room__box { position: absolute; inset: 0; overflow: hidden; background: var(--floor, #A98469); }
.room__art img {
  position: absolute;
  left: var(--art-left, 0px);
  top: var(--art-top, 0px);
  width: var(--art-w, 100%);
  height: auto;
  max-width: none;
  opacity: 0;
  will-change: opacity;
}
.room__art img[data-light="dawn"] { opacity: 1; }
.room__art { position: absolute; inset: 0; will-change: transform; }
/* Where the art ends on a tall screen, it eases into the colour of the floor. */
.room__fade {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--art-top, 0px) + var(--art-h, 100%) * 0.955);
  height: calc(var(--art-h, 100%) * 0.05);
  z-index: 3;
  background: linear-gradient(to bottom, transparent, var(--floor, #A98469) 88%);
}
.room--flat .room__art img { top: calc(var(--art-top, 0px) + var(--art-h, 0px) * 0.1); }
.room--flat .room__scene { display: none; }
/* Without WebGL the room is one flat picture of the kitten, so there is nothing to choose. */
.room--flat ~ .beats .picker, .room--flat ~ .beats .note { display: none; }
.room__scene { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 420ms var(--ease); }
.room__scene.is-ready { opacity: 1; }

.room__pet {
  position: absolute;
  left: var(--pet-x, 20%);
  top: var(--pet-y, 30%);
  width: var(--pet-w, 60%);
  height: var(--pet-h, 40%);
  border-radius: 40%;
  cursor: pointer;
  touch-action: manipulation;
}
.room__pet:focus-visible { outline-offset: -6px; border-radius: 40%; }

.bubble {
  position: absolute;
  left: 50%;
  top: var(--bubble-y, 30%);
  translate: -50% -100%;
  width: max-content;
  max-width: min(78%, 22rem);
  padding: 11px 18px 12px;
  border-radius: 22px;
  background: var(--white);
  color: var(--ink-day);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.94);
  transform-origin: 50% 100%;
  transition: opacity 200ms var(--ease), transform 260ms var(--ease);
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--white);
}
.bubble.is-on { opacity: 1; transform: none; }

.room__hint {
  position: absolute;
  left: calc(var(--pet-x, 20%) + var(--pet-w, 60%) * 0.86);
  top: calc(var(--pet-y, 30%) + var(--pet-h, 40%) * 0.5);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--white);
  color: var(--stone);
  font-family: var(--mono);
  font-size: 0.65625rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.room__hint.is-on { opacity: 1; }

/* --------------------------------------------------------- live, on a phone -- */
/* The app's own layout: the room fills the screen and a card lies across the floor. */

@media (max-width: 640px) {
  /* A phone's toolbars come and go. The stage is as tall as the screen without them, so
     the room always reaches the bottom, and the card stands where the screen ends with
     them, so it is never underneath one. */
  html.live .day { height: calc(var(--track, 7.5) * 100svh + 100lvh); }
  html.live, html.live body { background-color: var(--floor-page, #A98469); }
  html.live .stage { height: 100lvh; }
  html.live .room { position: absolute; inset: 0; }
  html.live .beats {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    bottom: calc(10px + max(100lvh - 100svh, env(safe-area-inset-bottom)));
    height: 0;
  }
  html.live .beat,
  html.live .beat[data-theme="night"] {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    color: var(--ink);
    border-radius: 36px;
    padding: 22px 20px 20px;
    --well: var(--cream);
  }
  html.live .beat[data-theme="night"] { --well: var(--slate-raised); }
  html.live .beat__copy { gap: 12px; justify-items: stretch; }
  html.live .beat h1, html.live .beat h2 { font-size: clamp(1.75rem, 7.6vw, 2.125rem); letter-spacing: -0.045em; }
  html.live .lede { font-size: 1rem; line-height: 1.42; }
  html.live .more, html.live .wide { display: none; }
  html.live .cta { width: 100%; margin-top: 4px; }
  html.live .picker { max-width: none; gap: 4px; }
  html.live .picker span { white-space: nowrap; font-size: 0.625rem; letter-spacing: 0.05em; }
  html.live .warmth, html.live .timer { max-width: none; }
  html.live .things button { min-height: 44px; }
  html.live .timer__clock { font-size: 4.25rem; }
  html.live .note { font-size: 0.875rem; min-height: 1.4em; }
  html.live .room__hint { left: auto; right: 14px; }
}
/* A short screen, which is most phones while the browser's toolbars are showing
   (site.js sets .short from the small viewport, so it does not flip mid-scroll). */
@media (max-width: 640px) {
  html.live.short .beat, html.live.short .beat[data-theme="night"] { padding: 18px 18px 16px; border-radius: 30px; }
  html.live.short .beat__copy { gap: 9px; }
  html.live.short .beat h1, html.live.short .beat h2 { font-size: 1.625rem; }
  html.live.short .lede { font-size: 0.9375rem; }
  html.live.short .warmth { gap: 8px; }
  html.live.short .warmth .label { display: none; }
  html.live.short .things { gap: 5px; margin-top: 2px; }
  html.live.short .things button { min-height: 40px; font-size: 0.875rem; }
  html.live.short .cta { min-height: 54px; }
  html.live.short .cta__disc { width: 38px; height: 38px; }
  html.live.short .timer__clock { font-size: 3.5rem; }
}

/* ------------------------------------------------------- live, with room -- */
/* The room is a felt box standing on the page, and the words sit beside it. */

@media (min-width: 641px) {
  html.live .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(1.5rem, 5vw, 5.5rem);
    padding: 0 var(--gutter);
    max-width: 88rem;
    margin: 0 auto;
  }
  html.live .room {
    position: relative;
    order: 2;
    height: min(84svh, 54rem, 118vw);
    aspect-ratio: 7 / 10;
    margin-top: 2.5rem;
  }
  html.live .room__box { border-radius: 40px; }
  html.live .beats { position: relative; order: 1; height: 100%; }
  html.live .beat,
  html.live .beat[data-theme="night"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    translate: 0 -50%;
    margin-top: 1.25rem;
    color: var(--ink);
  }
  html.live .beat__copy { gap: clamp(1rem, 2.2vh, 1.5rem); }
  html.live .beat .cta { margin-top: 0.5rem; }
  html.live .beat .more { margin-top: 0.25rem; }
  /* Stone on the dusk paper falls just short of 4.5:1, so secondary text goes a step darker there. */
  html.live .beat[data-beat="dusk"] { --soft: #5B5C57; --well: #FFF7EC; }
}

/* On a short wide screen the tools and the long lines do not both fit. */
@media (min-width: 641px) and (max-height: 620px) {
  html.live .more { display: none; }
  html.live .beat h1 { font-size: clamp(2rem, 9vh, 3.25rem); }
  html.live .beat h2 { font-size: clamp(1.75rem, 7.5vh, 2.75rem); }
  html.live .things button { min-height: 40px; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble, .bubble.is-on { transition: opacity 200ms linear; transform: none; }
  a.cta, a.cta .cta__disc, .picker img, .things button, .ask button { transition: none; }
  a.cta:active, .picker button:active img, .things button:active, .ask button:active { transform: none; }
}

/* ============================================================ plain pages == */

.page { max-width: 44rem; margin: 0 auto; padding: clamp(6.5rem, 14vw, 9rem) var(--gutter) clamp(3rem, 8vw, 6rem); }
.page h1 { font-size: clamp(2.125rem, 1.4rem + 3vw, 3.25rem); margin-bottom: 0.75rem; }
.page h2 { font-size: 1.375rem; letter-spacing: -0.03em; line-height: 1.2; margin: 2.75rem 0 0.75rem; }
.page p, .page li { color: var(--ink); max-width: 38em; }
.page p + p { margin-top: 0.875rem; }
.page .when { color: var(--soft); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 2rem; }
.page ul { list-style: disc; padding-left: 1.25rem; display: grid; gap: 0.5rem; margin: 0.75rem 0; }
.page a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.page dl { margin: 0; display: grid; gap: 1.5rem; }
.page dt { font-weight: 500; letter-spacing: -0.02em; }
.page dd { margin: 0.25rem 0 0; max-width: 38em; }
.bar--page { position: absolute; }
.bar--page .mark, .bar--page .back { background: none; padding: 0; height: auto; }
.bar--page .back { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; text-decoration: none; color: var(--stone); }
