/* Portfolio — design system */
:root {
  --color-bg: #ffffff;
  --color-bg-dark: #2B3033;
  --color-accent: #76C7FD;
  --color-text: #2B3033;
  --color-text-muted: #5c6468;
  --color-text-on-dark: #ffffff;
  --color-border: #e5e8ea;

  --font-sans: "DM Sans", system-ui, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --content-width: 65ch;
  --content-width-wide: 48rem;
  --page-max: 75rem;
  --case-study-max: 68.75rem; /* 1100px — all project/case study pages */
  --sidebar-width: 14rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --img-border: 1px solid var(--color-border);
  --img-shadow: 0 2px 8px rgba(43, 48, 51, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4 {
  margin: 0 0 var(--space-md);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.65rem); }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 var(--space-xl);
}

p:last-child {
  margin-bottom: 0;
}

/* Layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

.page-wrap {
  flex: 1;
  min-width: 0;
  padding-right: var(--sidebar-width);
}

.main {
  min-height: 100vh;
  position: relative;
}

.main > .content-page-bg ~ .section,
.main > .content-page-bg ~ article {
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Home page: align content max-width with about, philosophy, and other content pages */
.home-page .container {
  max-width: var(--content-width);
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

/* Fixed right sidebar */
.site-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-name {
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin: 0;
  line-height: 1.3;
}

.sidebar-name a {
  color: var(--color-accent);
  text-decoration: none;
}

.sidebar-name a:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-sidebar .nav-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-sidebar .nav-list li {
  margin: 0;
}

.site-sidebar .nav-list a {
  display: block;
  padding: var(--space-xs) 0;
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.site-sidebar .nav-list a:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-sidebar .nav-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xs) 0;
}

/* Contact + Resume: same vertical spacing as main nav (Projects, Philosophy, About) */
.site-sidebar .sidebar-after-divider {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.site-sidebar .resume-link,
.site-sidebar .contact-link {
  display: block;
  color: var(--color-accent);
  font-weight: 500;
  padding: var(--space-xs) 0;
}

@media (max-width: 52rem) {
  .page {
    flex-direction: column;
  }

  .page-wrap {
    padding-right: 0;
    padding-top: 6rem;
  }

  .site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .site-sidebar .sidebar-name {
    width: 100%;
    margin-bottom: 0;
  }

  .site-sidebar nav {
    flex: 1;
  }

  .site-sidebar .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .site-sidebar .nav-divider {
    display: none;
  }

  .site-sidebar .sidebar-after-divider {
    flex-direction: row;
    gap: var(--space-md);
  }

  .site-sidebar .resume-link,
  .site-sidebar .contact-link {
    margin-top: 0;
    padding: var(--space-xs) var(--space-sm);
  }
}

/* Hero — blue gradient, orbs, neural lines, wave (from previous design) */
.hero {
  position: relative;
  padding: var(--space-4xl) 0;
  overflow: hidden;
  background: linear-gradient(135deg, #66C0FC 0%, #3B9EE8 30%, #66C0FC 60%, #8DD4FF 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: hero-pulse-glow 4s ease-in-out infinite;
}

.hero-orb-1 {
  top: 5rem;
  left: 2.5rem;
  width: 16rem;
  height: 16rem;
  background: rgba(255, 255, 255, 0.2);
}

.hero-orb-2 {
  top: 10rem;
  right: 5rem;
  width: 24rem;
  height: 24rem;
  background: rgba(147, 197, 253, 0.3);
  animation-delay: 1s;
}

.hero-orb-3 {
  bottom: 5rem;
  left: 33%;
  width: 20rem;
  height: 20rem;
  background: rgba(255, 255, 255, 0.2);
  animation-delay: 2s;
}

@keyframes hero-pulse-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* Neural network lines + dots */
.hero-neural {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
}

.hero-neural-line {
  stroke-width: 1;
}

.hero-neural-dot {
  animation: hero-float 5s ease-in-out infinite;
}

.hero-neural-dot-2 { animation-delay: 1s; }
.hero-neural-dot-3 { animation-delay: 2s; }
.hero-neural-dot-4 { animation-delay: 1.5s; }

@keyframes hero-float {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-12px); opacity: 0.9; }
}

