:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --text: #2d2d2d;
  --text-muted: #6b6b6b;
  --border: #e8e5df;
  --accent: #2d2d2d;
  --accent-strong: #1a1a1a;
  --success: #5895a1;
  --card-blue: #D8E8E9;
  --card-yellow: #ffe9b8;
  --card-green: #DAE7DA;
  --card-pink: #F6E5E0;
  --card-purple: #DEE2EF;
  --footer-bg: rgba(45, 45, 45, 1);
  --radius: 8px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

main {
  flex: 1 0 auto;
}

p {
  font-size: 16px;
  line-height: 1.7;
}

.body-default {
  font-size: 16px;
  line-height: 1.7;
}

.body-medium {
  font-size: 14px;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.container {
  width: min(940px, 90vw);
  margin: 0 auto;
}

h1, h2, h3, h4 {
  font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.3;
}

h1 {
  font-size: 44px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 18px;
}

.site-header {
  flex-shrink: 0;
  padding: var(--space-4) 0 var(--space-2);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.nav-list {
  display: flex;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 400;
}

.hero {
  padding: var(--space-6) 0 var(--space-6);
}

.hero h1 {
  margin: 0 0 var(--space-3);
  max-width: 18ch;
  font-weight: 400;
}

.hero-description {
  color: var(--text);
  max-width: 50ch;
  margin-bottom: var(--space-2);
  font-size: 1rem;
  line-height: 1.8;
}

.button-primary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  padding: 0;
  font-weight: 400;
  font-size: 1rem;
}

.button-primary:hover {
  color: var(--accent-strong);
}

.section {
  padding: var(--space-5) 0;
}

/* About: extra breathing room above the footer */
.about.section {
  padding-bottom: var(--space-6);
}

.section-heading {
  margin-bottom: var(--space-5);
}

.section-heading h2,
.about h2 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-weight: 400;
}

.about h3 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  font-weight: 400;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  margin-bottom: var(--space-2);
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Home landing: hero first, then case studies (see home.js: body.js-home, card-grid--visible) */
@keyframes home-hero-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-projects-heading {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-project-card {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.js-home #main-content > .hero {
  opacity: 0;
  animation: home-hero-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.js-home #projects .section-heading {
  opacity: 0;
  animation: home-projects-heading 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.82s;
}

body.js-home #case-study-grid .project-card {
  opacity: 0;
  transform: translateY(28px);
}

