/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg: #faf9f6;
  --bg-alt: #f2f0ea;
  --bg-card: #ffffff;
  --text: #1c1c1e;
  --text-dim: #5b5b60;
  --text-faint: #8f8e93;
  --border: rgba(28, 28, 30, 0.09);
  --border-strong: rgba(28, 28, 30, 0.16);

  --shadow-lift: 0 1px 2px rgba(28, 28, 30, 0.04), 0 12px 28px -12px rgba(28, 28, 30, 0.14);

  --accent-fintech: #4361ee;
  --accent-ds: #7c5cd6;
  --accent-food: #2f9e5b;
  --accent-health: #e2672e;
  --accent-other: #64748b;
  --accent: var(--accent-fintech);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

.theme-fintech { --accent: var(--accent-fintech); }
.theme-ds { --accent: var(--accent-ds); }
.theme-food { --accent: var(--accent-food); }
.theme-health { --accent: var(--accent-health); }
.theme-other { --accent: var(--accent-other); }

/* Dark blocks — hero and footer, homepage only */
.hero,
.site-footer {
  --bg: #121218;
  --bg-alt: #1b1b22;
  --bg-card: #1e1e26;
  --text: #f7f6f3;
  --text-dim: #b7b6bd;
  --text-faint: #83828b;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
  background: var(--bg);
  color: var(--text);
}

body.home .site-header:not(.scrolled) .logo {
  color: #fff;
}
body.home .site-header:not(.scrolled) .main-nav a {
  color: rgba(255, 255, 255, 0.72);
}
body.home .site-header:not(.scrolled) .main-nav a:hover,
body.home .site-header:not(.scrolled) .main-nav a.active {
  color: #fff;
}
body.home .site-header:not(.scrolled) .nav-toggle span {
  background: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.main-nav {
  display: flex;
  gap: 32px;
  font-size: 0.92rem;
}

.main-nav a {
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px var(--gutter) 80px;
  position: relative;
  overflow-x: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: center;
}

.hero-photo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 24px 76px 40px;
}

.hero-photo {
  display: flex;
  justify-content: center;
}
.hero-photo img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(28, 28, 30, 0.16));
  position: relative;
  z-index: 1;
}

.orbit-badge {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow-lift);
  color: var(--text-dim);
  white-space: nowrap;
  z-index: 2;
  cursor: default;
  opacity: 0;
  scale: 0.4;
  animation: badge-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both, badge-float 3.6s ease-in-out infinite;
  animation-delay: var(--d), calc(var(--d) + 0.55s);
  transition: scale 0.25s ease, box-shadow 0.25s ease;
}
.orbit-badge:hover {
  scale: 1.1;
  box-shadow: 0 4px 16px rgba(28, 28, 30, 0.18);
}

@keyframes badge-pop {
  from { opacity: 0; scale: 0.4; }
  to { opacity: 1; scale: 1; }
}
@keyframes badge-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-badge { animation: none; opacity: 1; scale: 1; }
}

.hero-tagline {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  max-width: 16ch;
  margin-top: 28px;
}

.hero-roles {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.role-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  color: var(--text-dim);
}

