/* ============================================
   PORTFOLIO STYLESHEET (css/styles.css)
   ============================================
   black & white editorial theme

   HOW TO CUSTOMIZE:
   - change colors: edit the variables in Section 1 below (--bg, --text, etc.)
   - change fonts: update --font-display and --font-body (Section 1)
   - change spacing: adjust --space-xs through --space-xl (Section 1)
   - portrait video: section 6 (hero__portrait/hero__video)
   - responsive breakpoints: see Section 16

   TOC:
   1. variables & theme - colors, fonts, spacing
   2. reset & base - Browser reset, body styles
   3. typography - headings, links, text
   4. utilities - skip link, screen-reader-only, container
   5. navigation - top bar, hamburger, mobile menu
   6. hero - full-screen landing with name, tagline, portrait video
   7. sections - background/experience/elsewhere section layout
   8. background - bio text styling
   9. experience - job card styling
   10. elsewhere/integrations - platform card grid
   11. blog page - blog-specific styles (blog.html)
   12. modal - blog post reader popup
   13. footer - bottom bar with copyright and socials
   14. components - toast, back-to-top, progress bar
   15. animations - keyframe definitions
   16. responsive - media queries for mobile/tablet
   17. print - Print stylesheet
   ============================================ */

/* -----
1. variables & theme - EDIT HERE to change the look of site
----- */
:root {
  /* COLORS */
  --bg: #ffffff;           /* page bg */
  --bg-alt: #fafafa;       /* slightly off-white for alternating sections */
  --text: #0a0a0a;         /* main text color (near-black) */
  --muted: #666666;        /* secondary text (descriptions, bios) */
  --light: #999999;        /* tertiary text (labels, metadata) */
  --border: #e5e5e5;       /* borders, dividers, card outlines */
  
  /* FONTS: load from Google Fonts (see index.html <head>) */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;  /* Headings */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;  /* Body text */
  
  /* SPACING: margins/padding throughout the site */
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 2rem;     /* 32px */
  --space-lg: 4rem;     /* 64px */
  --space-xl: 8rem;     /* 128px — used for hero height and section padding */
  
  /* EASING: animation smoothness */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* TRANSITION SPEEDS: how long animations take */
  --transition-fast: 0.2s var(--ease-out);   /* Hovers, focus states */
  --transition-base: 0.4s var(--ease-out);   /* Color changes, borders */
  --transition-slow: 0.8s var(--ease-out);   /* Page transitions, reveals */
}

/* dark mode colors - activated by data-theme="dark" on <html> */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #111111;
  --text: #f0f0f0;
  --muted: #999999;
  --light: #666666;
  --border: #222222;
}

/* respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0.01s;
    --transition-base: 0.01s;
    --transition-slow: 0.01s;
  }
  * {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
  }
}

/* -----
2. reset & base
----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #000;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* subtle grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* hide scrollbar on hero so the video occupies full width with no gap */
.hero::-webkit-scrollbar { display: none; }
.hero { -ms-overflow-style: none; scrollbar-width: none; }

