/* Shared styles for every page. Change colors and fonts here, once. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --link: #0066cc;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --glow: rgba(0, 113, 227, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1d1d1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --link: #2997ff;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --glow: rgba(41, 151, 255, 0.22);
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Layout helpers */
.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.narrow { max-width: 44rem; }
.center { text-align: center; }

.band {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: var(--bg-alt);
}
.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

/* Frosted navigation bar */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.global-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 60rem;
  height: 48px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.nav-name {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

/* Home page hero */
.hero {
  padding: clamp(5rem, 16vw, 9rem) 1.25rem clamp(4rem, 12vw, 7rem);
  text-align: center;
  background: radial-gradient(70% 60% at 50% 0%, var(--glow), transparent 70%);
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 11vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.hero-sub {
  max-width: 28ch;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.75rem;
  margin: 2rem 0 0;
}

/* Buttons and links */
.pill {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s;
}
.pill:hover { background: var(--accent-hover); }

.chev, .chev-back {
  color: var(--link);
  text-decoration: none;
}
.chev::after { content: "\203A"; margin-left: 0.3em; }
.chev-back::before { content: "\2039"; margin-right: 0.3em; }
.chev:hover, .chev-back:hover { text-decoration: underline; }

/* Headlines */
.statement {
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}
.section-title {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
}
.band p { margin: 0 0 1.5rem; color: var(--muted); font-size: 1.25rem; }
.more { margin: 2rem 0 0; text-align: center; }

/* Post cards */
.cards {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  display: block;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}
.card time {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.card p { margin: 0; color: var(--muted); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover {
    transform: scale(1.015);
    box-shadow: 0 12px 32px var(--shadow);
  }
}

/* Writing page header */
.page-head {
  padding: clamp(3.5rem, 10vw, 6rem) 1.25rem 2.5rem;
  text-align: center;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.page-head p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.25rem;
}
.page-body { padding-bottom: clamp(4rem, 10vw, 7rem); }

/* Blog posts */
.post-head { padding: clamp(3.5rem, 10vw, 6rem) 0 2rem; }
.post-date {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.post h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.prose {
  font-size: 1.1875rem;
  line-height: 1.6;
}
.prose p, .prose ul, .prose ol { margin: 0 0 1.25rem; }
.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 0.9em;
}
.prose pre {
  margin: 0 0 1.25rem;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--bg-alt);
}
.prose pre code { padding: 0; background: none; }
.back { margin: 3rem 0 0; padding-bottom: clamp(4rem, 10vw, 7rem); }

/* Footer */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.75rem;
}
.footer p { margin: 0; }
