/* ============================================================
   Hytten · Almanakk
   Outdoorsy almanac aesthetic. Warm paper, ink, topo lines.
   ============================================================ */

:root {
  /* Light / "dag" palette — warm paper */
  --paper:        oklch(96% 0.012 80);
  --paper-2:      oklch(93% 0.014 78);
  --paper-3:      oklch(89% 0.018 76);
  --ink:          oklch(22% 0.02 60);
  --ink-2:        oklch(36% 0.022 60);
  --ink-3:        oklch(52% 0.022 60);
  --ink-faint:    oklch(70% 0.02 60);
  --rule:         oklch(78% 0.018 70);
  --rule-strong:  oklch(60% 0.025 65);

  /* Accents — share chroma & lightness, vary hue */
  --moss:         oklch(48% 0.08 145);  /* greens — nature, occupied */
  --moss-soft:    oklch(86% 0.04 145);
  --ember:        oklch(55% 0.13 50);   /* warm orange — planned, sunset */
  --ember-soft:   oklch(89% 0.05 60);
  --slate:        oklch(48% 0.04 240);  /* cool blue — weather, water */
  --slate-soft:   oklch(88% 0.025 240);
  --rust:         oklch(50% 0.12 30);   /* deep red — alerts */

  /* Dimensions */
  --rad-sm: 4px;
  --rad: 8px;
  --rad-lg: 14px;
  --rule-w: 1px;

  /* Type */
  --font-display: 'Fraunces', 'Cambria', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="night"] {
  --paper:        oklch(18% 0.012 60);
  --paper-2:      oklch(22% 0.014 60);
  --paper-3:      oklch(26% 0.018 58);
  --ink:          oklch(94% 0.012 80);
  --ink-2:        oklch(80% 0.018 70);
  --ink-3:        oklch(64% 0.02 65);
  --ink-faint:    oklch(46% 0.02 60);
  --rule:         oklch(34% 0.018 60);
  --rule-strong:  oklch(50% 0.025 60);

  --moss:         oklch(72% 0.10 145);
  --moss-soft:    oklch(30% 0.04 145);
  --ember:        oklch(72% 0.13 55);
  --ember-soft:   oklch(32% 0.06 55);
  --slate:        oklch(72% 0.07 240);
  --slate-soft:   oklch(30% 0.04 240);
  --rust:         oklch(70% 0.13 30);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* ======== Topographic background — subtle, behind everything ======== */
.topo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'><g fill='none' stroke='%23a07a55' stroke-width='0.6' opacity='0.32'><path d='M-50 220 C 100 180, 220 260, 360 230 S 600 180, 850 240'/><path d='M-50 280 C 120 240, 240 320, 380 290 S 620 240, 850 300'/><path d='M-50 340 C 100 300, 230 380, 360 350 S 600 300, 850 360'/><path d='M-50 420 C 120 380, 250 460, 390 430 S 620 380, 850 440'/><path d='M-50 500 C 100 460, 220 540, 360 510 S 600 460, 850 520'/><path d='M-50 580 C 120 540, 260 620, 400 590 S 630 540, 850 600'/><path d='M-50 660 C 100 620, 240 700, 370 670 S 610 620, 850 680'/><path d='M-50 100 C 110 60, 240 140, 380 110 S 620 60, 850 120'/><path d='M-50 40 C 100 0, 220 80, 360 50 S 600 0, 850 60'/></g></svg>");
  background-size: 1100px 1100px;
  background-position: center;
}

[data-theme="night"] .topo-bg {
  opacity: 0.35;
  filter: invert(1) hue-rotate(180deg) brightness(1.4);
}

body[data-show-topo="false"] .topo-bg { display: none; }

/* ======== App shell ======== */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ======== Masthead ======== */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1.5rem;
  padding: 22px 32px 14px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}

.masthead::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: -6px;
  height: 1px;
  background: var(--ink);
}

.masthead-left,
.masthead-right {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: end;
  gap: 1.4rem;
}

.masthead-left { justify-content: flex-start; }
.masthead-right { justify-content: flex-end; text-align: right; }

.masthead-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.masthead-meta dt {
  font-size: 0.62rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin: 0;
}

.masthead-meta dd {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.masthead-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.masthead-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 2px;
}

.masthead-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}

.masthead-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ======== Grid ======== */
.almanakk-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(0, 1.4fr) minmax(320px, 1fr);
  grid-template-rows: auto auto;
  gap: 0;
  padding: 0;
}

