/* ========================================
   Design System — UX Portfolio
   ======================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;600;700&display=swap');

/* ---------- Custom Properties ---------- */
:root {
  /* Palette */
  --bg:          #FFFFFF;
  --bg-card:     #F9FAFB;
  --text:        #111827;
  --text-muted:  #6B7280;
  --accent:      #7B61FF;
  --accent-hover:#6D28D9;
  --accent-light:#F3F4F6;
  --border:      #E5E7EB;
  --surface:     #F9FAFB;

  /* Hybrid data-viz accents (used sparingly for stats, insight markers, tokens) */
  --accent-teal:  #14B8A6;
  --accent-amber: #F59E0B;
  --accent-coral: #FB7185;
  --accent-blue:  #3B82F6;

  /* Typography */
  --font-primary: 'Inter', sans-serif;
  --font-meta:    'Roboto Mono', monospace;

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

  /* Layout */
  --max-width:   1200px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   24px;

  /* Transitions */
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration:    0.3s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--duration) var(--ease);
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.meta-text {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

p {
  color: var(--text-muted);
}

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

section {
  padding: var(--space-3xl) 0;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247, 247, 248, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-family: var(--font-meta);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav__links {
  display: flex;
  gap: var(--space-xl);
}

.nav__links a {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--duration) var(--ease);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--duration) var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  padding-top: calc(64px + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  min-height: 90vh;
  display: flex;
  align-items: center;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: 100px;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero__badge span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  margin-bottom: var(--space-lg);
  color: var(--text);
}

.hero__subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--text);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--text);
  transition: all var(--duration) var(--ease);
}

.hero__cta:hover {
  background: transparent;
  color: var(--text);
  transform: scale(0.98);
}

.hero__cta svg {
  transition: transform var(--duration) var(--ease);
}

.hero__cta:hover svg {
  transform: translateX(4px);
}

.hero__visual {
  position: relative;
}

.hero__visual img {
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hero__visual::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: var(--accent-light);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.6;
}

.hero__visual::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 180px;
  height: 180px;
  background: linear-gradient(135deg, var(--accent-light), transparent);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.4;
}

/* ---------- Mini Hero (name intro) ---------- */
.hero-mini {
  padding-top: calc(64px + var(--space-3xl));
  padding-bottom: var(--space-2xl);
  overflow: hidden;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.status-pill__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.status-pill__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: status-pulse 2.2s ease-out infinite;
}

@keyframes status-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .status-pill__dot::after {
    animation: none;
    display: none;
  }
}

.hero-mini__greeting {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.hero-mini__name {
  font-size: clamp(2.2rem, 4.5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

.hero-mini__bio {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 900px;
  margin-bottom: var(--space-2xl);
  min-height: 3em;
}

.hero-mini__bio .hero-mini__link {
  color: var(--accent);
  font-weight: 500;
}

.hero-mini__cta-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 1rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
}

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

.btn-ghost svg {
  transition: transform var(--duration) var(--ease);
}

.btn-ghost:hover svg {
  transform: translateX(4px);
}

/* Typewriter cycling phrase in hero bio.
   min-width reserves space for the longest cycled phrase ("creative expression")
   so shorter/partially-typed phrases don't change where the paragraph wraps. */
.hero-typewriter {
  display: inline-block;
  min-width: 21ch;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.hero-typewriter--muted {
  color: var(--text-muted);
  font-weight: 400;
}

.hero-typewriter--muted .hero-typewriter__cursor {
  background: var(--text-muted);
}

.hero-typewriter__cursor {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.1em;
  animation: hero-caret-blink 1s step-end infinite;
}

@keyframes hero-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-typewriter__cursor {
    animation: none;
  }
}

/* Confetti burst (e.g. on the contact page email link) */
.confetti-particle {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 9998;
  animation: confetti-burst 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes confetti-burst {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx1, 0), var(--ty1, 0)) rotate(var(--rot, 180deg)); opacity: 0; }
}

.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;
}

.hero-mini__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: var(--space-lg);
}

