/* ============================================================
   Design tokens — from DESIGN-cal.md (Cal.com design analysis)
   ============================================================ */
:root {
  /* colors */
  --primary: #111111;
  --primary-active: #242424;
  --primary-disabled: #e5e7eb;
  --ink: #111111;
  --body: #374151;
  --muted: #6b7280;
  --muted-soft: #898989;
  --hairline: #e5e7eb;
  --hairline-soft: #f3f4f6;
  --canvas: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-card: #f5f5f5;
  --surface-strong: #e5e7eb;
  --surface-dark: #101010;
  --surface-dark-elevated: #1a1a1a;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #a1a1aa;
  --brand-accent: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --badge-orange: #fb923c;
  --badge-pink: #ec4899;
  --badge-violet: #8b5cf6;
  --badge-emerald: #34d399;

  /* type */
  --font-display: "Cal Sans", "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;
  --r-full: 9999px;

  /* spacing */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;
  --s-section: 96px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Typography scale
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.display-xl { font-size: 64px; line-height: 1.05; letter-spacing: -2px; }
.display-lg { font-size: 48px; line-height: 1.1;  letter-spacing: -1.5px; }
.display-md { font-size: 36px; line-height: 1.15; letter-spacing: -1px; }
.display-sm { font-size: 28px; line-height: 1.2;  letter-spacing: -0.5px; }

.title-lg { font-family: var(--font-body); font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.3px; color: var(--ink); margin: 0; }
.title-md { font-family: var(--font-body); font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink); margin: 0; }
.title-sm { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); margin: 0; }

.body-md { font-size: 16px; line-height: 1.5; color: var(--body); }
.body-sm { font-size: 14px; line-height: 1.5; color: var(--body); }
.caption { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--muted-soft); }
code, .code { font-family: var(--font-mono); font-size: 14px; }

.lead { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.muted { color: var(--muted); }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-lg);
}

.section { padding-block: var(--s-section); }
.section--soft { background: var(--surface-soft); }

.section-head { max-width: 720px; margin-bottom: var(--s-xl); }
.section-head p { margin: var(--s-sm) 0 0; font-size: 16px; color: var(--muted); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-sm);
}

.grid { display: grid; gap: var(--s-lg); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.divider { height: 1px; background: var(--hairline-soft); border: 0; margin: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  height: 40px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:active { background: var(--primary-active); }

.btn--secondary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--hairline);
}
.btn--secondary:active { background: var(--surface-soft); }

.btn--link {
  background: transparent;
  color: var(--ink);
  padding: 0;
  height: auto;
  border: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-sm); margin-top: var(--s-lg); }

/* ============================================================
   Top navigation
   ============================================================ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline-soft);
}
.top-nav__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-lg);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-lg);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.wordmark__dot {
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--primary);
  display: inline-block;
}

.nav-menu {
  display: flex;
  gap: var(--s-lg);
  margin-left: var(--s-lg);
}
.nav-menu a {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--body);
}
.nav-menu a:hover { color: var(--ink); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-sm); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
}

/* ============================================================
   Nav pill group (signature component)
   ============================================================ */
.nav-pill-group {
  display: inline-flex;
  gap: var(--s-xxs);
  padding: 6px;
  background: var(--surface-soft);
  border-radius: var(--r-pill);
}
.category-tab {
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}
.category-tab.is-active {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Hero — 7/5 split
   ============================================================ */
.hero { padding-block: var(--s-section); }
.hero__inner {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--s-xxl);
  align-items: center;
}
.hero p.body-md { margin: var(--s-lg) 0 0; font-size: 18px; max-width: 46ch; }

/* Product-UI mockup card (hero artifact) */
.mockup-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: var(--s-lg);
}
.mockup-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding-bottom: var(--s-sm);
  border-bottom: 1px solid var(--hairline-soft);
}
.mockup-card__title { font-size: 14px; font-weight: 600; color: var(--ink); }
.mockup-card__meta { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted-soft); }