.col {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.col-left { border-right: 1px solid var(--rule); }
.col-mid { border-right: 1px solid var(--rule); }

/* ======== Section headings ======== */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
}

.sec-head .sec-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.sec-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ======== Calendar ======== */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cal-toolbar h3 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.55rem;
  font-variation-settings: "opsz" 36;
  text-transform: lowercase;
  color: var(--ink);
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: all 0.15s;
}

.cal-nav-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  position: relative;
}

.cal-weekday {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  padding: 6px 0 4px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 0.95;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink-2);
  cursor: default;
  background: transparent;
  transition: background 0.15s;
  overflow: hidden;
}

.cal-day:hover {
  background: var(--paper-2);
}

.cal-day.other-month {
  color: var(--ink-faint);
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 6px,
    var(--paper-2) 6px,
    var(--paper-2) 7px
  );
}

.cal-day.today {
  background: var(--paper-3);
}

.cal-day.today .cal-day-num {
  color: var(--ember);
  font-weight: 600;
}

.cal-day.today .cal-day-num::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ember);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cal-day-num {
  position: relative;
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1;
  color: var(--ink);
  display: inline-block;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
}

.cal-day.future:not(.planned) .cal-day-num {
  color: var(--ink-faint);
}

.cal-day-meta {
  margin-top: auto;
  font-size: 0.66rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.cal-day.occupied {
  background: var(--moss-soft);
}

.cal-day.occupied .cal-day-num {
  color: var(--moss);
}

/* Score dot */
.cal-score-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--moss);
  display: inline-block;
}

.cal-score-dot.low { background: var(--ink-faint); }
.cal-score-dot.med { background: var(--ember); }

/* ======== Planned ribbons ======== */
/* A ribbon spans multiple days, drawn as an absolutely-positioned overlay
   relative to the calendar grid. */
.cal-grid {
  position: relative;
}

.cal-ribbons-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cal-ribbon {
  position: absolute;
  background: var(--ember);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  border-radius: 2px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  pointer-events: auto;
  cursor: default;
}

.cal-ribbon::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--paper);
  border-radius: 50%;
  margin-right: 6px;
  opacity: 0.85;
}

/* ======== Calendar legend ======== */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 4px;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}

.cal-legend-swatch.occupied { background: var(--moss-soft); border-color: var(--moss); }
.cal-legend-swatch.planned { background: var(--ember); border-color: var(--ember); }

/* ======== Counter card ======== */
.counter {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule-strong);
  border-radius: var(--rad);
  background: var(--paper-2);
  overflow: hidden;
}

.counter-cell {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.counter-cell + .counter-cell {
  border-left: 1px solid var(--rule);
}

.counter-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.counter-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}

.counter-unit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  margin-top: 2px;
}

.counter-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-2);
  margin-top: 4px;
}

/* ======== Video ======== */
.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border-radius: var(--rad);
  overflow: hidden;
  border: 1px solid var(--rule-strong);
}

.video-wrap .video-js {
  width: 100% !important;
  height: 100% !important;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: oklch(80% 0.02 80);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: repeating-linear-gradient(
    45deg,
    #0e0e0e 0,
    #0e0e0e 8px,
    #131313 8px,
    #131313 16px
  );
  pointer-events: none;
}

.video-corner {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.video-corner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(60% 0.2 25);
  box-shadow: 0 0 8px oklch(60% 0.2 25);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.video-corner-tr {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.75);
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ======== Weather ======== */
.wx-now {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 4px 18px;
  border-bottom: 1px solid var(--rule);
}

.wx-symbol {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
}

.wx-symbol svg {
  width: 100%;
  height: 100%;
}

.wx-now-temp {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.wx-now-temp .deg {
  font-size: 2rem;
  font-style: normal;
  margin-top: 6px;
  color: var(--ink-3);
}

.wx-now-desc {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-2);
  margin-top: 2px;
  font-variation-settings: "opsz" 14;
  text-wrap: pretty;
  max-width: 22ch;
}

.wx-now-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  text-align: right;
}

.wx-now-meta strong {
  color: var(--ink);
  font-weight: 500;
}

.wx-summary {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  font-variation-settings: "opsz" 14;
  color: var(--ink-2);
  line-height: 1.55;
  text-wrap: pretty;
  border-left: 2px solid var(--ember);
  padding: 4px 0 4px 14px;
  margin-top: 4px;
}

