:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --brand: #c05621;
  --card-radius: 14px;
  --gap: 20px;

  /* Elevated-neutral page ground + per-card tints, so cards read as
     distinct surfaces instead of blending into a flat white page. */
  --page-bg: #f6f1ea;
  --news-tint: #fdf6f0;
  --news-border: #f0e1d0;
  --github-tint: #f6f9fc;
  --github-border: #d8e2ec;
  --agenda-tint: #f8f5f0;
  --agenda-border: #ece3d7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

/* ---- Header ---- */
.brand {
  color: var(--brand);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 28px;
  letter-spacing: 0.2px;
}

h1.name {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 28px;
  letter-spacing: -0.5px;
}

.hero {
  position: relative;
  height: 300px;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #0a1a33;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 36px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  --hero-c1: #c05621;
  --hero-c2: #0a1a33;
  --hero-c3: #e2905a;
  background:
    radial-gradient(120% 140% at 12% 15%, var(--hero-c1) 0%, transparent 60%),
    radial-gradient(120% 140% at 88% 10%, var(--hero-c2) 0%, transparent 55%),
    radial-gradient(150% 150% at 60% 105%, var(--hero-c3) 0%, transparent 60%),
    #0a1a33;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 50% 100%, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.12) 45%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0) 30%);
  z-index: 1;
}

.hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hero-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hero-menu {
  width: 22px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-menu span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.hero-caption {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
}

.card {
  border-radius: var(--card-radius);
  height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(120, 84, 48, 0.07), 0 1px 2px rgba(120, 84, 48, 0.06);
}

/* Card 1 — daily news headlines */
.card-news {
  background: linear-gradient(90deg, var(--brand), #e2905a) top / 100% 4px no-repeat, var(--news-tint);
  border: 1px solid var(--news-border);
  flex-direction: column;
  padding: 18px 20px;
}
.news-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.news-eyebrow { font-size: 11px; color: var(--muted); margin: 0 0 2px; }
.news-title { font-size: 15px; font-weight: 700; margin: 0; }
.news-toggler {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.news-nav-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.news-nav-btn:hover { border-color: var(--brand); color: var(--brand); }
.news-nav-btn:disabled { opacity: 0.35; cursor: default; border-color: #ddd; color: var(--ink); }
.news-counter { font-size: 10.5px; color: var(--muted); min-width: 28px; text-align: center; }
.news-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.news-item { flex-shrink: 0; }
.news-headline {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 6px;
}
.news-summary {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.news-loading, .news-error {
  font-size: 12px;
  color: var(--muted);
}

/* Card 2 — GitHub repository activity */
.card-github {
  background: linear-gradient(90deg, #0969da, #54aeff) top / 100% 4px no-repeat, var(--github-tint);
  border: 1px solid var(--github-border);
  padding: 18px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}
.github-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.github-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.github-mark {
  width: 20px;
  height: 20px;
  color: #1f2328;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  flex-shrink: 0;
}
.github-eyebrow { font-size: 11px; color: #656d76; margin: 0 0 2px; }
.github-title { font-size: 15px; font-weight: 600; margin: 0; color: #1f2328; }
.github-toggler {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.github-nav-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #d1d9e0;
  background: #f6f8fa;
  color: #1f2328;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.github-nav-btn:hover { border-color: #0969da; color: #0969da; }
.github-nav-btn:disabled { opacity: 0.35; cursor: default; border-color: #d1d9e0; color: #1f2328; }
.github-counter { font-size: 10.5px; color: #656d76; min-width: 28px; text-align: center; }

.github-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.github-item { flex-shrink: 0; }

.repo-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.repo-icon {
  width: 14px;
  height: 14px;
  color: #656d76;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  flex-shrink: 0;
}
.repo-name {
  font-size: 14px;
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}
.repo-name:hover { text-decoration: underline; }
.repo-visibility {
  font-size: 10px;
  font-weight: 500;
  color: #656d76;
  border: 1px solid #d1d9e0;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 16px;
}
.repo-desc {
  font-size: 12px;
  color: #656d76;
  line-height: 1.5;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.repo-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #656d76;
}
.lang-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.repo-meta svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  flex-shrink: 0;
}
.icon-commit circle, .icon-issue circle:last-child {
  fill: currentColor;
  stroke: none;
}
.repo-commit {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: #1f2328;
  background: #f6f8fa;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  padding: 6px 8px;
}
.repo-commit svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  color: #656d76;
  flex-shrink: 0;
  margin-top: 1px;
}
.commit-msg {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.github-loading, .github-error { font-size: 12px; color: #656d76; }

/* Card 3 — Todoist tasks + Fastmail calendar */
.card-agenda {
  --agenda-accent: #d1453b;
  --agenda-accent-2: #f0a08c;
  background: linear-gradient(90deg, var(--agenda-accent), var(--agenda-accent-2)) top / 100% 4px no-repeat, var(--agenda-tint);
  border: 1px solid var(--agenda-border);
  padding: 18px 20px;
  transition: background-color 0.25s ease;
}
.agenda-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agenda-eyebrow { font-size: 11px; color: var(--muted); margin: 0 0 2px; }
.agenda-title { font-size: 15px; font-weight: 700; margin: 0; }
.agenda-toggler {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.agenda-nav-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.agenda-nav-btn:hover { border-color: var(--agenda-accent); color: var(--agenda-accent); }
.agenda-nav-btn:disabled { opacity: 0.35; cursor: default; border-color: #ddd; color: var(--ink); }
.agenda-counter { font-size: 10.5px; color: var(--muted); min-width: 28px; text-align: center; }

.agenda-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.agenda-loading, .agenda-error { font-size: 12px; color: var(--muted); }

/* -- Todoist panel -- */
.todoist-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.todoist-stat {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fbe1dd;
  color: #b8342b;
}
.todoist-stat.is-muted { background: #ece5da; color: var(--muted); }
.todoist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.todoist-task {
  display: flex;
  align-items: center;
  gap: 9px;
}
.todoist-checkbox {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
}
.todoist-content {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todoist-project {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}
.todoist-due {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.todoist-due.is-overdue { color: #d1453b; }
.todoist-due.is-today { color: #b8342b; }
.todoist-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--agenda-border);
  text-align: right;
  flex-shrink: 0;
}
.todoist-footer a {
  font-size: 11px;
  font-weight: 600;
  color: #d1453b;
  text-decoration: none;
}
.todoist-footer a:hover { text-decoration: underline; }

/* -- Calendar panel -- */
.cal-next {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #edf0fb;
  border: 1px solid #d9e0f5;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.cal-next-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #3a4d8f;
  background: #dfe4f7;
  border-radius: 5px;
  padding: 3px 6px;
  flex-shrink: 0;
}
.cal-next-info { min-width: 0; }
.cal-next-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-next-when { font-size: 10.5px; color: var(--muted); }
.cal-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cal-day-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #3a4d8f;
  margin: 8px 0 4px;
}
.cal-day-label:first-child { margin-top: 0; }
.cal-event {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}
.cal-event-time {
  font-size: 10.5px;
  color: var(--muted);
  width: 62px;
  flex-shrink: 0;
}
.cal-event-title {
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event-location {
  font-size: 10.5px;
  color: var(--muted);
}
.cal-event-location::before { content: '· '; }

/* Card 4 — split dark style */
.card-split {
  flex-direction: row;
  background: #16181d;
}
.split-half {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.split-half + .split-half {
  border-left: 1px solid rgba(255,255,255,0.08);
}
.split-half.light {
  background: #1c1f26;
  color: #e6e6e6;
}
.split-half.accent {
  background: #f4a259;
  color: #22150a;
}
.split-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.split-half.accent .split-icon {
  background: rgba(0,0,0,0.15);
}
.split-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.split-text { font-size: 12px; line-height: 1.5; opacity: 0.85; margin: 0; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .card { height: auto; min-height: 220px; }
}
