/* ==========================================================================
   Ramiz Abbas Bangash — Calendar
   Calm, current, honest. Dark hero + clean light body.
   ========================================================================== */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --ink: #0b0f1a;
  --ink-2: #46506b;
  --ink-3: #7c88a4;
  --line: rgba(11, 15, 26, 0.09);
  --line-2: rgba(11, 15, 26, 0.18);
  --accent: #2f6df6;
  --accent-soft: rgba(47, 109, 246, 0.1);

  --hero: #0b0e14;
  --hero-ink: #f5f7fc;
  --hero-muted: #9aa6bd;
  --hero-line: rgba(255, 255, 255, 0.1);

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1040px;
  --pad: clamp(20px, 4.5vw, 44px);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --surface: #121829;
  --surface-2: #161e33;
  --ink: #eef2fb;
  --ink-2: #a9b5cc;
  --ink-3: #6f7c97;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.17);
  --accent: #5f8bf8;
  --accent-soft: rgba(95, 139, 248, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, dl, dt, dd { margin: 0; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

.wrap { width: min(var(--wrap), calc(100% - var(--pad) * 2)); margin-inline: auto; }

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Theme Visibility */
[data-theme="light"] .label-dark { display: none; }
[data-theme="dark"] .label-light { display: none; }

/* ==========================================================================
   Masthead
   ========================================================================== */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--hero) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--hero-ink);
}
.masthead-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-domain { color: var(--hero-muted); }
.nav-links { display: flex; gap: 26px; font-size: 14px; color: rgba(245, 247, 252, 0.72); }
.nav-links a:hover, .nav-links a.is-active { color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 16px; font-size: 13.5px; }
.theme-btn { color: rgba(245, 247, 252, 0.7); }
.theme-btn:hover { color: #fff; }
.mobile-btn { display: none; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 6px; padding: 4px 10px; }

.mobile-menu {
  position: fixed;
  inset: 58px 0 0 0;
  z-index: 95;
  background: var(--hero);
  color: var(--hero-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu-inner { height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 32px 0 40px; }
.mobile-nav { display: flex; flex-direction: column; }
.mobile-nav a { padding: 16px 0; border-bottom: 1px solid var(--hero-line); font-family: var(--serif); font-size: 27px; }
.mobile-foot { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--hero-muted); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: var(--hero);
  color: var(--hero-ink);
  padding-top: 120px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 62% at 16% 18%, rgba(47, 109, 246, 0.22) 0%, transparent 66%),
    radial-gradient(38% 48% at 92% 78%, rgba(120, 160, 240, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 0 56px;
}
.eyebrow { color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 5.4vw, 62px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: #fff;
  margin-bottom: 14px;
}
.hero-title em { font-style: italic; color: #8fb2ff; }
.hero-sub { font-size: 15px; color: var(--hero-muted); max-width: 46ch; }

.hero-today {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 2px 16px;
  padding: 20px 24px;
  border: 1px solid var(--hero-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  align-items: end;
}
.today-dow { grid-column: 1 / -1; color: var(--hero-muted); }
.today-num {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 0.9;
  color: #fff;
  letter-spacing: -0.03em;
}
.today-mon { font-size: 14px; color: var(--hero-muted); padding-bottom: 6px; }

/* ==========================================================================
   Body
   ========================================================================== */
.body-col { padding: 56px 0 80px; }
.sec { padding-bottom: 56px; scroll-margin-top: 80px; }
.sec-last { padding-bottom: 0; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.sec-kicker { color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Calendar nav */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cal-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* ==========================================================================
   Month grid
   ========================================================================== */
.cal-head, .cal-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-head { margin-bottom: 8px; }
.cal-head span {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 0;
}
.cal-cell {
  min-height: 74px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease;
}
.cal-cell:hover { border-color: var(--line-2); }
.cal-cell.other { opacity: 0.42; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cal-cell.today .cal-day { color: var(--accent); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.cal-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-dot.warn { background: #e2a33c; }
.cal-dot.muted { background: var(--ink-3); opacity: 0.55; }
.cal-count { font-size: 10px; color: var(--ink-3); }

/* ==========================================================================
   Upcoming & This week lists
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 22px;
}
.ev {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.ev:first-child { border-top: none; }
.ev-date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ev-date b { display: block; font-weight: 600; color: var(--ink-2); }
.ev-title { font-size: 14.5px; font-weight: 600; }
.ev-title small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.ev-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.ev-tag.warn { color: #a5721f; background: rgba(226, 163, 60, 0.14); }
.ev-tag.muted { color: var(--ink-3); background: var(--surface-2); }

.empty { padding: 26px 0; color: var(--ink-3); font-size: 14px; text-align: center; }
.week-list { display: flex; flex-direction: column; gap: 8px; }

.foot {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.foot a:hover { color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 800px) {
  .hero-grid { flex-direction: column; align-items: flex-start; gap: 24px; }
  .hero-today { display: flex; align-items: baseline; gap: 10px; }
  .today-num { font-size: 40px; }
  .today-dow { margin-right: 8px; }
  .cal-cell { min-height: 60px; }
  .ev { grid-template-columns: 1fr auto; }
  .ev-date { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .nav-links { display: none; }
  .mobile-btn { display: inline-block; }
  .cal-cell { min-height: 52px; padding: 5px; }
  .cal-dot { width: 5px; height: 5px; }
  .cal-head span { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}