/* -----
3. typography
----- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* -----
4. utilities
----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10000;
  transition: top 0.3s var(--ease-out);
}

.skip-link:focus {
  top: var(--space-sm);
}

.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;
}

/* -----
5. navigation
----- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-base), background var(--transition-base);
}

[data-theme="dark"] .nav {
  background: rgba(10,10,10,0.85);
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255,255,255,0.95);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(10,10,10,0.95);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  position: relative;
}

/* DARK MODE TOGGLE: small icon button next to logo */
.nav__left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* sun in dark mode, moon in light mode */
.theme-toggle__icon--sun  { display: none; }
.theme-toggle__icon--moon { display: block; }
[data-theme="dark"] .theme-toggle__icon--sun  { display: block; }
[data-theme="dark"] .theme-toggle__icon--moon { display: none; }

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav__link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link--active {
  color: var(--text);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* hamburger */
.hamburger {
  display: none;
  width: 24px;
  height: 20px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  left: 0;
  transition: all 0.3s var(--ease-out);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

.hamburger.active span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  transform: translateX(100%);
  transition: transform 0.6s var(--ease-out);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 500;
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.5s var(--ease-out);
}

.mobile-menu.active .mobile-menu__link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu.active .mobile-menu__link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu__link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-menu__link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu__link:nth-child(4) { transition-delay: 0.25s; }

/* -----
6. hero - full-viewport video with name, typewriter, and scroll indicator overlaid.
----- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* top half, full-width video wrapper - sticks at top while scrolling. */
.hero__video-wrap {
  width: 100%;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter var(--transition-slow);
  /* FRAME-HOLD EFFECT: snaps video through subtle sub-pixel position
    changes using steps(1). each step holds the current position for
    full duration before jumping to the next - no smooth interpolation.
    
    creates "burst photo" look: frame stays, then snaps to a
    slightly different position, mimicking someone rapidly clicking
    photos while the subject moves. */
  animation: frame-hold 0.35s steps(1) infinite;
}

.hero__video-wrap:hover .hero__video {
  filter: grayscale(0%);
}

/* FRAME-HOLD KEYFRAMES: each step shifts the video by sub-pixel amounts
  in different directions. discrete jumps between positions create
  illusion that each frame is being "held" in place before the next
  click captures a new position - just like burst-mode photography. */
@keyframes frame-hold {
  0%   { transform: translate(0, 0)       scale(1);     filter: brightness(1)    grayscale(100%); }
  25%  { transform: translate(0.5px, 0)   scale(1.001); filter: brightness(1.01) grayscale(100%); }
  50%  { transform: translate(0, 0.5px)   scale(0.999); filter: brightness(0.99) grayscale(100%); }
  75%  { transform: translate(-0.5px, 0)  scale(1);     filter: brightness(1.01) grayscale(100%); }
  100% { transform: translate(0, 0)       scale(1);     filter: brightness(1)    grayscale(100%); }
}

/* when hovering, frame-hold keeps running but without grayscale.
  animation overrides the hover filter, so i duplicate the keyframes without grayscale value. */
.hero__video-wrap:hover .hero__video {
  animation: frame-hold-color 0.35s steps(1) infinite;
}

@keyframes frame-hold-color {
  0%   { transform: translate(0, 0)       scale(1);     filter: brightness(1); }
  25%  { transform: translate(0.5px, 0)   scale(1.001); filter: brightness(1.01); }
  50%  { transform: translate(0, 0.5px)   scale(0.999); filter: brightness(0.99); }
  75%  { transform: translate(-0.5px, 0)  scale(1);     filter: brightness(1.01); }
  100% { transform: translate(0, 0)       scale(1);     filter: brightness(1); }
}

/* NAME: overlaid on video, positioned on right side. */
.hero__name {
  position: absolute;
  top: 50%;
  right: var(--space-lg);
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #fff;
  text-align: right;
  z-index: 1;
  opacity: 0;
  transform: translateY(calc(-50% + 50px));
  animation: revealUp 1.2s var(--ease-out) 0.2s forwards;
  /* subtle text shadow so name is readable over video content */
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

/* TYPEWRITER: cycles through texts below name, aligned to the right.
   each text types out character by character, pauses, then deletes. */
.hero__typewriter {
  position: absolute;
  top: calc(50% + clamp(3rem, 6vw, 6rem) * 0.9 + 0.75rem);
  right: var(--space-lg);
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
  z-index: 1;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

/* blinking cursor for the typewriter */
.hero__typewriter::after {
  content: '|';
  animation: blink 0.7s steps(1) infinite;
  margin-left: 2px;
  opacity: 0.7;
}

@keyframes blink {
  0%, 50% { opacity: 0.7; }
  51%, 100% { opacity: 0; }
}

/* META: year & availability - positioned bottom-right inside the video. */
.hero__meta {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-lg);
  text-align: right;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1;
  opacity: 0;
  animation: revealUp 1s var(--ease-out) 1.2s forwards;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

/* SCROLL INDICATOR: positioned at the very bottom-center of the video. */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  z-index: 1;
  opacity: 0;
  animation: revealUp 1s var(--ease-out) 1.4s forwards;
}

.scroll-indicator__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollBounce 2s ease infinite;
}

/* -----
7. sections - my section's inner elements use [data-animate] to fade in.
the section itself does NOT need opacity:0 because the ScrollAnimator
in app.js already handles animating [data-animate] children.
----- */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
}

.section__header {
  position: sticky;
  top: 100px;
  align-self: start;
}

.section__number {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.section__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 500;
}

.section__intro {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
  max-width: 500px;
}

/* -----
8. background
----- */
.bio {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--muted);
  max-width: 580px;
}

.bio p + p {
  margin-top: 1.25rem;
}

/* -----
9. experience - job cards in a 2-column layout (period | details).
each card has a hover effect: a black line grows across the top,
and the card shifts right slightly. to change animation speed,
adjust --transition-base in the variables section.
----- */
.experience-list {
  display: flex;
  flex-direction: column;
}

.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  position: relative;
  cursor: default;
  transition: padding-left var(--transition-base);
}

.exp-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.7s var(--ease-out);
}

.exp-item:hover::before {
  width: 100%;
}

.exp-item:hover {
  padding-left: var(--space-sm);
}

.exp-item__period {
  font-size: 0.8rem;
  color: var(--light);
  letter-spacing: 0.04em;
  font-weight: 500;
  padding-top: 0.2rem;
}

.exp-item__role {
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.exp-item__company {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.exp-item__desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 480px;
}

/* -----
10. elsewhere/integrations - grid of platform cards.
4 columns on desktop, 2 on tablet, 1 on mobile.
each card fills black from bottom on hover. to change grid columns,
edit "grid-template-columns: repeat(4, 1fr)" below.
----- */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.int-card {
  border: 1px solid var(--border);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-base);
  text-decoration: none;
  display: block;
}

.int-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
  z-index: 0;
}

.int-card:hover::before {
  transform: translateY(0);
}

.int-card:hover {
  border-color: var(--text);
}

.int-card > * {
  position: relative;
  z-index: 1;
  transition: color var(--transition-base);
}

.int-card:hover > * {
  color: var(--bg);
}

