/* ------------------------------------------------------------------ */
/* Colors and type. Defined once here; nothing below carries a literal */
/* color except the cursor, which has to inline its own SVG.           */
/* ------------------------------------------------------------------ */
:root {
  --bg:        #fdf2f4;                 /* off-white, a little pink */
  --fg:        #6e2f47;                 /* dark off-pink text */
  --fg-dim:    rgba(110, 47, 71, 0.68); /* secondary text, past days */
  --hi:        #ff9fc6;                 /* the highlight: arrow, pressed, selection */
  --hi-soft:   #ffd9e8;                 /* button and strip fill */
  --hi-fg:     #4a1830;                 /* text on a highlight */
  --green:     #bff3b4;                 /* link hover, the second accent */
  --rule:      rgba(110, 47, 71, 0.28); /* borders */

  --display: 'Xanh Mono', 'Courier New', monospace;
  --sans:    'Inter', system-ui, sans-serif;

  /* The flower border on each side. */
  --band: clamp(28px, 10vw, 190px);

  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 2 L3 19 L7.5 14.8 L10.6 21.5 L13.4 20.2 L10.4 13.7 L16.5 13.7 Z' fill='%23ff9fc6' stroke='%236e2f47' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  cursor: var(--cursor), auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

a,
button,
[role='button'] {
  cursor: var(--cursor), pointer;
}

::selection {
  background: var(--hi);
  color: var(--hi-fg);
}

.sheet {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* The scattered flowers around the edges, placed by flowers.js. */
.field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.field span {
  position: absolute;
  line-height: 1;
  user-select: none;
}

/* ------------------------------------------------------------------ */
/* The masthead: the names, up in the flower border and behind it     */
/* ------------------------------------------------------------------ */
.masthead {
  position: relative;
  z-index: 0; /* under .field, so the flowers sit over the names */
  container-type: inline-size;
  --pad: 1.25rem;
  /* The names' line is centred in the top border band. */
  padding-top: calc(var(--band) / 2);
}

.names {
  /* The column's inner width... */
  --w: calc(min(100cqi, 42rem + 2 * var(--band)) - 2 * (var(--band) + var(--pad)));
  max-width: calc(42rem + 2 * var(--band));
  margin: 0 auto;
  padding: 0 calc(var(--band) + var(--pad));
  font-family: var(--display);
  font-weight: 400;
  /* ...fit exactly by one line of 31 monospace characters, each 0.5em wide
     less the letter-spacing: 31 x 0.48em = 14.88em. */
  font-size: calc(var(--w) / 15);
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transform: translateY(-50%);
}

.names .plus {
  font-style: italic;
  color: var(--hi);
}


/* ------------------------------------------------------------------ */
/* The schedule                                                        */
/* ------------------------------------------------------------------ */
.schedule {
  position: relative;
  z-index: 2;
  max-width: calc(42rem + 2 * var(--band));
  margin: 0 auto;
  /* Starts below the top border band the names sit in. */
  padding: calc(var(--band) / 2 + 1.5rem) calc(var(--band) + 1.25rem) calc(var(--band) + 4rem);
}

.schedule h1,
.schedule h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
}

.schedule h1 {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
}

.schedule h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.6rem;
  position: relative;
}

.schedule p {
  margin-bottom: 0.9rem;
}

.schedule strong {
  font-weight: 600;
}

.schedule a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--hi);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: background 0.15s ease;
}

.schedule a[target='_blank']::after {
  content: '\202F\2197'; /* a no-break space, so the arrow never wraps alone */
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.75em;
}

/* Hover only where there is hover: a tap on a phone otherwise leaves the
   highlight stuck on. */
@media (hover: hover) {
  .schedule a:hover {
    background: var(--green);
    color: var(--hi-fg);
    text-decoration: none;
  }
}

.schedule a:focus-visible,
.schedule button:focus-visible,
.day-toggle:focus-visible,
.flower-switch:focus-visible {
  outline: 2px solid var(--hi);
  outline-offset: 2px;
}

/* A day: its heading toggles it. Open is the default; app.js closes a day
   at midnight after it ends. */
.day {
  position: relative;
  margin: 1rem 0 2.25rem;
}

.day-toggle {
  position: relative;
  padding: 0.4rem 2rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  user-select: none;
}

@media (hover: hover) {
  .day-toggle:hover {
    background: var(--hi-soft);
  }
}

.day-toggle::after {
  content: '\25BE';
  position: absolute;
  right: 0.3rem;
  top: 50%;
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--fg);
  transform: translateY(-50%) rotate(-90deg);
  transition: transform 0.15s ease;
}

.day.open > .day-toggle::after {
  transform: translateY(-50%) rotate(0deg);
}

.day > *:not(.day-toggle) {
  display: none;
}

.day.open > *:not(.day-toggle) {
  display: revert;
}

.day.open > .day-toggle {
  margin-bottom: 1rem;
}

.day.past > .day-toggle {
  color: var(--fg-dim);
}

/* The arrow: where we are in time. It sits in the left margin, on a dab of
   background so it reads over the flower border on phones. */
.now-arrow {
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1;
  color: var(--hi);
  background: var(--bg);
  border-radius: 50%;
  padding: 0.2em 0.15em 0.2em 0.3em;
}

.schedule h2 .now-arrow {
  font-size: 0.8rem;
  left: -1.3rem;
}

/* ------------------------------------------------------------------ */
/* The video player                                                    */
/* ------------------------------------------------------------------ */
.player {
  margin: 1.25rem 0 1.5rem;
}

.player-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.player-buttons button {
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg);
  border-radius: 50px;
  padding: 0.3rem 0.9rem;
  transition: background 0.15s ease;
}

@media (hover: hover) {
  .player-buttons button:hover {
    background: var(--hi-soft);
  }
}

.player-buttons button[aria-pressed='true'] {
  background: var(--hi);
  color: var(--hi-fg);
}

.player-frame {
  width: min(100%, 22rem);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--fg);
  border-radius: 4px;
  overflow: hidden;
  background: var(--hi-soft);
}

.player-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* The flower agents, and their switch                                 */
/* ------------------------------------------------------------------ */
.agents {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.flower-switch {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 20;
  font-family: var(--display);
  font-size: 0.8rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 50px;
  padding: 0.1rem 0.6rem;
}

@media (hover: hover) {
  .flower-switch:hover {
    background: var(--hi);
    color: var(--hi-fg);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 0.98rem;
  }
  .masthead {
    --pad: 0.9rem;
  }
  .schedule {
    padding-left: calc(var(--band) + 0.9rem);
    padding-right: calc(var(--band) + 0.9rem);
  }
  /* "Thursday, October 1st" on one line on a 390px phone. */
  .schedule h1 {
    font-size: 1.45rem;
  }
  .schedule h2 {
    font-size: 1.15rem;
  }
  .now-arrow {
    left: -1.35rem;
  }
  .schedule h2 .now-arrow {
    left: -1.2rem;
  }
}