.slot-list { display: grid; gap: var(--s-xs); margin-top: var(--s-md); }
.slot {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--ink);
}
.slot__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--success);
  flex: none;
}
.slot__label { font-weight: 500; }
.slot__tail { margin-left: auto; font-size: 13px; color: var(--muted); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
}
.card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: var(--s-md);
}
.card h3 { margin-bottom: var(--s-xs); }
.card p { margin: 0; font-size: 16px; color: var(--body); }

.card--outline {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  padding: var(--s-lg);
}

/* Post list */
.post-list { display: grid; gap: 0; }
.post {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: var(--s-lg);
  align-items: baseline;
  padding-block: var(--s-lg);
  border-bottom: 1px solid var(--hairline-soft);
}
.post:first-child { border-top: 1px solid var(--hairline-soft); }
.post__date { font-size: 13px; font-weight: 500; color: var(--muted-soft); }
.post__body h3 { margin-bottom: var(--s-xxs); }
.post__body p { margin: 0; font-size: 14px; color: var(--muted); }
.post__tags { display: flex; gap: var(--s-xs); flex-wrap: wrap; }

/* Timeline */
.timeline { display: grid; gap: var(--s-lg); }
.timeline__item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--s-lg);
  padding-bottom: var(--s-lg);
  border-bottom: 1px solid var(--hairline-soft);
}
.timeline__when { font-size: 13px; font-weight: 500; color: var(--muted-soft); }
.timeline__what p { margin: var(--s-xxs) 0 0; font-size: 14px; color: var(--body); }

/* ============================================================
   Badges / avatars
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.badge--orange  { background: var(--badge-orange);  color: var(--on-dark); }
.badge--pink    { background: var(--badge-pink);    color: var(--on-dark); }
.badge--violet  { background: var(--badge-violet);  color: var(--on-dark); }
.badge--emerald { background: var(--badge-emerald); color: var(--ink); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--surface-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  flex: none;
}
.avatar--lg { width: 96px; height: 96px; font-size: 28px; }

.skill-grid { display: flex; flex-wrap: wrap; gap: var(--s-xs); margin-top: var(--s-md); }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  padding: var(--s-xxl);
  text-align: center;
}
.cta-band p { margin: var(--s-sm) auto 0; max-width: 52ch; color: var(--muted); }
.cta-band .btn-row { justify-content: center; }

/* ============================================================
   Footer — the only dark surface
   ============================================================ */
.footer {
  background: var(--surface-dark);
  color: var(--on-dark-soft);
  padding-block: 64px;
  margin-top: var(--s-section);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-lg);
}
.footer .wordmark { color: var(--on-dark); }
.footer .wordmark__dot { background: var(--on-dark); }
.footer h4 {
  margin: 0 0 var(--s-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-md); }
.footer a { color: var(--on-dark-soft); font-size: 14px; }
.footer a:hover { color: var(--on-dark); }
.footer__note {
  margin-top: var(--s-xl);
  padding-top: var(--s-lg);
  border-top: 1px solid var(--surface-dark-elevated);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-soft);
}

/* ============================================================
   Responsive — DESIGN-cal.md breakpoints
   ============================================================ */
@media (max-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .nav-menu { gap: var(--s-md); margin-left: var(--s-md); }
}

@media (max-width: 768px) {
  :root { --s-section: 64px; }

  .display-xl { font-size: 32px; letter-spacing: -1px; }
  .display-lg { font-size: 28px; letter-spacing: -0.75px; }
  .display-md { font-size: 24px; letter-spacing: -0.5px; }

  .nav-menu, .nav-right { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .top-nav.is-open .nav-menu {
    display: grid;
    gap: var(--s-md);
    position: absolute;
    inset: 64px 0 auto;
    margin: 0;
    padding: var(--s-lg);
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
  }

  .hero__inner { grid-template-columns: 1fr; gap: var(--s-xl); }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; gap: var(--s-xs); }
  .timeline__item { grid-template-columns: 1fr; gap: var(--s-xs); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--s-xl); }
  .cta-band { padding: var(--s-xl); }
  .nav-pill-group { flex-wrap: wrap; }
}