.hero-mini__meta h4 {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.hero-mini__meta p {
  font-size: 1rem;
  color: var(--text);
}

.hero-mini__meta a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 768px) {
  .hero-mini {
    padding-top: calc(64px + var(--space-2xl));
  }
  .hero-mini__meta {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-family: var(--font-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.section-header a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.section-header a:hover {
  color: var(--accent-hover);
}

/* ---------- Project Cards ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.project-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-card__image img {
  transform: scale(1.03);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.06), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.project-card:hover .project-card__overlay {
  opacity: 1;
}

.project-card__body {
  padding: var(--space-lg);
}

.project-card__tags {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.project-card__tag {
  font-family: var(--font-meta);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 100px;
}

.project-card__title {
  margin-bottom: var(--space-sm);
  color: var(--text);
  transition: color var(--duration) var(--ease);
}

.project-card:hover .project-card__title {
  color: var(--accent);
}

.project-card__desc {
  font-size: 0.9rem;
  line-height: 1.6;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.project-card__link svg {
  transition: transform var(--duration) var(--ease);
}

.project-card:hover .project-card__link svg {
  transform: translateX(4px);
}

.project-card__peek {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--text);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  pointer-events: none;
}

.project-card:hover .project-card__peek {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Non-photo project thumbnail (design tokens preview) ---------- */
.thumb-tokens {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-light) 0%, #EEF0FC 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  transition: transform 0.5s var(--ease);
}

.project-card:hover .thumb-tokens {
  transform: scale(1.03);
}

.thumb-tokens__swatches {
  display: flex;
  gap: 10px;
}

.thumb-tokens__swatches span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12);
}