.int-card__icon {
  width: 22px;
  height: 22px;
  margin-bottom: var(--space-sm);
  stroke: var(--text);
  fill: none;
  stroke-width: 1.5;
  transition: stroke var(--transition-base);
}

.int-card:hover .int-card__icon {
  stroke: var(--bg);
}

.int-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.int-card__status {
  font-size: 0.75rem;
  color: var(--light);
  transition: color var(--transition-base);
}

.int-card:hover .int-card__status {
  color: rgba(255,255,255,0.65);
}

/* ----- 
11. blog page - styles for blog.html (the "marginalia" page).
these styles only apply to blog.html (which has class="page-blog" on <body>).
can safely edit these without affecting my main portfolio page.
----- */
.page-blog .nav {
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.blog-header {
  padding: calc(var(--space-xl) + 60px) var(--space-md) var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.blog-header__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.blog-header__subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
}

.blog-content {
  padding: var(--space-lg) 0 var(--space-xl);
}

.blog-search {
  position: relative;
  max-width: 400px;
  margin-bottom: var(--space-md);
}

.blog-search__icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--light);
}

.blog-search__input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.5rem;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
  transition: border-color var(--transition-fast);
}

.blog-search__input:focus {
  outline: none;
  border-color: var(--text);
}

.blog-search__input::placeholder {
  color: var(--light);
}

.blog-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.blog-card {
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.5s var(--ease-out);
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 0.6s var(--ease-out) forwards;
}

.blog-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-card:hover {
  border-color: var(--text);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.1);
}

.blog-card__image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  overflow: hidden;
  position: relative;
}

/* BLOG IMAGES: add blog post images here */
.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.06);
}

.blog-card__body {
  padding: var(--space-md);
}

.blog-card__meta {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--light);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-xs);
}

.blog-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  line-height: 1.25;
}

.blog-card__excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.blog-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.blog-card__tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--light);
  letter-spacing: 0.03em;
}

.blog-empty {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* featured post spans full width */
.blog-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.blog-card--featured .blog-card__image {
  aspect-ratio: auto;
  height: 100%;
  min-height: 300px;
}

@media (max-width: 768px) {
  .blog-card--featured {
    grid-template-columns: 1fr;
  }
}

/* -----
12. modal
----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-lg);
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.5s var(--ease-spring);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 2;
}

.modal__close:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.modal__header {
  margin-bottom: var(--space-md);
  padding-right: 3rem;
}

.modal__meta {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--light);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.03em;
}

.modal__title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.modal__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal__tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.modal__content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
}

.modal__content p + p {
  margin-top: 1.25rem;
}

.modal__content h3 {
  font-size: 1.3rem;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--text);
}

.modal__content strong {
  color: var(--text);
}

/* -----
13. footer
----- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--light);
  margin: 0;
}

.footer__email,
.footer__back {
  font-size: 0.85rem;
  color: var(--muted);
  position: relative;
  display: inline-block;
  width: fit-content;
}

.footer__email::after,
.footer__back::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--transition-base);
}

.footer__email:hover::after,
.footer__back:hover::after {
  width: 100%;
}

.footer__email:hover,
.footer__back:hover {
  color: var(--text);
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.4s var(--ease-spring);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-link:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 24px -6px rgba(0,0,0,0.15);
}

/* -----
14. components
----- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 101;
  pointer-events: none;
}

.reading-progress__bar {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.1s linear;
}

.back-to-top {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}

.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 0.875rem 1.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.5s var(--ease-spring);
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -----
15. animations
----- */
@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.5; }
}

/* ----- 
16. responsive - adapts layout for different screen sizes.
1024px: tablet - integrations grid goes from 4 to 2 columns
768px:  mobile - hamburger menu, single-column layout, smaller padding
480px:  small phone - even smaller hero name and blog title
----- */
@media (max-width: 1024px) {
  .integrations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .hero {
    padding-top: 0;
    width: 100%;
    margin-left: 0;
  }
  .hero__video-wrap {
    height: 40vh;
    margin-left: 0;
  }
  .hero__name {
    font-size: clamp(2rem, 10vw, 3.5rem);
    right: var(--space-md);
  }
  .hero__typewriter {
    font-size: 0.85rem;
    right: var(--space-md);
  }
  .hero__meta {
    right: var(--space-md);
    bottom: var(--space-md);
    font-size: 0.6rem;
  }
  .scroll-indicator {
    display: none;
  }
  .section {
    padding: var(--space-lg) var(--space-md);
  }
  .section__inner {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .section__header {
    position: static;
  }
  .exp-item {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
  .integrations-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .footer {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
  .modal {
    padding: var(--space-md);
    max-height: 90vh;
  }
  .modal__close {
    top: var(--space-sm);
    right: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .hero__name {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }
  .blog-header__title {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

/* -----
17. print
----- */
@media print {
  .nav, .footer, .mobile-menu, .reading-progress,
  .back-to-top, .scroll-indicator, .toast {
    display: none !important;
  }
  .hero {
    min-height: auto;
    padding: 2rem 0;
  }
  .section {
    padding: 2rem 0;
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75rem;
    color: var(--muted);
  }
  body::before {
    display: none;
  }
}