/* Orbiting dot */
.hero-orbit-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-orbit {
  width: 8rem;
  height: 8rem;
  animation: hero-orbit 12s linear infinite;
}

.hero-orbit-dot {
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: -0.375rem;
  margin-top: -0.375rem;
  background: rgba(220, 238, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

@keyframes hero-orbit {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orb,
  .hero-neural-dot,
  .hero-orbit {
    animation: none;
  }
}

/* Wave separator */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100px;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin-bottom: var(--space-lg);
  color: #ffffff;
  max-width: var(--content-width-wide);
  text-shadow: 0 1px 2px rgba(43, 48, 51, 0.35), 0 0 1em rgba(43, 48, 51, 0.2);
}

.hero .hero-lead {
  font-size: 1.1rem;
  max-width: var(--content-width);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(43, 48, 51, 0.4), 0 0 0.5em rgba(43, 48, 51, 0.25);
}

.home-page .hero h1 {
  max-width: 52rem;
}

.home-page .hero .hero-lead {
  max-width: 70ch;
}

/* Section with accent line */
.section {
  padding: var(--space-2xl) 0;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.section-title .accent-line {
  flex-shrink: 0;
  align-self: stretch;
  width: 4px;
  min-height: 0;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-title h2 {
  margin: 0;
}

/* Expertise cards */
.expertise-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 36rem) {
  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.expertise-card {
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.expertise-card-figure {
  margin: 0 0 var(--space-md);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.expertise-card-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--img-shadow);
}

.expertise-card h3 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(0.95rem, 1.5vw + 0.85rem, 1.3rem);
  color: var(--color-accent);
}

.expertise-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* Dark block (Case Studies on home — align with Case Studies landing page layout) */
.section-dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: var(--space-3xl) 0;
}

.section-dark .section-title .accent-line {
  background: var(--color-accent);
}

.section-dark .section-title h2 {
  color: var(--color-text-on-dark);
}

/* Home Case Studies: same layout as landing page — 16:9 image, dark grey placeholder */
.section-dark .project-card-figure {
  background: var(--color-bg-dark);
}

.section-dark .project-card-figure img {
  aspect-ratio: 16 / 9;
}

/* Project card grid — 3 horizontal cards, gradient bodies, rounded corners (Selected work + Projects page) */
.project-card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 36rem) {
  .project-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

.project-card {
  margin: 0;
  padding: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(43, 48, 51, 0.08);
}

.project-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.project-card-link:hover {
  text-decoration: none;
}

/* Image: ~40–45% of card height ratio (4:5 area) */
.project-card-figure {
  margin: 0;
  flex-shrink: 0;
  overflow: visible;
  border-radius: 1.25rem 1.25rem 0 0;
  background: var(--color-border);
}

.project-card-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  display: block;
  border: var(--img-border);
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: var(--img-shadow);
}

.project-card-link:hover .project-card-figure img {
  transform: none;
}

/* Card body: gradient + rounded bottom, with soft overlay blobs */
.project-card-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  min-height: 0;
  overflow: hidden;
  border-radius: 0 0 1.25rem 1.25rem;
}

.project-card-body::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.5;
}

.project-card-body > * {
  position: relative;
  z-index: 1;
}

