/* ==========================================================================
   JAMONE KELLY - TACTILE CRUMPLED FINE PAPER & FOUNTAIN PEN DESIGN SYSTEM
   Single Page Application with Display P3 Wide Gamut Colors & OLED Dark Mode
   ========================================================================== */

/* --- Typography Imports (Google Fonts: Caveat for handwriting, Plus Jakarta Sans for UI) --- */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,700;1,6..72,500&display=swap');

/* --- Root & Light Mode Palette (Fine Archival Cotton Rag Paper & Prussian Blue Ink) --- */
:root {
  --theme-mode: 'light';

  /* Paper Canvas & Texture */
  --paper-bg-base: #f7f4ee;
  --paper-bg-card: rgba(253, 251, 247, 0.88);
  --paper-bg-card-hover: rgba(255, 255, 255, 0.96);
  --paper-surface: #efebe2;
  --paper-texture-url: url('../images/paper_light.jpg');
  --paper-texture-opacity: 0.85;
  --paper-blend-mode: multiply;

  /* Rives, Creases & Shadows */
  --rive-edge-border: rgba(90, 75, 60, 0.16);
  --rive-edge-shadow: 0 4px 20px -2px rgba(80, 65, 45, 0.14), 0 1px 3px rgba(80, 65, 45, 0.08);
  --crease-highlight: rgba(255, 255, 255, 0.7);
  --crease-shadow: rgba(80, 65, 45, 0.12);

  /* Fountain Pen Ink Colors (sRGB Fallbacks) */
  --text-ink: #1b2129;             /* Midnight Walnut Carbon Ink */
  --text-ink-secondary: #4a5563;   /* Diluted Sepia Ink */
  --text-ink-muted: #798696;       /* Faded Ink */
  --pen-ink-primary: #1e40af;       /* Classic Prussian Blue */
  --pen-ink-cyan: #0284c7;          /* Teal Fountain Ink */
  --pen-ink-violet: #7c3aed;        /* Royal Iris Ink */
  --pen-ink-emerald: #059669;       /* Forest Emerald Ink */
  --pen-ink-crimson: #dc2626;       /* Carmine Red Ink */
  --pen-ink-amber: #d97706;         /* Gold Amber Ink */
  --ink-bleed: rgba(30, 64, 175, 0.18);
  --pen-nib-highlight: rgba(30, 64, 175, 0.12);

  /* Navigation & Chrome */
  --nav-glass: rgba(247, 244, 238, 0.88);
  --nav-border: rgba(90, 75, 60, 0.14);

  /* Fonts */
  --font-pen: 'Caveat', cursive, sans-serif;
  --font-editorial: 'Newsreader', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Radii & Squircle */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-squircle: 22.5%;

  /* Spacing */
  --header-height: 76px;
  --max-width: 1200px;
  --ease-pen: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   DISPLAY P3 WIDE GAMUT ENHANCEMENTS (Light Mode)
   Enables vivid, hyper-saturated fountain pen inks on Apple Retina / OLED
   ========================================================================== */
@supports (color: color(display-p3 1 1 1)) {
  :root {
    --pen-ink-primary: color(display-p3 0.1 0.28 0.85);
    --pen-ink-cyan: color(display-p3 0 0.56 0.88);
    --pen-ink-violet: color(display-p3 0.52 0.2 0.95);
    --pen-ink-emerald: color(display-p3 0.02 0.62 0.42);
    --pen-ink-crimson: color(display-p3 0.9 0.12 0.18);
    --pen-ink-amber: color(display-p3 0.9 0.48 0);
  }
}

/* ==========================================================================
   DARK MODE (Crumbled Obsidian Fine Paper & Luminous OLED Inks)
   ========================================================================== */
[data-theme="dark"] {
  --theme-mode: 'dark';

  /* True OLED Black Foundation */
  --paper-bg-base: #000000;
  --paper-bg-card: rgba(14, 17, 24, 0.84);
  --paper-bg-card-hover: rgba(22, 28, 40, 0.92);
  --paper-surface: #0a0d13;
  --paper-texture-url: url('../images/paper_dark.jpg');
  --paper-texture-opacity: 0.95;
  --paper-blend-mode: screen;

  /* Rives, Deep Crevice Shadows & Edge Glint */
  --rive-edge-border: rgba(255, 255, 255, 0.1);
  --rive-edge-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.95), 0 0 1px rgba(255, 255, 255, 0.16);
  --crease-highlight: rgba(255, 255, 255, 0.12);
  --crease-shadow: rgba(0, 0, 0, 0.95);

  /* Luminous Pen Ink Colors (sRGB Fallbacks) */
  --text-ink: #f1f5f9;             /* Sterling Ink */
  --text-ink-secondary: #94a3b8;   /* Silver Ink Wash */
  --text-ink-muted: #64748b;       /* Charcoal Ink */
  --pen-ink-primary: #38bdf8;       /* Electric Sky Blue */
  --pen-ink-cyan: #06b6d4;          /* Vivid Cyan */
  --pen-ink-violet: #a855f7;        /* Neon Iris */
  --pen-ink-emerald: #10b981;       /* Aurora Emerald */
  --pen-ink-crimson: #f43f5e;       /* Fluorescent Rose */
  --pen-ink-amber: #fbbf24;         /* Molten Gold */
  --ink-bleed: rgba(56, 189, 248, 0.35);
  --pen-nib-highlight: rgba(56, 189, 248, 0.18);

  /* Navigation & Chrome */
  --nav-glass: rgba(0, 0, 0, 0.88);
  --nav-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   DISPLAY P3 WIDE GAMUT ENHANCEMENTS (Dark Mode - OLED Vibrancy)
   Extreme saturation that pops against true OLED #000000 blacks
   ========================================================================== */
@supports (color: color(display-p3 1 1 1)) {
  [data-theme="dark"] {
    --pen-ink-primary: color(display-p3 0.1 0.78 1);
    --pen-ink-cyan: color(display-p3 0 0.95 1);
    --pen-ink-violet: color(display-p3 0.65 0.25 1);
    --pen-ink-emerald: color(display-p3 0.05 0.98 0.55);
    --pen-ink-crimson: color(display-p3 1 0.2 0.4);
    --pen-ink-amber: color(display-p3 1 0.75 0.05);
    --ink-bleed: color(display-p3 0 0.9 1 / 0.35);
  }
}

/* ==========================================================================
   GLOBAL RESET & CRUMPLED PAPER BACKGROUND CANVAS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-ink);
  background-color: var(--paper-bg-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 300ms ease, color 300ms ease;
}

/* The Crumpled Paper Sheet Canvas Layer */
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--paper-bg-base);
}