body.js-home #case-study-grid.card-grid--visible .project-card {
  animation: home-project-card 0.78s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(1) {
  animation-delay: 0.95s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(2) {
  animation-delay: 1.06s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(3) {
  animation-delay: 1.17s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(4) {
  animation-delay: 1.28s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(5) {
  animation-delay: 1.39s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(6) {
  animation-delay: 1.5s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(7) {
  animation-delay: 1.61s;
}
body.js-home #case-study-grid.card-grid--visible .project-card:nth-child(8) {
  animation-delay: 1.72s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.js-home #main-content > .hero,
  body.js-home #projects .section-heading,
  body.js-home #case-study-grid .project-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  border-radius: var(--radius);
  min-height: 280px;
}

.project-card:nth-child(1) { background: var(--card-blue); }
.project-card:nth-child(2) { background: var(--card-green); }
.project-card:nth-child(3) { background: var(--card-pink); }
.project-card:nth-child(4) { background: var(--card-purple); }
.project-card:nth-child(5) { background: var(--card-purple); }

.project-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card img {
  width: 100%;
  max-width: 100%;
  max-height: 280px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.project-card-content {
  padding: 0;
}

.project-card-content h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-weight: 400;
  line-height: 1.3;
}

.project-card-content p {
  margin-bottom: var(--space-3);
  line-height: 1.7;
  color: var(--text);
}

.project-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.text-link {
  color: var(--text);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 8px;
}

.text-link:hover {
  color: var(--accent-strong);
}

.about-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.about-grid > div {
  width: 100%;
}

.about-image {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.about-intro-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.linkedin-link,
.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
}

.linkedin-link:hover,
.resume-link:hover {
  color: var(--accent-strong);
}

.linkedin-link i,
.resume-link i {
  font-size: 1.25rem;
}

.linkedin-link span,
.resume-link span {
  text-decoration: underline;
  text-underline-offset: 8px;
}

.case-study-layout {
  margin-top: 0;
}

main.section:has(.case-study-layout) {
  padding-top: 0;
}

.case-study-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: 60px 0;
}

.hero-text {
  order: 1;
}

.hero-text .eyebrow {
  margin-bottom: 12px;
}

.hero-text h1 {
  margin: 0 0 12px 0;
}

.hero-text p {
  margin: 0;
}

.hero-image {
  order: 2;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.67rem 2.5rem;
  border: none;
  padding: 0;
  margin: var(--space-4) 0;
}

.fact {
  margin: 0;
}

.fact dt {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.fact dt.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 0.7rem;
}

.fact dt i {
  font-size: 0.85rem;
}

.fact dd {
  margin: 0;
  font-weight: 600;
}

.study-section {
  margin-bottom: 0;
  color: rgba(45, 45, 45, 1);
}

.study-section-snapshot {
  background: #eeeeea;
  border-radius: 10px;
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

/* Trim trailing margins so vertical padding of the card matches top/bottom rhythm */
.study-section-snapshot .subsection:last-child > p:last-child {
  margin-bottom: 0;
}

.study-section-snapshot .subsection:last-child .user-feedback:last-child {
  margin-bottom: 0;
}

.case-study-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-4);
  margin: 0;
  background: #ebf0f5;
  border: 1px solid #5b7a9d;
  border-radius: var(--radius);
}

.case-study-notice__icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #5b7a9d;
}

.case-study-notice__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}

.case-study-layout > .container {
  margin-bottom: var(--space-6);
}

.case-study-layout > .container:last-child {
  margin-bottom: 0;
}

.case-study-next-wrap .case-study-next {
  margin: var(--space-5) 0 0;
}

.case-study-layout > .container.case-study-next-wrap:last-child .case-study-next {
  margin-bottom: 0;
}

.study-section h2 {
  margin-top: 0;
}

.study-section > h3 {
  margin-bottom: var(--space-3);
}

.study-section > p {
  margin-top: 0;
  margin-bottom: 0;
}

.study-section > p + p {
  margin-top: var(--space-3);
}

.study-section > p + h3 {
  margin-top: var(--space-5);
}

.study-section h3 + p {
  margin-bottom: 0;
}

.study-section ul {
  margin: var(--space-2) 0;
  padding-left: 1.5rem;
  line-height: 1.7;
}

.study-section ul li {
  margin-bottom: var(--space-2);
}

.study-section ul li:last-child {
  margin-bottom: 0;
}

.findings-list {
  list-style: none;
  padding-left: 0;
}

.findings-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: var(--space-3);
}

.findings-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text);
  font-weight: bold;
}

.findings-list li strong {
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 600;
}

.discovery-layout {
  /* Container for text wrapping layout */
}

.discovery-layout::after {
  content: "";
  display: table;
  clear: both;
}

.key-findings-section {
  /* Key findings section with floated image */
}

.key-findings-section::after {
  content: "";
  display: table;
  clear: both;
}

.core-questions-section {
  clear: both;
}

.core-questions-section p {
  margin-bottom: 0 !important;
}

.core-questions-section h3 + p {
  margin-bottom: var(--space-2) !important;
}

.discovery-image {
  float: right;
  width: 45%;
  margin-left: var(--space-4);
  margin-bottom: var(--space-3);
}

.discovery-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.image-caption {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  color: rgba(107, 107, 107, 1);
  text-align: center;
  font-style: italic;
}

.section-image {
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.section-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.section-image--half {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
}

.section-image--half .image-caption {
  max-width: 100%;
}

.section-image--two-thirds {
  max-width: 66%;
  margin-left: auto;
  margin-right: auto;
}

.section-image--two-thirds .image-caption {
  max-width: 100%;
}

.section-image--three-quarters {
  max-width: 75%;
  margin-left: auto;
  margin-right: auto;
}

.section-image--three-quarters .image-caption {
  max-width: 100%;
}

.content-with-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-4);
}

