:root {
  color-scheme: light dark;
  --background: #f6f3eb;
  --card: #ece6d9;
  --text: #24251f;
  --muted: #626457;
  --accent01: #4f8191;
  --accent02: #79aba9;
  --accent03: #9d82a5;
  --accent04: #8fa775;
  --accent05: #d5ad58;
  --accent06: #c68160;
  --accent07: #b76069;
  --accent: var(--accent01);
  --today: rgb(79 129 145 / 16%);
  --ring-track: rgb(79 129 145 / 20%);
  --ring-fill: rgb(79 129 145 / 45%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #2e3440;
    --card: #3b4252;
    --text: #f5f3e8;
    --muted: #b8baaa;
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(16px, 5vw, 48px);
}

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 16px 18px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.copyright-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  background: currentColor;
  -webkit-mask: url("./sailfishmachine-mark.png") center / contain no-repeat;
  mask: url("./sailfishmachine-mark.png") center / contain no-repeat;
}

.week-card {
  width: min(100%, 1000px);
  min-width: 0;
  min-height: clamp(360px, 80dvh, 680px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 5vw, 64px);
  border-radius: 24px;
  background: var(--card);
}

.week-header { margin-bottom: clamp(26px, 5vw, 40px); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.week-number-wrap {
  position: relative;
  width: fit-content;
  font-size: clamp(76px, 14vw, 170px);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.week-number-highlight {
  position: absolute;
  inset: 0;
  color: var(--accent01);
  opacity: 0.7;
  pointer-events: none;
}

.week-range {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2.8vw, 23px);
  line-height: 1.5;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(2px, 0.8vw, 8px);
  margin: 0 0 clamp(32px, 5vw, 46px);
  padding: 0;
  list-style: none;
}

.day {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: clamp(66px, 8vw, 112px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10.5% / 10.5%;
}

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

.day-weekday {
  color: var(--muted);
  font-size: clamp(11px, 2.1vw, 15px);
  font-weight: 650;
  text-transform: uppercase;
}

.day-number {
  color: var(--text);
  font-size: clamp(17px, 3vw, 26px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.today .day-number { font-weight: 750; }

.day-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.day-ring path {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.day-ring .ring-track { stroke: var(--ring-track); }
.day-ring .ring-track { stroke-linecap: butt; }
.day-ring .ring-fill { stroke: var(--ring-fill); stroke-linecap: round; }

.year-label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.year-label, .year-percent {
  font-size: clamp(17px, 2.9vw, 23px);
  font-weight: 600;
}

.year-percent { font-variant-numeric: tabular-nums; }

.days-left {
  margin-left: auto;
  color: var(--muted);
  font-size: clamp(13px, 2.3vw, 16px);
  white-space: nowrap;
}

.year-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(79 129 145 / 18%);
}

.year-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent01), var(--accent02), var(--accent04));
  transition: width 350ms ease;
}

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

@media (max-width: 640px) {
  .week-card { min-height: clamp(360px, 55dvh, 560px); }
}