/* Background Texture Layer with Defining Creases & Rives */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--paper-texture-url);
  background-repeat: repeat;
  background-size: cover;
  background-position: center top;
  opacity: var(--paper-texture-opacity);
  pointer-events: none;
  z-index: -2;
  transition: opacity 300ms ease;
}

/* Ambient Vignette & Depth Lighting Layer */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 10% 20%, var(--pen-nib-highlight) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: var(--pen-ink-primary);
  color: #ffffff;
}

/* ==========================================================================
   FOUNTAIN PEN LINKS & HANDWRITTEN ACCENTS
   ========================================================================== */

/* Links with Fine Fountain Pen Character */
a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

/* The Fountain Pen Link Style */
.pen-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pen-ink-primary);
  font-weight: 600;
  cursor: pointer;
  padding-bottom: 3px;
  transition: color 200ms ease, text-shadow 200ms ease;
}

.pen-link:hover {
  color: var(--pen-ink-cyan);
  text-shadow: 0 0 10px var(--ink-bleed);
}

/* Animated Pen Stroke Underline */
.pen-stroke-underline {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 6px;
  pointer-events: none;
}

.pen-stroke-underline path {
  stroke: var(--pen-ink-primary);
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  transition: stroke-dashoffset 320ms var(--ease-pen), stroke 200ms ease;
}

.pen-link:hover .pen-stroke-underline path,
.pen-link:focus .pen-stroke-underline path {
  stroke-dashoffset: 0;
  stroke: var(--pen-ink-cyan);
}

/* Handwriting Typography Classes */
.font-pen {
  font-family: var(--font-pen);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.font-editorial {
  font-family: var(--font-editorial);
  font-weight: 700;
}

/* Ink Stamp / Seal Badge */
.ink-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pen);
  font-size: 1.125rem;
  color: var(--pen-ink-crimson);
  border: 1.5px solid var(--pen-ink-crimson);
  padding: 4px 14px;
  border-radius: var(--radius-md);
  transform: rotate(-1.5deg);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.12);
  background: rgba(220, 38, 38, 0.04);
}