/* ~33% track for imagery; text column absorbs remaining (~67%) space */
.content-with-image--narrow-image-leading {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.content-with-image--narrow-image-trailing {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.content-with-image--narrow-image-leading .section-image img,
.content-with-image--narrow-image-trailing .section-image img {
  border: 1px solid #6b6b6b;
}

.content-with-image .section-image {
  margin-top: 0;
}

.content-with-image .section-video {
  margin-top: 0;
  margin-bottom: 0;
}

.content-with-image > div > p:not(.video-label):not(.image-caption) {
  margin: 0;
  color: rgba(45, 45, 45, 1);
}

.content-with-image > div > p:not(.video-label):not(.image-caption) + p:not(.video-label):not(.image-caption) {
  margin-top: var(--space-3);
}

.case-study-muted-paragraph {
  color: rgba(45, 45, 45, 1);
}

.content-with-image .video-label {
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.two-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: 0;
}

.two-images-grid--bordered-images .section-image img {
  border: 1px solid #6b6b6b;
}

.section-video {
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-video--half {
  max-width: 37.5%;
  margin-left: 0;
  margin-right: auto;
}

.video-label {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.section-video video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #000;
  display: block;
  background: #000;
}

.video-description {
  margin-top: var(--space-3);
  line-height: 1.7;
  color: var(--text);
}

.study-section:last-child {
  margin-bottom: 0;
}

.subsection {
  margin-bottom: var(--space-4);
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection h3 {
  margin-top: 0;
  margin-bottom: var(--space-1);
}

.subsection p {
  margin-top: 0;
  margin-bottom: 0;
}

.subsection p + p {
  margin-top: var(--space-3);
}

.metrics-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(222, 234, 236, 1);
  border: none;
  border-radius: 20px;
  padding: 8px 16px 8px 12px;
  font-size: 0.9rem;
  color: var(--text);
}

.metric-chip i {
  color: var(--success);
  font-size: 20px;
}

.user-feedback {
  margin: var(--space-4) 0 var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--success);
  border-radius: 6px;
  position: relative;
}

.user-feedback .quote-icon {
  color: var(--success);
  font-size: 1.25rem;
  opacity: 0.3;
  margin-bottom: var(--space-2);
}

.user-feedback p {
  margin: 0;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
}

.session-traffic-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}

.session-traffic-title {
  margin: 0;
  text-align: center;
  width: 100%;
  max-width: 360px;
}

.content-with-image.session-traffic-block {
  align-items: start;
  margin-top: var(--space-3);
}

.content-with-image.session-traffic-block .session-traffic-list {
  margin: 0;
  width: 100%;
  max-width: 360px;
}

.session-traffic-list {
  margin: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
}

.traffic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.traffic-label {
  font-size: 16px;
  color: var(--text);
  font-weight: 400;
}

.traffic-percentage {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  min-width: 60px;
  text-align: center;
}

.site-footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  color: #ffffff;
  margin-top: calc(3 * var(--space-5));
  padding: var(--space-6) 0;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  text-align: center;
}

.footer-inner p {
  color: #999999;
}

.footer-inner a {
  color: #ffffff;
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .nav-list {
    gap: var(--space-3);
    font-size: 0.9rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .case-study-layout {
    padding: var(--space-4);
  }
  
  .hero h1 {
    max-width: 100%;
  }

  .case-study-hero {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-4) 0;
  }

  .hero-text {
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .quick-facts {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .key-findings-section {
    display: flex;
    flex-direction: column;
  }
  
  .key-findings-section h4 {
    order: 1;
  }
  
  .discovery-image {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: var(--space-3);
    order: 3;
  }
  
  .key-findings-section .findings-list {
    order: 2;
  }

  .content-with-image {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .content-with-image--narrow-image-leading,
  .content-with-image--narrow-image-trailing {
    grid-template-columns: 1fr;
  }

  .session-traffic-aside {
    align-items: stretch;
  }

  .session-traffic-aside .session-traffic-title {
    text-align: center;
    max-width: none;
  }

  .content-with-image.session-traffic-block .session-traffic-list {
    max-width: none;
  }

  .section-video--half {
    max-width: 100%;
  }

  .two-images-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .section-image--half {
    max-width: 100%;
  }

  .section-image--two-thirds {
    max-width: 100%;
  }

  .section-image--three-quarters {
    max-width: 100%;
  }
}
