/* ============================================================================
 * Winter WanderLand — the two looks: day (the default) and night
 *
 * Day is cream paper, deep evergreen ink, an evergreen accent, berry for the
 * one loud button. Night is the evergreen-at-night look the app was born
 * with, for a dark car. Both are set in a rounded sans (Nunito) with a serif
 * (Fraunces) for the titles.
 *
 * The script in the head of index.html decides which one before the first
 * paint and writes it on <html> as data-theme="day" or "night". People choose
 * Light, Match phone or Dark under the list on Tonight (LL.theme in
 * js/shared.js keeps it in localStorage as ll_theme: day, auto or night).
 * ?theme=day|auto|night sets it from a link.
 *
 * Nearly all of the day look is one token block: css/style.css and the
 * module sheets draw from tokens, so changing what the tokens mean changes
 * the app. The token names stay the v1 names (`--night` is the page ground,
 * `--amber` is the accent) in both looks. The night values are the ones in
 * css/style.css; nothing here restates them except where a picture needs
 * them whatever the look.
 *
 * A page with no data-theme at all (the bouncer) gets none of this: it stays
 * night, in Inter, as it was.
 * ========================================================================= */

/* ----------------------------------------------- both looks: the type --- */

html[data-theme] {
  --display: 'Nunito', 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --body:    'Nunito', 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif:   'Fraunces', Georgia, 'Times New Roman', serif;
  --radius:      18px;
  --radius-sm:   12px;
  --pin-radius:  16px;
}

/* The titles are the serif; everything you tap or scan stays the sans. */
html[data-theme] .hsheet-title,
html[data-theme] .card-title,
html[data-theme] .wordmark-text,
html[data-theme] .sheet-head h2,
html[data-theme] .empty h3,
html[data-theme] .lnd-h {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.015em;
  font-variant-numeric: normal;
}
html[data-theme] .hsheet-title { font-size: 25px; }
html[data-theme] .card-title { font-size: 22px; line-height: 1.15; }
html[data-theme] .lnd-h { letter-spacing: -.02em; }
/* Nunito runs lighter than Inter did at the same weight */
html[data-theme] .btn { font-weight: 700; border-radius: 999px; }
html[data-theme] .chip { font-weight: 600; }
html[data-theme] .hcard-title,
html[data-theme] .hrow-title { font-weight: 700; }
html[data-theme] .dock button { font-weight: 600; }

/* --------------------------------------------- the day look: the tokens --- */

html[data-theme="day"] {
  color-scheme: light;

  /* palette */
  --night:   #FBF8F1;   /* page ground: cream paper */
  --night-2: #FFFDF9;   /* surfaces: the sheet, bars, the dock */
  --night-3: #EFF1E7;   /* raised: quiet buttons, tiles, rows */
  --night-4: #E2E8DA;   /* pressed or hovered */
  --line:    rgba(23, 58, 46, .10);
  --line-2:  rgba(23, 58, 46, .18);
  --text:    #173A2E;   /* deep evergreen ink */
  --text-2:  #4A6156;
  --text-3:  #6F8278;
  --amber:   #1F6B4A;   /* the accent is evergreen here: on tonight, the primary action */
  --amber-2: #185A3D;
  --glow:    rgba(31, 107, 74, .22);
  --berry:   #C8283F;
  --berry-2: #AD1F35;
  --ok:      #1F8A57;
  --danger:  #C62F3A;
  --gold:    #E9A93A;   /* the bulb: the dot that says a house is on */

  /* derived */
  --amber-ink:  #FFFFFF;
  --amber-soft: rgba(31, 107, 74, .10);
  --amber-line: rgba(31, 107, 74, .38);
  --scrim:      rgba(23, 40, 33, .38);
  --glass:      rgba(255, 253, 249, .9);
  --shadow:     0 1px 2px rgba(23, 40, 33, .08), 0 8px 24px rgba(23, 40, 33, .12);
  --shadow-up:  0 -8px 30px rgba(23, 40, 33, .16);
  --grab:       rgba(23, 58, 46, .24);

}
@media (prefers-color-scheme: light) {
  html[data-theme="day"] { color-scheme: light; }
}