/* Forecast strip */
.wx-forecast {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  overflow: hidden;
  margin-top: 8px;
}

.wx-fc-day {
  padding: 12px 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  border-right: 1px solid var(--rule);
  background: var(--paper-2);
  position: relative;
}

.wx-fc-day:last-child { border-right: 0; }

.wx-fc-day.is-today {
  background: var(--paper-3);
}

.wx-fc-dow {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--ink-2);
}

.wx-fc-date {
  font-size: 0.62rem;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.wx-fc-symbol {
  width: 36px;
  height: 36px;
  color: var(--slate);
  margin: 2px 0;
}

.wx-fc-temps {
  display: flex;
  gap: 6px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.wx-fc-hi { color: var(--ink); font-weight: 500; }
.wx-fc-lo { color: var(--ink-3); }

.wx-fc-precip {
  font-size: 0.62rem;
  color: var(--slate);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  min-height: 0.9em;
}

/* ======== Sun & moon ======== */
.sun-card {
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 14px 4px 4px;
}

.sun-arc {
  flex: 1;
  position: relative;
  height: 84px;
}

.sun-arc svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sun-times {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  min-width: 88px;
}

.sun-times-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sun-times-row strong {
  color: var(--ink);
  font-weight: 500;
}

.daylight-bar {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed var(--rule);
  padding-top: 8px;
}

/* ======== Climate (indoor) ======== */
.climate-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.climate-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.climate-row-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
  font-variation-settings: "opsz" 14;
}

.climate-row-temp {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.climate-row-hum {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}

.climate-row.cold .climate-row-temp { color: var(--slate); }
.climate-row.warm .climate-row-temp { color: var(--ember); }

.climate-outdoor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  border-bottom: 2px solid var(--ink);
  margin-bottom: 8px;
}

.climate-outdoor-temp {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
  letter-spacing: -0.01em;
}

/* ======== Footer / colophon ======== */
.colophon {
  border-top: 2px solid var(--ink);
  padding: 14px 32px 18px;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  position: relative;
  margin-top: 4px;
}

.colophon::before {
  content: "";
  position: absolute;
  left: 32px;
  right: 32px;
  top: -6px;
  height: 1px;
  background: var(--ink);
}

.colophon-fresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moss);
}

.fresh-dot.stale { background: var(--ember); }
.fresh-dot.very-stale { background: var(--rust); }

/* ======== Subtle ornaments ======== */
.ornament {
  font-family: var(--font-display);
  color: var(--ink-faint);
  text-align: center;
  font-size: 1.1rem;
  padding: 4px 0;
  letter-spacing: 0.4em;
}

/* ======== Score tooltip ======== */
.score-tip {
  position: fixed;
  z-index: 100;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--rad);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  min-width: 200px;
  max-width: 260px;
}

.score-tip-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.score-tip-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ember);
  margin-bottom: 6px;
}

.score-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.score-tip-row span:first-child {
  flex: 1;
  color: var(--ink-3);
}