.thumb-tokens__type {
  font-family: var(--font-primary);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.thumb-tokens__btns {
  display: flex;
  gap: 10px;
}

.thumb-tokens__btns span {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-meta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.thumb-tokens__btn-primary {
  background: var(--accent);
  color: #fff;
}

.thumb-tokens__btn-ghost {
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-3xl);
}

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

.footer-main p {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.footer-main h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.footer-main h2 a {
  color: var(--accent);
}

.footer-main .credit {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col h4 {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-col ul a {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.footer-col ul a:hover {
  color: var(--accent);
}

/* ========================================
   Case Study Page
   ======================================== */

.case-hero {
  padding-top: calc(64px + var(--space-3xl));
  padding-bottom: var(--space-2xl);
}

.case-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  transition: color var(--duration) var(--ease);
}

.case-hero__back:hover {
  color: var(--accent);
}

.case-hero__tags {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.case-hero h1 {
  margin-bottom: var(--space-lg);
}

.case-hero p {
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 700px;
}

/* TLDR Summary */
.tldr {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}

.tldr__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.tldr__item h4 {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.tldr__item p {
  font-size: 0.95rem;
  color: var(--text);
}

/* Case Study Sections */
.case-section {
  padding: var(--space-2xl) 0;
}

.case-section h2 {
  margin-bottom: var(--space-lg);
}

.case-section p {
  margin-bottom: var(--space-md);
}

.case-section img {
  margin: var(--space-xl) 0;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.case-section ul {
  padding-left: var(--space-lg);
  list-style: disc;
}

.case-section li {
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* Case nav */
.case-nav {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.case-nav .container {
  display: flex;
  justify-content: space-between;
}

.case-nav a {
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.case-nav a:hover {
  color: var(--accent-hover);
}

/* Case download CTA */
.case-download {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.case-download__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
  padding: var(--space-xl);
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.case-download__card h3 {
  margin-bottom: 4px;
}

.case-download__card p {
  margin: 0;
  color: var(--text-muted);
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease);
}

.app-store-badge:hover {
  transform: translateY(-2px);
}

.app-store-badge svg {
  flex-shrink: 0;
}

.app-store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-store-badge small {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
}

.app-store-badge strong {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-primary);
}

/* ========================================
   Custom Cursor
   ======================================== */
.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--accent);
  transition: opacity 0.2s var(--ease), background-color 0.25s var(--ease);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.35s var(--ease),
    height 0.35s var(--ease),
    margin 0.35s var(--ease),
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    opacity 0.2s var(--ease);
}

.cursor-dot.is-visible,
.cursor-ring.is-visible {
  opacity: 1;
}

/* Interactive hover — links, buttons, form fields, project cards, lightbox triggers */
.cursor-ring.is-hover {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  background: var(--accent-light);
}

/* Dark surfaces (e.g. solid dark buttons) — invert to white for contrast */
.cursor-ring.is-inverted {
  border-color: #fff;
}

.cursor-dot.is-inverted {
  background: #fff;
}

/* Pressed feedback */
.cursor-ring.is-active {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
}

/* Never show the custom cursor on touch/coarse-pointer devices */
@media (hover: none), (pointer: coarse) {
  .has-custom-cursor,
  .has-custom-cursor * {
    cursor: auto !important;
  }
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-ring,
  .cursor-dot {
    transition-duration: 0.05s;
  }
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__visual {
    max-width: 600px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    gap: var(--space-md);
  }

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

  .hero {
    min-height: auto;
    padding-top: calc(64px + var(--space-2xl));
  }

  .tldr__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer .container {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ========================================
   Case Study Layout (Sidebar)
   ======================================== */
.case-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-3xl);
  padding: var(--space-3xl) 0;
  align-items: start;
}

.case-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.case-sidebar a {
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--duration), border-color var(--duration);
}

.case-sidebar a[href^="#"] {
  padding-left: var(--space-md);
  border-left: 2px solid transparent;
}

.case-sidebar a:hover,
.case-sidebar a.active {
  color: var(--text);
  font-weight: 600;
}

.case-sidebar a[href^="#"].active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.case-content-section {
  margin-bottom: var(--space-3xl);
  scroll-margin-top: 100px;
}

.case-content-section h3 {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.case-content-section h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

.case-content-section p {
  margin-bottom: var(--space-md);
  max-width: 800px;
}

@media (max-width: 768px) {
  .case-layout {
    grid-template-columns: 1fr;
  }
  .case-sidebar {
    display: none;
  }
}

/* ========================================
   Case Study — Big Top Mockup
   ======================================== */
.case-mockup-section {
  padding-top: calc(64px + var(--space-2xl));
  padding-bottom: var(--space-xl);
}

.case-mockup-section .case-hero__back {
  margin-bottom: var(--space-xl);
}

.case-mockup {
  position: relative;
  background: linear-gradient(135deg, var(--accent-light) 0%, #EEF0FC 45%, var(--accent-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.case-mockup__main {
  max-width: 620px;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(17, 24, 39, 0.16), 0 4px 14px rgba(17, 24, 39, 0.06);
  position: relative;
  z-index: 2;
  margin: 0;
}

.case-mockup__float {
  position: absolute;
  width: 260px;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.18);
  z-index: 3;
  margin: 0;
}

.case-mockup__float--br {
  bottom: -28px;
  right: 6%;
  transform: rotate(-2deg);
}

.case-mockup__float--br:hover {
  transform: rotate(-2deg) translateY(-4px);
}

/* Custom-built (non-photo) mockup, e.g. design tokens */
.case-mockup__built {
  width: 100%;
  max-width: 680px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(17, 24, 39, 0.16), 0 4px 14px rgba(17, 24, 39, 0.06);
  padding: var(--space-xl);
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .case-mockup {
    min-height: 260px;
    padding: var(--space-lg);
  }
  .case-mockup__float {
    display: none;
  }
}

/* Title block that follows the mockup */
.case-title-block {
  padding-top: var(--space-2xl);
}

.case-title-block h1 {
  margin-bottom: var(--space-lg);
}

.case-title-block p {
  font-size: 1.25rem;
  line-height: 1.7;
  max-width: 760px;
  color: var(--text-muted);
}

/* Meta grid (role / timeline / team / tools) */
.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}

.case-meta-item h4 {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.case-meta-item p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .case-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* HMW / pull quote */
.hmw-quote {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  max-width: 780px;
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 3px solid var(--accent);
  font-style: italic;
}

/* Methods / Key Insights two-column grid */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  max-width: 800px;
}

.insights-grid h3 {
  font-family: var(--font-primary);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.insights-grid ol {
  list-style: none;
  padding-left: 0;
  counter-reset: insight;
}

.insights-grid li {
  position: relative;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
  padding-left: 2.1rem;
  counter-increment: insight;
}

.insights-grid li::before {
  content: counter(insight);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-meta);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
}

.insights-grid:nth-of-type(1) li:nth-child(4n+1)::before { background: var(--accent); }
.insights-grid li:nth-child(4n+2)::before { background: var(--accent-teal); }
.insights-grid li:nth-child(4n+3)::before { background: var(--accent-amber); }
.insights-grid li:nth-child(4n+4)::before { background: var(--accent-coral); }

@media (max-width: 768px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

/* Architecture / system diagram (inline SVG) */
.arch-diagram {
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.arch-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.arch-diagram__caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
  max-width: none;
}

/* Captioned image gallery (3-up by default, 2-up variant) */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.media-gallery--2 {
  grid-template-columns: repeat(2, 1fr);
}

.media-gallery__item img,
.media-gallery__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  display: block;
  margin-bottom: var(--space-sm);
}

.media-gallery__item img {
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.media-gallery__placeholder {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: var(--space-md);
  display: flex;
}

.media-gallery__item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.media-gallery__item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 768px) {
  .media-gallery,
  .media-gallery--2 {
    grid-template-columns: 1fr;
  }
}

/* Testimonial grid */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl) var(--space-xl);
  margin: var(--space-xl) 0;
}

.testimonial {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.testimonial__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.6rem;
  text-align: center;
  overflow: hidden;
}

.testimonial__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.testimonial p {
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.testimonial strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.testimonial span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .testimonial-grid {
    grid-template-columns: 1fr;
  }
}

/* Survey / interview results (question + bar comparison) */
.survey-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl) var(--space-xl);
  margin: var(--space-xl) 0;
}

.survey-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.survey-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.survey-bar-track {
  flex: 1;
  height: 34px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.survey-bar-fill {
  height: 100%;
  min-width: fit-content;
  display: flex;
  align-items: center;
  padding: 0 var(--space-sm);
  font-family: var(--font-meta);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

.survey-bar-fill--accent {
  background: var(--accent);
  color: #fff;
}

.survey-bar-fill--muted {
  background: var(--border);
  color: var(--text);
}

.survey-bar-count {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 18px;
  text-align: right;
}

@media (max-width: 768px) {
  .survey-grid {
    grid-template-columns: 1fr;
  }
}

/* Data table (e.g. competitive analysis) */
.data-table-wrap {
  overflow-x: auto;
  margin: var(--space-xl) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 640px;
}

.data-table th {
  text-align: left;
  font-family: var(--font-meta);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.55;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table td:first-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Outline-style brainstorm box */
.brainstorm-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background: #fff;
}

.brainstorm-box h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.brainstorm-box ol {
  color: var(--text-muted);
  padding-left: 1.3em;
  line-height: 1.7;
}

.brainstorm-box ol ol {
  margin: var(--space-xs) 0 var(--space-sm);
}

.wf-group-label {
  font-family: var(--font-meta);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xl) 0 var(--space-md);
}

.wf-group-label:first-of-type {
  margin-top: var(--space-md);
}

/* Horizontal scroll gallery */
.screens-row {
  display: flex;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.screens-row img {
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  margin: 0;
}

/* Wireframe / Hi-Fi toggle */
.wf-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0 var(--space-lg);
}

.wf-toggle__btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.wf-toggle__btn:hover {
  color: var(--text);
}

.wf-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.wf-grid {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  margin: 0 0 var(--space-xl);
}

.wf-grid.is-active {
  display: grid;
}

.wf-frame {
  aspect-ratio: 393 / 852;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.wf-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.wf-frame img[data-lightbox] {
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.wf-frame img[data-lightbox]:hover {
  transform: scale(1.03);
}

.wf-frame--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border);
  background: var(--surface);
  box-shadow: none;
}

.wf-frame--placeholder span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  padding: var(--space-sm);
}

@media (max-width: 900px) {
  .wf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .wf-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }
}

/* Final-design feature blocks */
.feature-block {
  margin-bottom: var(--space-3xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  max-width: 100%;
}

.feature-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-meta);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--num-color, var(--accent));
}