/* ==========================================================================
   NAVIGATION BAR (Frosted Paper Header)
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--nav-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  z-index: 1000;
  transition: background-color 300ms ease, border-color 300ms ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-squircle);
  object-fit: cover;
  border: 2px solid var(--pen-ink-primary);
  box-shadow: 0 2px 8px var(--crease-shadow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-editorial);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-ink);
}

.brand-title {
  font-family: var(--font-pen);
  font-size: 1.0625rem;
  color: var(--pen-ink-primary);
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link-item a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-ink-secondary);
  position: relative;
  padding: 6px 0;
}

.nav-link-item a:hover,
.nav-link-item a.active {
  color: var(--pen-ink-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Switcher Button (Fountain Pen / Day-Night Nib) */
.theme-toggle-btn {
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  color: var(--text-ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--rive-edge-shadow);
  transition: all 200ms ease;
}

.theme-toggle-btn:hover {
  border-color: var(--pen-ink-primary);
  color: var(--pen-ink-primary);
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 0 14px var(--ink-bleed);
}

.btn-pen-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  background: var(--pen-ink-primary);
  color: #ffffff;
  border: 1px solid var(--pen-ink-primary);
  box-shadow: 0 4px 14px var(--ink-bleed);
  transition: all 200ms var(--ease-pen);
}

.btn-pen-primary:hover {
  background: var(--pen-ink-cyan);
  border-color: var(--pen-ink-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--ink-bleed);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-ink);
  padding: 8px;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--nav-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nav-border);
  padding: 24px;
  flex-direction: column;
  gap: 16px;
  z-index: 999;
}

.mobile-drawer.open {
  display: flex;
  animation: paperSlideDown 250ms var(--ease-pen);
}

@keyframes paperSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TACTILE CRUMPLED PAPER CARDS & RIVE EDGES
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding-top: 96px;
  padding-bottom: 96px;
  position: relative;
}

/* Tactile Crumpled Paper Card with Rives & Creases */
.paper-card {
  position: relative;
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--rive-edge-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 280ms var(--ease-pen);
}

/* Natural Organic Rive & Crease Variation */
.paper-card:hover {
  background: var(--paper-bg-card-hover);
  border-color: var(--pen-ink-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.2), 0 0 20px var(--ink-bleed);
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px auto;
}

.section-handwritten-tag {
  font-family: var(--font-pen);
  font-size: 1.375rem;
  color: var(--pen-ink-primary);
  display: inline-block;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-editorial);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-ink);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  padding-top: calc(var(--header-height) + 64px);
  padding-bottom: 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 56px;
}

.hero-title {
  font-family: var(--font-editorial);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-ink);
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-title .ink-highlight {
  color: var(--pen-ink-primary);
  font-family: var(--font-pen);
  font-weight: 700;
  font-style: normal;
  display: inline-block;
  font-size: 1.1em;
  padding: 0 4px;
  text-shadow: 0 0 16px var(--ink-bleed);
}

.hero-bio {
  font-size: 1.25rem;
  color: var(--text-ink-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.btn-pen-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  background: var(--paper-surface);
  color: var(--text-ink);
  border: 1px solid var(--rive-edge-border);
  box-shadow: var(--rive-edge-shadow);
  transition: all 200ms var(--ease-pen);
}

.btn-pen-secondary:hover {
  border-color: var(--text-ink);
  transform: translateY(-2px);
}

.hero-portrait-card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  box-shadow: var(--rive-edge-shadow);
  text-align: center;
}

.hero-portrait-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--rive-edge-border);
  margin-bottom: 20px;
  box-shadow: 0 4px 16px var(--crease-shadow);
}

.hero-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-signature {
  font-family: var(--font-pen);
  font-size: 1.875rem;
  color: var(--pen-ink-primary);
  line-height: 1;
  margin-top: 8px;
}

/* ==========================================================================
   PROJECTS SHOWCASE SECTION
   ========================================================================== */

.projects-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.filter-pill-btn {
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  color: var(--text-ink-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 200ms ease;
}

.filter-pill-btn:hover {
  color: var(--text-ink);
  border-color: var(--pen-ink-primary);
}

.filter-pill-btn.active {
  background: var(--pen-ink-primary);
  color: #ffffff;
  border-color: var(--pen-ink-primary);
  box-shadow: 0 4px 12px var(--ink-bleed);
}

.search-field-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.search-field {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: var(--radius-md);
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  color: var(--text-ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  box-shadow: var(--rive-edge-shadow);
  transition: all 200ms ease;
}

.search-field:focus {
  border-color: var(--pen-ink-primary);
  box-shadow: 0 0 0 3px var(--ink-bleed);
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-ink-muted);
  pointer-events: none;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.project-item-card {
  display: flex;
  flex-direction: column;
}

.project-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.app-squircle-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-squircle);
  object-fit: cover;
  border: 1px solid var(--rive-edge-border);
  box-shadow: 0 4px 12px var(--crease-shadow);
  transition: transform 250ms var(--ease-pen);
}