.score-tip-bar {
  width: 60px;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.score-tip-bar > div {
  height: 100%;
  background: var(--moss);
  transition: width 0.1s;
}

.score-tip-val {
  width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.score-tip hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 6px 0;
}

.score-tip-total {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

/* ======== Felt direction — minimal ========
   Quiet neutrals, single sans, almost no rules, no ornament. */
body[data-direction="felt"] {
  --paper:        oklch(98.5% 0.003 240);
  --paper-2:      oklch(96.5% 0.004 240);
  --paper-3:      oklch(94% 0.005 240);
  --ink:          oklch(22% 0.008 240);
  --ink-2:        oklch(42% 0.008 240);
  --ink-3:        oklch(60% 0.008 240);
  --ink-faint:    oklch(78% 0.006 240);
  --rule:         oklch(90% 0.005 240);
  --rule-strong:  oklch(80% 0.006 240);
  --moss:         oklch(55% 0.06 160);
  --moss-soft:    oklch(94% 0.022 160);
  --ember:        oklch(58% 0.09 50);
  --ember-soft:   oklch(94% 0.03 55);
  --slate:        oklch(50% 0.04 240);
  --slate-soft:   oklch(93% 0.012 240);
}

body[data-direction="felt"][data-theme="night"] {
  --paper:        oklch(16% 0.005 240);
  --paper-2:      oklch(19% 0.006 240);
  --paper-3:      oklch(22% 0.008 240);
  --ink:          oklch(96% 0.003 240);
  --ink-2:        oklch(78% 0.006 240);
  --ink-3:        oklch(58% 0.008 240);
  --ink-faint:    oklch(40% 0.008 240);
  --rule:         oklch(26% 0.006 240);
  --rule-strong:  oklch(38% 0.008 240);
  --moss:         oklch(74% 0.07 160);
  --ember:        oklch(74% 0.10 55);
}

/* No backdrop pattern, period. */
body[data-direction="felt"] .topo-bg { display: none; }

/* Masthead — thin line, normal weight, no italic, no colored eyebrow */
body[data-direction="felt"] .masthead {
  border-bottom: 1px solid var(--rule);
  padding: 26px 40px 18px;
  grid-template-columns: 1fr auto;
  align-items: center;
}
body[data-direction="felt"] .masthead::after { display: none; }
body[data-direction="felt"] .masthead-left { display: none; }
body[data-direction="felt"] .masthead-title { align-items: flex-start; text-align: left; }
body[data-direction="felt"] .masthead-eyebrow { display: none; }
body[data-direction="felt"] .masthead-sub { display: none; }
body[data-direction="felt"] .masthead-name {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}
body[data-direction="felt"] .masthead-right .masthead-meta dt { display: none; }
body[data-direction="felt"] .masthead-right .masthead-meta dd {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-3);
  letter-spacing: 0;
  text-transform: none;
}
body[data-direction="felt"] .masthead-right { font-size: 0.85rem; letter-spacing: 0; text-transform: none; }

/* Section heads — small, quiet, lowercase tracking gone */
body[data-direction="felt"] .sec-head {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 10px;
}
body[data-direction="felt"] .sec-head h2 {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink-3);
}
body[data-direction="felt"] .sec-num { display: none; }

/* Calendar toolbar — quieter */
body[data-direction="felt"] .cal-toolbar h3 {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--ink);
}
body[data-direction="felt"] .cal-nav-btn {
  border-color: var(--rule);
  color: var(--ink-3);
  width: 28px;
  height: 28px;
}
body[data-direction="felt"] .cal-nav-btn:hover:not(:disabled) {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--rule-strong);
}

/* Calendar grid — borderless, breathing */
body[data-direction="felt"] .cal-grid {
  border: 0;
  gap: 2px;
}
body[data-direction="felt"] .cal-weekday {
  border: 0;
  padding: 4px 0 8px;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-faint);
  text-transform: none;
}
body[data-direction="felt"] .cal-day {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 6px 8px;
  aspect-ratio: 1;
}
body[data-direction="felt"] .cal-day.other-month {
  background: transparent;
  opacity: 0.35;
}
body[data-direction="felt"] .cal-day.today { background: var(--paper-3); }
body[data-direction="felt"] .cal-day.today .cal-day-num::after { display: none; }
body[data-direction="felt"] .cal-day.today .cal-day-num {
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  font-weight: 500;
}
body[data-direction="felt"] .cal-day.occupied { background: var(--moss-soft); }
body[data-direction="felt"] .cal-day.occupied .cal-day-num { color: var(--moss); }
body[data-direction="felt"] .cal-day-num {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.84rem;
}
body[data-direction="felt"] .cal-day-meta {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--ink-faint);
}

/* Ribbons — flatter, quieter */
body[data-direction="felt"] .cal-ribbon {
  background: var(--ember);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0;
  border-radius: 4px !important;
  box-shadow: none;
}
body[data-direction="felt"] .cal-ribbon::before { display: none; }

/* Legend — tiny, neutral */
body[data-direction="felt"] .cal-legend {
  font-family: var(--font-body);
  text-transform: none;
  font-size: 0.72rem;
  letter-spacing: 0;
  color: var(--ink-3);
  gap: 12px 18px;
}
body[data-direction="felt"] .cal-legend-swatch { border-radius: 4px; }

