:root {
  color-scheme: light dark;
  --bg: #fbfcfe;
  --fg: #0b0d10;
  --muted: #4b5563;
  --accent: #0057ff;
  --accent-2: #00b270;
  --line: #d8dde6;
  --panel: #f1f4f8;
  --focus: #111827;

  --font-sans: "Suisse Intl", "Neue Haas Grotesk", "Avenir Next", "Segoe UI Variable",
    "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --max-width: 1100px;
  --shadow: 0 10px 30px rgba(4, 8, 15, 0.08);
  --grid-on: rgba(11, 13, 16, 0.2);
  --grid-off: rgba(11, 13, 16, 0.08);
  --grid-weekend: rgba(11, 13, 16, 0.32);
  --grid-month: rgba(11, 13, 16, 0.8);
  --grid-select: rgba(0, 87, 255, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --fg: #e7eef7;
    --muted: #9aa6bd;
    --accent: #4da3ff;
    --accent-2: #21e27c;
    --line: #1d2734;
    --panel: #121923;
    --focus: #f9fafb;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --grid-on: rgba(231, 238, 247, 0.2);
    --grid-off: rgba(231, 238, 247, 0.08);
    --grid-weekend: rgba(231, 238, 247, 0.32);
    --grid-month: rgba(231, 238, 247, 0.8);
    --grid-select: rgba(77, 163, 255, 0.95);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--fg);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}

.page--planner {
  background:
    radial-gradient(1100px 600px at 90% -10%, rgba(0, 87, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(0, 178, 112, 0.12), transparent 55%),
    var(--bg);
}

.stack {
  display: grid;
  gap: var(--space-5);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.hero {
  display: grid;
  gap: var(--space-5);
  align-items: end;
}

.hero__kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--muted);
}

.hero__number {
  font-size: clamp(64px, 12vw, 180px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

.hero__meta {
  font-size: 1.1rem;
  color: var(--muted);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: var(--space-2);
}

.metric__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

.metric__value {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: var(--space-6) 0;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(10, 20, 40, 0.18);
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
}

.btn.is-copied {
  background: var(--accent-2);
  color: #04130b;
  border-color: transparent;
}

.input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
}

.input::placeholder {
  color: var(--muted);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

.mono {
  font-family: var(--font-mono);
}

.section {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.planner {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.planner__panel {
  display: grid;
  gap: var(--space-4);
}

.planner__grid {
  display: grid;
  align-items: start;
  justify-items: start;
  overflow-x: auto;
  background:
    linear-gradient(120deg, rgba(0, 87, 255, 0.08), transparent 60%),
    linear-gradient(0deg, rgba(11, 13, 16, 0.06), rgba(11, 13, 16, 0.06)),
    var(--panel);
}

.planner__details {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.year-grid {
  --cell-size: clamp(10px, 1.2vw, 16px);
  --gap-size: 2px;
  --label-size: 54px;
  display: grid;
  gap: var(--space-3);
  width: max-content;
  padding: var(--space-3);
  border-radius: var(--radius-m);
}

.year-grid__columns {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-6);
  align-items: flex-start;
}

.year-grid__column {
  display: grid;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.year-grid__header,
.year-grid__row,
.year-grid__tail {
  display: grid;
  grid-template-columns: var(--label-size) repeat(7, var(--cell-size));
  gap: var(--gap-size);
  align-items: center;
}

.year-grid__header {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted);
}

.year-grid__week-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.year-grid__day {
  text-align: center;
  font-family: var(--font-mono);
}

.year-grid__body {
  display: grid;
  gap: var(--gap-size);
}

.year-grid__week {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.year-grid__week--tail {
  text-transform: uppercase;
}

.year-grid__cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 3px;
  background: var(--grid-off);
  border: 1px solid transparent;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.year-grid__cell:hover {
  transform: translateY(-1px);
}

.year-grid__cell[data-in-year="1"] {
  background: var(--grid-on);
}

.year-grid__cell[data-weekend="1"] {
  background: var(--grid-weekend);
}

.year-grid__cell[data-in-year="0"] {
  background: transparent;
  border: 1px dashed var(--line);
  cursor: default;
}

.year-grid__cell[data-today="1"] {
  background: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(0, 178, 112, 0.3);
}

.year-grid__cell.is-selected {
  box-shadow: 0 0 0 2px var(--grid-select);
}

.year-grid__cell[data-month]::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--grid-month);
}

.year-grid__row[data-current-week="1"] .year-grid__cell {
  outline: 1px solid rgba(0, 87, 255, 0.25);
  outline-offset: -1px;
}

.year-grid__note {
  margin-top: var(--space-3);
  font-size: 0.95rem;
  color: var(--muted);
}

.legend {
  display: grid;
  gap: var(--space-2);
  font-size: 0.9rem;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--grid-on);
  border: 1px solid var(--line);
}

.legend__swatch--today {
  background: var(--accent-2);
  border-color: transparent;
}

.legend__swatch--weekend {
  background: var(--grid-weekend);
}

.legend__swatch--month {
  background: var(--grid-off);
  box-shadow: inset 0 0 0 2px var(--grid-month);
}

.legend__swatch--current {
  background: transparent;
  border: 1px solid var(--accent);
}

.print-only {
  display: none;
}

.toc {
  display: grid;
  gap: var(--space-2);
  font-size: 0.95rem;
}

article h2,
article h3,
article h4 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}

article p {
  margin: 0 0 var(--space-4);
}

pre {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-s);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.95rem;
}

code {
  font-family: var(--font-mono);
}

article ul,
article ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

blockquote {
  margin: var(--space-5) 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.svg-calendar {
  width: 100%;
  height: auto;
}

.svg-calendar .cell {
  fill: var(--accent);
  opacity: 0.18;
}

.svg-calendar .cell[data-in-year="0"] {
  fill: var(--line);
  opacity: 0.5;
}

.svg-calendar .cell[data-weekend="1"] {
  opacity: 0.35;
}

.svg-calendar .cell[data-today="1"] {
  fill: var(--accent-2);
  opacity: 1;
}

.svg-calendar text {
  fill: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .page {
    padding: var(--space-6) var(--space-4);
  }

  .hero__number {
    font-size: clamp(56px, 18vw, 140px);
  }

  .card {
    padding: var(--space-4);
  }

  .planner {
    grid-template-columns: 1fr;
  }

  .year-grid {
    --label-size: 40px;
  }

  .year-grid__columns {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.4in;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page {
    padding: 0;
  }

  .card,
  .btn,
  .progress {
    box-shadow: none;
  }

  .planner {
    grid-template-columns: 1fr;
  }

  .planner__grid {
    border: 0;
    background: transparent;
    padding: 0;
    overflow: visible;
  }

  .planner__details {
    display: none;
  }

  .year-grid {
    --cell-size: 8px;
    --gap-size: 1px;
    --label-size: 36px;
    padding: 0;
  }

  .year-grid__cell {
    background: transparent;
    border: 1px solid #000;
    box-shadow: none;
    cursor: default;
  }

  .year-grid__cell[data-in-year="0"] {
    border: 1px dashed #999;
  }

  .year-grid__cell[data-today="1"] {
    border: 2px solid #000;
  }

  .year-grid__cell.is-selected {
    box-shadow: none;
  }

  .year-grid__columns {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .print-only {
    display: block;
    margin-bottom: var(--space-3);
  }

  .print-hide {
    display: none !important;
  }
}