.hero-sub {
  margin-top: 28px;
  max-width: 52ch;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scroll-cue::after {
  content: '';
  width: 24px; height: 1px;
  background: var(--text-faint);
  animation: pulse-line 1.8s ease-in-out infinite;
}
@keyframes pulse-line {
  0%, 100% { transform: scaleX(1); opacity: 0.4; }
  50% { transform: scaleX(1.6); opacity: 1; }
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section {
  padding: 120px var(--gutter);
}
.section-head {
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 16px;
}

/* ============================================================
   Work grid
   ============================================================ */
.work-grid {
  display: grid;
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
}

.work-card {
  background: var(--bg);
  padding: 48px clamp(24px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease;
}
.work-card:hover { background: var(--bg-alt); }

.work-card-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.work-card-title {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  margin-top: 10px;
}

.work-card-sub {
  color: var(--text-dim);
  margin-top: 12px;
  font-size: 1rem;
  max-width: 40ch;
}

.work-card-tags {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}

.work-card-visual {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lift);
  position: relative;
  z-index: 1;
}

.work-card-arrow {
  position: absolute;
  top: 40px; right: clamp(24px, 4vw, 56px);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow-lift);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  z-index: 2;
}
.work-card:hover .work-card-arrow {
  transform: rotate(45deg);
  background: var(--card-accent, var(--accent));
  border-color: var(--card-accent, var(--accent));
  color: #fff;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.about-quote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  line-height: 1.35;
}
.about-body {
  color: var(--text-dim);
  font-size: 1.02rem;
}
.about-body + .about-body { margin-top: 20px; }

.skills-list {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   Footer / Contact
   ============================================================ */
.site-footer {
  padding: 100px var(--gutter) 48px;
  border-top: 1px solid var(--border);
}
.contact-title {
  font-size: clamp(2rem, 6vw, 3.6rem);
  max-width: 16ch;
}
.contact-links {
  margin-top: 40px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.contact-link {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-link:hover { border-color: var(--text); color: var(--accent); }
.contact-link.disabled {
  color: var(--text-faint);
  border-bottom-style: dashed;
  cursor: default;
}
.footer-bottom {
  margin-top: 80px;
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   Case study pages
   ============================================================ */
.case-hero {
  padding: 150px var(--gutter) 60px;
  border-bottom: 1px solid var(--border);
}
.case-hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin-top: 20px;
  max-width: 20ch;
}
.case-hero-sub {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 46ch;
}

.case-meta {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.case-meta dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.case-meta dd {
  margin: 8px 0 0;
  font-size: 0.98rem;
}

.case-section {
  padding: 90px var(--gutter);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 56px;
}
.case-section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-section-label span {
  display: block;
  color: var(--text-faint);
  margin-top: 6px;
  font-size: 0.75rem;
}
.case-section-body h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  margin-bottom: 20px;
}
.case-section-body p {
  color: var(--text-dim);
  font-size: 1.02rem;
}
.case-section-body p + p { margin-top: 16px; }
.case-section-body ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.case-section-body li {
  color: var(--text-dim);
  padding-left: 22px;
  position: relative;
  font-size: 1.02rem;
}
.case-section-body li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.result-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lift);
}
.result-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent);
}
.result-stat span {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 6px;
  display: block;
}

/* Mockup placeholders */
.mockup-row {
  padding: 90px var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.mockup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  aspect-ratio: 9 / 16;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.mockup.mockup-photo {
  aspect-ratio: auto;
}
.mockup.mockup-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.mockup-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 12px;
}

/* Mockup placeholder building blocks — generic stand-ins for real UI screenshots */
.mockup-inner {
  position: absolute;
  inset: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mockup-status {
  height: 6px;
  width: 40%;
  border-radius: 4px;
  background: var(--border-strong);
}
.mockup-card {
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.mockup-card.tall { flex: 1; }
.mockup-card.short { height: 56px; }
.mockup-row-flex { display: flex; gap: 10px; flex: 1; }
.mockup-row-flex > * { flex: 1; }
.mockup-dot-row { display: flex; gap: 8px; }
.mockup-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.mockup-line {
  height: 8px;
  border-radius: 4px;
  background: var(--border-strong);
}
.mockup-line.w60 { width: 60%; }
.mockup-line.w40 { width: 40%; }
.mockup-line.w80 { width: 80%; }
.mockup-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}
.mockup-silhouette {
  flex: 1;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mockup-silhouette svg { width: 46%; opacity: 0.85; }
.mockup-card--photo {
  background-size: cover;
  background-repeat: no-repeat;
  border-color: var(--border);
}

.case-nav {
  padding: 70px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.case-nav a {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}
.case-nav .dir {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ============================================================
   Activity page
   ============================================================ */
.activity-group {
  padding: 60px var(--gutter);
  border-bottom: 1px solid var(--border);
}
.activity-group h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.activity-list {
  margin-top: 32px;
  display: grid;
  gap: 28px;
}
.activity-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}
.activity-item-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.activity-item-title {
  font-size: 1.1rem;
}
.activity-item-desc {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: 0.98rem;
}

/* ============================================================
   Activity photo gallery
   ============================================================ */
.activity-gallery {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.activity-gallery img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo-wrap { order: -1; padding: 16px 44px 32px; }
  .hero-photo img { max-width: 330px; }
  .orbit-badge { font-size: 0.68rem; padding: 7px 12px; }
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: flex;
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-alt);
    flex-direction: column;
    padding: 120px 32px 32px;
    gap: 24px;
    font-size: 1.1rem;
    border-left: 1px solid var(--border);
  }
  .work-card { grid-template-columns: 1fr; }
  .work-card-visual { order: -1; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .case-section { grid-template-columns: 1fr; gap: 24px; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .activity-item { grid-template-columns: 1fr; gap: 8px; }
  .case-nav { flex-direction: column; gap: 24px; align-items: flex-start; }
}