/* ------------------------------------------------------------- surfaces --- */

html[data-theme="day"] ::selection { background: rgba(31, 107, 74, .2); }
html[data-theme="day"] .dock button:active { background: rgba(23, 58, 46, .05); }
html[data-theme="day"] .hsheet { box-shadow: var(--shadow-up); }
html[data-theme="day"] .btn.danger:active { background: rgba(198, 47, 58, .1); }
@media (hover: hover) { html[data-theme="day"] .btn.danger:hover { background: rgba(198, 47, 58, .1); } }
html[data-theme="day"] .btn.glow { box-shadow: 0 6px 18px rgba(31, 107, 74, .28); }

/* ------------------------------------------------ "on tonight" is a bulb --- */

/* The words are evergreen; the dot beside them is the warm bulb. */
html[data-theme="day"] .dot.is-on,
html[data-theme="day"] .status-line.is-on::before,
html[data-theme="day"] .hcard-pill.is-on::before {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 169, 58, .26);
}
html[data-theme="day"] .hcard.is-on .hcard-media { box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(233, 169, 58, .3); }

/* --------------------------------------------------------------- the map --- */

/* On the map a house that is on is still a lit bulb in a wreath, and a
   neighbourhood count is a dark coin so it reads on pale streets. */
html[data-theme="day"] .glow-marker.is-on::after { background: #FFE7A3; }
html[data-theme="day"] .glow-marker.is-on::before { border-color: var(--gold); }
html[data-theme="day"] .glow-marker.is-dim::after { background: #7C8C83; box-shadow: 0 0 0 2px #FFFFFF, 0 1px 3px rgba(23, 40, 33, .3); }
html[data-theme="day"] .glow-marker.is-off::after { background: #FFFFFF; }
html[data-theme="day"] .cluster {
  background: var(--pine);
  border-color: #FFFFFF;
  color: #FFF4D6;
  box-shadow: 0 2px 6px rgba(23, 40, 33, .3);
}
html[data-theme="day"] .cluster.is-on { box-shadow: 0 0 0 3px rgba(233, 169, 58, .45), 0 2px 6px rgba(23, 40, 33, .3); }
html[data-theme="day"] .show-marker.is-sel { box-shadow: 0 0 0 3px var(--pine), 0 2px 8px rgba(23, 40, 33, .3); }

/* ------------------------------------------------- what stays night-dark --- */

/* The landing screen and the short opening sit on a photograph of a street
   at night, and their words are drawn for that. They keep the night tokens. */
html[data-theme="day"] .lnd,
html[data-theme="day"] .lnd-opening {
  color-scheme: dark;
  --night: #0B1612; --night-2: #11221B; --night-3: #1A3027; --night-4: #233E33;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --text: #F6F3EA; --text-2: #A9B7AD; --text-3: #74877D;
  --amber: #FFDF9A; --amber-2: #F0CC80; --glow: rgba(255, 206, 122, .34);
  --amber-ink: #14251C; --amber-soft: rgba(255, 223, 154, .12); --amber-line: rgba(255, 223, 154, .35);
  --glass: rgba(17, 34, 27, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

/* ------------------------------------------------------- map odds and ends --- */

/* On the day map the tour's numbered stops are evergreen coins; the numeral
   was the accent, which is evergreen too here, so it is warm white instead. */
html[data-theme="day"] body[data-map-style="light"] .tour-num-icon .tour-num { color: #FFF4D6; }
html[data-theme="day"] body[data-map-style="light"] .tour-num-icon .tour-num.is-now { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--text); }

html[data-theme="day"] .leaflet-control-attribution { background: rgba(255, 253, 249, .8) !important; }