/* Gradient variants with subtle overlay blobs */
.project-card--blue .project-card-body {
  background: linear-gradient(165deg, #3B7BC9 0%, #2A5A9E 45%, #1e4275 100%);
}

.project-card--blue .project-card-body::before {
  background:
    radial-gradient(ellipse 80% 60% at 85% 15%, rgba(255, 255, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 95%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.project-card--purple .project-card-body {
  background: linear-gradient(165deg, #5B4A8A 0%, #4A3A72 45%, #352858 100%);
}

.project-card--purple .project-card-body::before {
  background:
    radial-gradient(ellipse 80% 60% at 90% 10%, rgba(255, 255, 255, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 5% 90%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
}

.project-card--green .project-card-body {
  background: linear-gradient(165deg, #2D6B5E 0%, #235548 45%, #1a4036 100%);
}

.project-card--green .project-card-body::before {
  background:
    radial-gradient(ellipse 80% 60% at 88% 12%, rgba(255, 255, 255, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 8% 92%, rgba(255, 255, 255, 0.07) 0%, transparent 50%);
}

.project-card--teal .project-card-body {
  background: linear-gradient(165deg, #0D7680 0%, #0A5C65 45%, #07454c 100%);
}

.project-card--teal .project-card-body::before {
  background:
    radial-gradient(ellipse 80% 60% at 90% 15%, rgba(255, 255, 255, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 5% 88%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
}

/* Text: white on gradient */
.project-card-body,
.project-card-body .project-card-category,
.project-card-body .project-card-title,
.project-card-body .project-card-summary,
.project-card-body .project-card-cta {
  color: #ffffff;
}

.project-card-category {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.project-card-title {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  line-height: 1.25;
}

.project-card-summary {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 var(--space-md);
  opacity: 0.92;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-tags {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.project-card-tags li {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.project-card--blue .project-card-tags li { background: rgba(255, 255, 255, 0.22); }
.project-card--purple .project-card-tags li { background: rgba(255, 255, 255, 0.2); }
.project-card--green .project-card-tags li { background: rgba(255, 255, 255, 0.2); }
.project-card--teal .project-card-tags li { background: rgba(255, 255, 255, 0.2); }

.project-card-cta {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: auto;
}

.project-card-link:hover .project-card-cta {
  text-decoration: underline;
}

/* Coming soon cards: placeholder figure, no link hover */
.project-card-figure--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.6);
}

.project-card-placeholder-text {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-card--coming-soon .project-card-link {
  cursor: default;
}

.project-card--coming-soon .project-card-link:hover .project-card-figure img,
.project-card--coming-soon .project-card-link:hover .project-card-cta {
  text-decoration: none;
}

.home-page .project-card--coming-soon .project-card-figure--placeholder {
  background: rgba(0, 0, 0, 0.12);
}

.case-studies-page .project-card--coming-soon .project-card-figure--placeholder {
  background: var(--color-bg-dark);
  color: var(--color-text-muted);
}

/* Home page: case study cards use hero blue gradient (no per-card colors) */
.home-page .project-card .project-card-body {
  background: linear-gradient(135deg, #66C0FC 0%, #3B9EE8 30%, #66C0FC 60%, #8DD4FF 100%);
}

.home-page .project-card .project-card-body::before {
  background:
    radial-gradient(ellipse 80% 60% at 85% 15%, rgba(255, 255, 255, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 95%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.home-page .project-card-tags li {
  background: rgba(255, 255, 255, 0.25);
}

/* Case studies landing page: hero blue background + animation (same as home hero) */
.case-studies-hero {
  position: relative;
  padding-top: 0;
  padding-bottom: var(--space-3xl);
  overflow: hidden;
  min-height: 100vh;
  background: linear-gradient(135deg, #66C0FC 0%, #3B9EE8 30%, #66C0FC 60%, #8DD4FF 100%);
}

.case-studies-hero .hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.case-studies-hero .case-studies-section {
  position: relative;
  z-index: 1;
  padding-top: var(--space-2xl);
}

.case-studies-hero h1,
.case-studies-hero .section-title h2 {
  color: #ffffff;
}

.case-studies-hero .section-title .accent-line {
  background: rgba(255, 255, 255, 0.9);
}

/* Case studies page: white cards (not blue/purple/green) */
.case-studies-page .project-card-body {
  background: #ffffff !important;
}

.case-studies-page .project-card-body::before {
  display: none;
}

.case-studies-page .project-card-body,
.case-studies-page .project-card-category,
.case-studies-page .project-card-title,
.case-studies-page .project-card-summary,
.case-studies-page .project-card-cta {
  color: var(--color-text);
}

.case-studies-page .project-card-category {
  opacity: 0.85;
  color: var(--color-text-muted);
}

.case-studies-page .project-card-cta {
  color: var(--color-accent);
}

.case-studies-page .project-card-tags li {
  background: var(--color-border);
  color: var(--color-text);
}

.case-studies-page .project-card-link:hover .project-card-cta {
  color: var(--color-accent);
}

.case-studies-page .project-card {
  box-shadow: 0 8px 32px rgba(43, 48, 51, 0.15);
}

/* Case studies landing page: 16:9 card ratio + dark grey placeholder (match home Case studies section) */
.case-studies-page .project-card-figure {
  background: var(--color-bg-dark);
}

.case-studies-page .project-card-figure img {
  aspect-ratio: 16 / 9;
}

/* Philosophy strip — bolder gradient circles with subtle animation */
.philosophy-strip {
  position: relative;
  padding: var(--space-3xl) 0;
  overflow: hidden;
  background: #ffffff;
}

.philosophy-strip-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.philosophy-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  background: radial-gradient(circle at center, rgba(118, 199, 253, 0.5) 0%, rgba(118, 199, 253, 0.2) 45%, transparent 70%);
  animation: philosophy-blob-float 14s ease-in-out infinite;
}

/* Coming in from left, right, and bottom (not center) */
.philosophy-blob-1 {
  width: 20rem;
  height: 20rem;
  left: -12rem;
  top: 15%;
  animation-delay: 0s;
}

.philosophy-blob-2 {
  width: 26rem;
  height: 26rem;
  right: -14rem;
  top: 10%;
  animation-delay: -5s;
}

.philosophy-blob-3 {
  width: 18rem;
  height: 18rem;
  left: calc(50% - 9rem);
  bottom: -10rem;
  animation-delay: -9s;
}

@keyframes philosophy-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate(1.5rem, -1rem) scale(1.05); opacity: 1; }
}

.philosophy-strip .container {
  position: relative;
  z-index: 1;
}

.philosophy-strip .philosophy-headline {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
  max-width: var(--content-width);
  line-height: 1.3;
}

.philosophy-strip p {
  max-width: var(--content-width);
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

.philosophy-strip .philosophy-cta {
  font-weight: 600;
  color: var(--color-accent);
}


/* Philosophy page — same background treatment as about/contact (content blobs only) */
.philosophy-page .content-page .container {
  max-width: var(--content-width);
}

/* Content pages — blobs coming in from edges (top/left/right/bottom), placement varies by page */
.content-page-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.content-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  background: radial-gradient(circle at center, rgba(71, 168, 237, 0.55) 0%, rgba(89, 181, 244, 0.35) 40%, transparent 70%);
  animation: content-blob-pulse 8s ease-in-out infinite;
}

.content-blob-1 {
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle at center, rgba(71, 168, 237, 0.6) 0%, rgba(89, 181, 244, 0.3) 45%, transparent 72%);
  animation-delay: 0s;
}

.content-blob-2 {
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle at center, rgba(89, 181, 244, 0.5) 0%, rgba(109, 195, 252, 0.28) 45%, transparent 72%);
  animation-delay: -2s;
}

.content-blob-3 {
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle at center, rgba(109, 195, 252, 0.52) 0%, rgba(118, 199, 253, 0.28) 45%, transparent 72%);
  animation-delay: -4s;
}

/* About: top-left, top-right, bottom */
.about-page .content-blob-1 { left: -10rem; top: -8rem; }
.about-page .content-blob-2 { right: -12rem; top: -6rem; }
.about-page .content-blob-3 { left: 50%; bottom: -10rem; transform: translateX(-50%); }

/* Philosophy: top, bottom-left, bottom-right */
.philosophy-page .content-blob-1 { left: 50%; top: -10rem; transform: translateX(-50%); }
.philosophy-page .content-blob-2 { left: -8rem; bottom: -8rem; }
.philosophy-page .content-blob-3 { right: -10rem; bottom: -6rem; }

/* Contact: left, right, bottom */
.contact-page .content-blob-1 { left: -12rem; top: 15%; }
.contact-page .content-blob-2 { right: -12rem; top: 25%; }
.contact-page .content-blob-3 { left: 40%; bottom: -10rem; }

/* Case studies: top-left, right, bottom */
.case-studies-page .content-blob-1 { left: -10rem; top: -6rem; }
.case-studies-page .content-blob-2 { right: -14rem; top: 20%; }
.case-studies-page .content-blob-3 { left: 60%; bottom: -8rem; }

/* Case study article pages (project-one-page etc.): top-right, bottom-left, top */
.project-one-page .content-blob-1,
.project-two-page .content-blob-1,
.project-three-page .content-blob-1,
.project-four-page .content-blob-1 { right: -10rem; top: -6rem; }
.project-one-page .content-blob-2,
.project-two-page .content-blob-2,
.project-three-page .content-blob-2,
.project-four-page .content-blob-2 { left: -10rem; bottom: -8rem; }
.project-one-page .content-blob-3,
.project-two-page .content-blob-3,
.project-three-page .content-blob-3,
.project-four-page .content-blob-3 { left: 30%; top: -8rem; }

@keyframes content-blob-pulse {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .content-blob {
    animation: none;
    opacity: 0.88;
  }
  .philosophy-blob { animation: none; }
}

/* Content pages (about, contact, philosophy, projects, case studies — all except index and resume) */
.content-page .container {
  max-width: var(--content-width);
}

.content-page .section:first-of-type {
  padding-top: var(--space-2xl);
}

/* Content page lead: title (h1) + section-title (blue bar + h2), aligned with index */
.content-page h1:first-child {
  margin-bottom: var(--space-md);
}

.content-page .section-title {
  margin-top: 0;
  margin-bottom: var(--space-2xl);
}

/* Contact page */
.contact-intro {
  margin-bottom: var(--space-2xl);
}

.contact-details {
  margin-bottom: var(--space-2xl);
}

.contact-details p {
  margin-bottom: var(--space-sm);
}

.contact-form {
  max-width: 32rem;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--color-bg);
}

.form-group textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(118, 199, 253, 0.2);
}

.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
  text-decoration: none;
  color: var(--color-bg);
}

.btn:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Projects list page — card grid uses .project-card-grid above */

/* Case study article */
.article-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-xl);
  font-size: 0.9rem;
  color: var(--color-accent);
}

.back-link:hover {
  text-decoration: none;
}

.case-study-figure {
  margin: 0 0 var(--space-2xl);
  padding: 0;
}

.case-study-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 28rem;
  object-fit: contain;
  border: var(--img-border);
  border-radius: var(--radius-md);
  box-shadow: var(--img-shadow);
  display: block;
  margin: 0;
}

article .section {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

article h2 {
  color: var(--color-accent);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

article h2:first-of-type {
  margin-top: 0;
}

/* Case study pages: max width 1100px, large whitespace */
.case-study-article .container {
  max-width: var(--case-study-max);
}

.case-study-article h1 {
  color: var(--color-accent);
}

.case-study-article .section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.case-study-article .case-study-header {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
}

/* Case study article — project one layout (hero, split, 3-col, before/after, impact) */
.case-study-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
}

.case-study-lead {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  max-width: 50ch;
}

.case-study-hero-figure {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  line-height: 0;
  display: flex;
  justify-content: center;
}

.case-study-hero-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border: var(--img-border);
  border-radius: var(--radius-md);
  box-shadow: var(--img-shadow);
  display: block;
  margin: 0;
}

.case-study-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (min-width: 48rem) {
  .case-study-split {
    grid-template-columns: 1fr 1fr;
  }
}

.case-study-images .case-study-figure {
  margin-bottom: var(--space-lg);
}

.case-study-images .case-study-figure:last-child {
  margin-bottom: 0;
}

.case-study-bullets-wrap {
  padding-top: 0;
}

@media (min-width: 48rem) {
  .case-study-bullets-wrap {
    padding-top: var(--space-md);
  }
}

.case-study-bullets {
  list-style: none;
  margin: 0 0 var(--space-lg);
  padding: 0;
}

.case-study-bullets li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.case-study-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.case-study-statement {
  font-weight: 600;
  margin: 0;
  font-style: italic;
}

.case-study-figure-full img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
  display: block;
  margin: 0;
}

/* Audit image (The system was fighting the user): no border/radius/shadow */
section[aria-labelledby="fighting-heading"] .case-study-figure-full img {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.case-study-three-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-lg);
}

@media (min-width: 48rem) {
  .case-study-three-col {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

.case-study-three-col .case-study-figure {
  height: 12.5rem;
  margin-bottom: 0;
}

.case-study-three-col .case-study-figure img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border: var(--img-border);
  border-radius: var(--radius-md);
  box-shadow: var(--img-shadow);
  display: block;
  margin: 0;
}

.case-study-col h3 {
  font-size: 1.1rem;
  color: var(--color-accent);
  margin: var(--space-md) 0 var(--space-sm);
}

.case-study-col ul {
  margin: 0;
  padding-left: 1.25rem;
}

.case-study-col li {
  margin-bottom: var(--space-xs);
}

.case-study-col p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.case-study-note {
  margin-top: var(--space-2xl);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.case-study-before-after {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: 0;
}

@media (min-width: 48rem) {
  .case-study-before-after {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.case-study-before-after .case-study-figure {
  margin: 0;
  padding: 0 0 2.5rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
  line-height: 0;
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.case-study-before-after .case-study-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border: var(--img-border);
  border-radius: var(--radius-md);
  box-shadow: var(--img-shadow);
  display: block;
  margin: 0;
  vertical-align: top;
}

.case-study-before-after .case-study-figure figcaption {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

.case-study-figure figcaption {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

.case-study-impact {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.case-study-impact-list {
  list-style: none;
  margin: var(--space-2xl) 0 0;
  padding: 0;
}

.case-study-impact-list li {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  padding-left: 1.5rem;
  position: relative;
}

.case-study-impact-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.case-study-impact-list li:last-child {
  margin-bottom: 0;
}

.case-study-steps {
  list-style: none;
  margin: var(--space-xl) 0;
  padding: 0;
  counter-reset: step;
}

.case-study-steps li {
  counter-increment: step;
  padding-left: 2.5rem;
  margin-bottom: var(--space-lg);
  position: relative;
  font-size: 1.15rem;
}

.case-study-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
}

.case-study-steps li:last-child {
  margin-bottom: 0;
}

/* Resume page */
.resume-download {
  margin-bottom: var(--space-xl);
}

.resume-layout {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: var(--space-2xl);
  max-width: 56rem;
}

@media (max-width: 48rem) {
  .resume-layout {
    grid-template-columns: 1fr;
  }
}

.resume-sidebar h3 {
  font-size: 1rem;
  color: var(--color-accent);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.resume-sidebar h3:first-child {
  margin-top: 0;
}

.resume-main h3 {
  font-size: 1rem;
  color: var(--color-text);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.resume-main h3:first-child {
  margin-top: 0;
}

.resume-main .role {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.resume-main .role-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.resume-main ul {
  margin: 0 0 var(--space-lg);
  padding-left: 1.25rem;
}

.resume-main li {
  margin-bottom: var(--space-xs);
}

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

@media print {
  .site-sidebar,
  .back-link,
  .resume-download,
  .nav-list {
    display: none !important;
  }

  .page-wrap {
    padding-right: 0;
  }

  .resume-layout {
    display: block;
  }

  .resume-sidebar {
    margin-bottom: var(--space-xl);
  }

  body {
    font-size: 11pt;
  }
}