.project-item-card:hover .app-squircle-icon {
  transform: scale(1.06);
}

.badge-pen {
  display: inline-block;
  font-family: var(--font-pen);
  font-size: 1rem;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}

.badge-pen-ios {
  color: var(--pen-ink-primary);
  background: rgba(30, 64, 175, 0.08);
}

.badge-pen-web {
  color: var(--pen-ink-cyan);
  background: rgba(2, 132, 199, 0.08);
}

.badge-pen-experiment {
  color: var(--pen-ink-violet);
  background: rgba(124, 58, 237, 0.08);
}

.project-card-title {
  font-family: var(--font-editorial);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-ink);
  margin-bottom: 8px;
  line-height: 1.25;
}

.project-card-desc {
  font-size: 0.9375rem;
  color: var(--text-ink-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.tech-tag-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--paper-surface);
  border: 1px solid var(--rive-edge-border);
  color: var(--text-ink-secondary);
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--rive-edge-border);
  padding-top: 16px;
}

/* ==========================================================================
   WORK EXPERIENCE TIMELINE
   ========================================================================== */

.timeline-track {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding-left: 56px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 20px;
  left: 23px;
  width: 2px;
  background: linear-gradient(180deg, var(--pen-ink-primary) 0%, var(--pen-ink-cyan) 50%, var(--rive-edge-border) 100%);
}

.timeline-entry {
  position: relative;
  margin-bottom: 36px;
}

.timeline-pen-node {
  position: absolute;
  top: 24px;
  left: -56px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper-bg-card);
  border: 2px solid var(--pen-ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pen-ink-primary);
  box-shadow: 0 0 12px var(--ink-bleed);
  z-index: 2;
}

.timeline-company-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border: 1px solid var(--rive-edge-border);
}

.timeline-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.timeline-role-title {
  font-family: var(--font-editorial);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-ink);
}

.timeline-company-name {
  font-family: var(--font-pen);
  font-size: 1.1875rem;
  color: var(--pen-ink-primary);
}

.timeline-date-loc {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8125rem;
  color: var(--text-ink-muted);
  margin-bottom: 12px;
}

/* ==========================================================================
   SPECIALTIES / SKILLS SECTION
   ========================================================================== */

.specialties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.specialty-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(30, 64, 175, 0.08);
  border: 1px solid var(--pen-ink-primary);
  color: var(--pen-ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.specialty-title {
  font-family: var(--font-editorial);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-ink);
  margin-bottom: 10px;
}

/* ==========================================================================
   CASE STUDY MODAL (Handmade Paper Document)
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 250ms ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-document {
  position: relative;
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  background: var(--paper-bg-card);
  border: 1px solid var(--rive-edge-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  padding: 40px;
  transform: translateY(20px) scale(0.97);
  transition: transform 250ms var(--ease-pen);
}

.modal-backdrop.open .modal-document {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--paper-surface);
  border: 1px solid var(--rive-edge-border);
  color: var(--text-ink-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
}

.modal-close-btn:hover {
  color: var(--pen-ink-primary);
  border-color: var(--pen-ink-primary);
  transform: scale(1.1);
}

/* ==========================================================================
   FOOTER (ARCHIVAL PARCHMENT)
   ========================================================================== */

.footer {
  background: var(--paper-surface);
  border-top: 1px solid var(--rive-edge-border);
  padding: 64px 0 36px 0;
  color: var(--text-ink-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-bio h4 {
  font-family: var(--font-editorial);
  font-size: 1.25rem;
  color: var(--text-ink);
  margin-bottom: 12px;
}

.footer-links-col h5 {
  font-family: var(--font-editorial);
  font-size: 1rem;
  color: var(--text-ink);
  margin-bottom: 16px;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--rive-edge-border);
  padding-top: 28px;
  font-size: 0.875rem;
  color: var(--text-ink-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-bio {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-portrait-card {
    max-width: 360px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 68px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .nav-links,
  .nav-actions .btn-pen-primary {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .hero-bio {
    font-size: 1.0625rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .timeline-track {
    padding-left: 36px;
  }

  .timeline-track::before {
    left: 14px;
  }

  .timeline-pen-node {
    left: -36px;
    width: 30px;
    height: 30px;
    top: 24px;
  }

  .timeline-pen-node svg {
    width: 14px;
    height: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom-row {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .modal-document {
    padding: 24px;
  }
}
