:root {
  --bg: #fdfdfc;
  --bg-trans: rgba(253, 253, 252, 0.88);
  --fg: #111111;
  --fg-muted: #555555;
  --dim: #888888;
  --border: #e9e9e7;
  --border-subtle: #f0f0ee;
  --card-bg: #ffffff;
  --hover-bg: #f4f4f2;
  --accent: #22c55e;
  --tag-bg: #f3f3f0;
  
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --hand: 'Architects Daughter', cursive;
  
  --col: 720px;
  --pad: 24px;
}

html.dark {
  --bg: #0c0c0c;
  --bg-trans: rgba(12, 12, 12, 0.88);
  --fg: #ededed;
  --fg-muted: #999999;
  --dim: #666666;
  --border: #222222;
  --border-subtle: #181818;
  --card-bg: #141414;
  --hover-bg: #1a1a1a;
  --accent: #4ade80;
  --tag-bg: #181818;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: rgba(0, 0, 0, 0.1);
  color: var(--fg);
}

html.dark ::selection {
  background: rgba(255, 255, 255, 0.15);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Single center column */
.container {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: 100vh;
  position: relative;
}

.container::before,
.container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--border) 1px, transparent 1px) 0 0/1px 4px repeat-y;
  pointer-events: none;
}

.container::before { left: -1px; }
.container::after { right: -1px; }

@media (max-width: 768px) {
  .container::before,
  .container::after {
    display: none;
  }
}

/* Top Sticky Navigation */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  background: var(--bg-trans);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav {
  max-width: var(--col);
  margin: 0 auto;
  padding: 16px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-mark {
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse-dot 2.4s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 14px;
  color: var(--fg-muted);
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--fg);
  background: var(--hover-bg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  color: var(--fg);
  background: var(--hover-bg);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections & Spacing */
section {
  padding: 65px 0 25px;
}

@media (max-width: 600px) {
  section {
    padding: 45px 0 20px;
  }
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Hero Section */
.hero {
  padding-top: 55px;
  padding-bottom: 35px;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 36px;
}

.hero-intro {
  flex: 1;
}

h1.hero-title {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--fg);
}

@media (max-width: 650px) {
  h1.hero-title {
    font-size: 36px;
  }
  .hero-header {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}

.hero-bio {
  font-size: 16.5px;
  color: var(--fg-muted);
  line-height: 1.68;
  margin-bottom: 20px;
  max-width: 530px;
}

.hero-bio p + p {
  margin-top: 14px;
}

/* Hero Actions & Clean Status Alignment */
.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.reach-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.reach-mail {
  font-family: var(--serif);
  font-size: 26px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.reach-mail:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  transition: all 0.2s ease;
}

.copy-btn:hover {
  color: var(--fg);
  background: var(--hover-bg);
  border-color: var(--fg-muted);
}

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.resume-btn:hover {
  border-color: var(--fg);
  background: var(--hover-bg);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-muted);
  padding: 3px 10px;
  background: var(--tag-bg);
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  align-self: flex-start;
}

/* Original Circular Spidey Avatar (from commit 3120792) */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
}

.avatar-canvas-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-canvas-container:hover {
  border-color: var(--fg);
  transform: scale(1.03);
}

.avatar-canvas-container:active {
  transform: scale(0.96);
}

canvas#avatar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.speech-bubble {
  position: absolute;
  bottom: -32px;
  right: -10px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--hand);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.speech-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Case Studies (Story format) */
.case-study {
  padding: 34px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.case-study:last-child {
  border-bottom: none;
}

.case-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 8px;
}

.case-tag {
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--fg-muted);
}

.badge-pending {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.28);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
}

.badge-live {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
}

html.dark .badge-pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

html.dark .badge-live {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.case-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.case-title a:hover {
  text-decoration: underline;
}

.case-body {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.7;
}

.case-body p + p {
  margin-top: 10px;
}

.case-punchline {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
}

.case-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.text-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.text-link.primary {
  color: var(--fg);
  font-weight: 500;
}

/* Warm Hug Followup Section */
.warm-hug {
  padding: 50px 0 20px;
}

.warm-hug-card {
  padding: 32px 30px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.warm-hug-lead {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.25;
  color: var(--fg);
  margin-bottom: 14px;
}

.warm-hug-body {
  font-size: 15.5px;
  color: var(--fg-muted);
  line-height: 1.7;
}

.warm-hug-body + .warm-hug-body {
  margin-top: 10px;
}

.warm-hug-signoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.handwritten-note {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--fg);
}

.warm-hug-mail {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--fg);
  transition: opacity 0.2s ease;
}

.warm-hug-mail:hover {
  opacity: 0.7;
}

/* Deploy Reminder Callout */
.weekend-callout {
  margin: 32px 0 10px;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--tag-bg);
  font-size: 14px;
  color: var(--fg-muted);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.weekend-callout b {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--fg);
  letter-spacing: 0.05em;
}

/* Dedicated Project Page Styles */
.crumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 24px;
}

.crumb-bar a:hover {
  color: var(--fg);
}

.project-hero-title {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.18;
  margin-bottom: 16px;
  color: var(--fg);
}

.project-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 28px 0 36px;
  padding: 16px;
  border-radius: 10px;
  background: var(--tag-bg);
  border: 1px solid var(--border-subtle);
}

.stat-item b {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-item span {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

.project-section-heading {
  font-family: var(--serif);
  font-size: 24px;
  margin: 36px 0 12px;
  color: var(--fg);
}

.project-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg-muted);
}

.project-text p + p {
  margin-top: 14px;
}

/* Human / Quirks section */
.human-text {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.8;
}

.human-text p + p {
  margin-top: 16px;
}

.human-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--fg);
  line-height: 1.4;
  margin: 28px 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}

/* Toast Island */
.toast-island {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--fg);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.toast-island.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
footer {
  padding: 60px 0 45px;
  border-top: 1px solid var(--border);
  margin-top: 50px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-greeting {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--fg);
}

.footer-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.footer-colophon {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-colophon a:hover {
  color: var(--fg);
}

/* Smooth motion reveal */
.reveal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(10px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  filter: none;
  transform: none;
}