.feature-block__body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 460px;
  padding-top: 2px;
}

/* Text-only feature blocks (no accompanying media) can use the full
   content width so the paragraph wraps into fewer, shorter lines. */
.feature-block--wide .feature-block__body {
  max-width: 720px;
}

.feature-block h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-primary);
}

.feature-block .feature-lead {
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.feature-block p {
  margin-bottom: 0;
}

.feature-block__media {
  flex-shrink: 0;
  width: 240px;
  margin-left: auto;
}

.feature-block__media img {
  width: 100%;
  display: block;
  margin: 0;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.feature-block__media img:hover {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .feature-block__body {
    max-width: none;
  }

  .feature-block__media {
    width: 200px;
  }
}

/* Impact / outcome stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
  max-width: 800px;
}

.stat-row .stat {
  border-top: 2px solid var(--stat-color, var(--accent));
  padding-top: var(--space-sm);
}

.stat-row .stat .stat-num {
  display: block;
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 700;
  color: var(--stat-color, var(--accent));
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-row .stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Reflection list */
.reflection-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin-top: var(--space-md);
  max-width: 800px;
}

.reflection-list li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

.reflection-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 768px) {
  .feature-block {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .feature-block__media {
    width: 100%;
    max-width: 260px;
    margin-left: calc(2.25rem + var(--space-lg));
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  background: rgba(10, 10, 15, 0.92);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lightbox.is-open .lightbox__img {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__caption {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  text-align: center;
  max-width: 80vw;
}

@media (max-width: 600px) {
  .lightbox {
    padding: var(--space-xl) var(--space-md);
  }
}

/* ===== Last.fm "What I'm Listening To" widget ===== */
.lastfm-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.lastfm-widget__title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-meta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.lastfm-widget__empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lastfm-track {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.lastfm-track:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.lastfm-track:first-child {
  padding-top: 0;
}

.lastfm-track:hover {
  opacity: 0.7;
}

.lastfm-track__art {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-light);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.lastfm-track__meta {
  flex: 1;
  min-width: 0;
}

.lastfm-track__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.lastfm-track__artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.lastfm-track__time {
  font-family: var(--font-meta);
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.lastfm-track--playing .lastfm-track__time {
  color: #1DB954;
}

.lastfm-track__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1DB954;
  display: inline-block;
  animation: lastfm-pulse 1.5s ease-in-out infinite;
}

@keyframes lastfm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