/* Counter — borderless cards */
body[data-direction="felt"] .counter {
  border: 0;
  background: transparent;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding-top: 14px;
}
body[data-direction="felt"] .counter-cell { padding: 4px 18px 4px 0; }
body[data-direction="felt"] .counter-cell + .counter-cell {
  border-left: 1px solid var(--rule);
  padding-left: 18px;
}
body[data-direction="felt"] .counter-label {
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  color: var(--ink-3);
}
body[data-direction="felt"] .counter-value {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}
body[data-direction="felt"] .counter-unit,
body[data-direction="felt"] .counter-sub {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* Video — softer corners, no border, no overlay flair */
body[data-direction="felt"] .video-wrap {
  border: 0;
  border-radius: 8px;
}
body[data-direction="felt"] .video-corner {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
}
body[data-direction="felt"] .video-corner-dot { animation: none; box-shadow: none; }

/* Weather — single sans, no italic, no left rule */
body[data-direction="felt"] .wx-now {
  border-bottom: 1px solid var(--rule);
  padding: 8px 0 18px;
  gap: 14px;
}
body[data-direction="felt"] .wx-now-temp {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 300;
  font-size: 3.4rem;
  letter-spacing: -0.03em;
}
body[data-direction="felt"] .wx-now-temp .deg { font-style: normal; font-weight: 300; }
body[data-direction="felt"] .wx-now-desc {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-3);
}
body[data-direction="felt"] .wx-now-meta {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--ink-3);
}
body[data-direction="felt"] .wx-now-meta strong { font-weight: 500; }
body[data-direction="felt"] .wx-summary {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.86rem;
  color: var(--ink-2);
  border-left: 0;
  padding: 10px 0 0;
  line-height: 1.55;
}
body[data-direction="felt"] .wx-symbol { color: var(--ink-2); }

/* Forecast strip — minimal cards */
body[data-direction="felt"] .wx-forecast {
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  margin-top: 14px;
}
body[data-direction="felt"] .wx-fc-day {
  background: transparent;
  border-right: 0;
  padding: 12px 4px;
}
body[data-direction="felt"] .wx-fc-day.is-today { background: var(--paper-2); border-radius: 8px; }
body[data-direction="felt"] .wx-fc-dow {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-2);
}
body[data-direction="felt"] .wx-fc-date {
  font-family: var(--font-body);
  font-size: 0.66rem;
  color: var(--ink-faint);
}
body[data-direction="felt"] .wx-fc-temps { font-family: var(--font-body); font-size: 0.78rem; }
body[data-direction="felt"] .wx-fc-precip { font-family: var(--font-body); font-size: 0.66rem; }
body[data-direction="felt"] .wx-fc-symbol { color: var(--ink-2); }

/* Climate — almost just a list */
body[data-direction="felt"] .climate-outdoor {
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
  color: var(--ink-3);
  padding: 4px 0 14px;
}
body[data-direction="felt"] .climate-outdoor-temp {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
body[data-direction="felt"] .climate-list { border-top: 0; }
body[data-direction="felt"] .climate-row {
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
}
body[data-direction="felt"] .climate-row-label {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--ink);
}
body[data-direction="felt"] .climate-row-temp {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
}
body[data-direction="felt"] .climate-row-hum {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

/* Sun arc — flatter */
body[data-direction="felt"] .sun-times {
  font-family: var(--font-body);
  font-size: 0.78rem;
}
body[data-direction="felt"] .sun-times strong { font-weight: 500; }

/* No ornament glyphs in Felt */
body[data-direction="felt"] .ornament { display: none; }

/* Colophon — ultra-quiet */
body[data-direction="felt"] .colophon {
  border-top: 1px solid var(--rule);
  padding: 14px 40px 18px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}
body[data-direction="felt"] .colophon::before { display: none; }

/* Column gutters — slightly tighter rules */
body[data-direction="felt"] .col-left,
body[data-direction="felt"] .col-mid {
  border-right-color: var(--rule);
}
body[data-direction="felt"] .col { padding: 26px 32px; gap: 26px; }

/* ======== Responsive (graceful, but desktop-first) ======== */
@media (max-width: 1180px) {
  .almanakk-grid {
    grid-template-columns: 1fr 1fr;
  }
  .col-left { border-right: 1px solid var(--rule); }
  .col-mid {
    border-right: 0;
    grid-column: 1 / -1;
    border-top: 1px solid var(--rule);
  }
  .col-right {
    grid-column: 1 / -1;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 760px) {
  .masthead {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .masthead-left, .masthead-right {
    justify-content: center;
    flex-wrap: wrap;
  }
  .almanakk-grid {
    grid-template-columns: 1fr;
  }
  .col {
    border-right: 0 !important;
    border-bottom: 1px solid var(--rule);
  }
  .colophon {
    flex-direction: column;
    gap: 6px;
  }
}
