:root {
  --ui-accent: #ff5c35;
  --ui-shadow: 0 18px 45px -30px rgba(29, 29, 27, .38);
  --ui-shadow-hover: 0 26px 58px -30px rgba(29, 29, 27, .5);
  --ui-radius: 22px;
  --ui-radius-sm: 14px;
  --max: 1120px;
}

html[data-theme="light"] {
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #ebeae6;
  --text: #1d1d1b;
  --muted: #696966;
  --border: #d9d8d3;
}

html[data-theme="dark"] {
  --bg: #181816;
  --surface: #232320;
  --surface-2: #2b2b27;
  --text: #f4f3ef;
  --muted: #aaa9a2;
  --border: #3a3a35;
}

body {
  background: var(--bg);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

h1, h2, h3, .brand {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

body > .container:first-child {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

body > .container:first-child nav {
  width: min(var(--max), calc(100% - 64px));
  padding: 16px 0;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
}

.nav-links {
  gap: 5px;
  font-size: .82rem;
  font-weight: 600;
}

.nav-links a {
  padding: 8px 11px;
  border-radius: 999px;
}

.nav-links a:hover { background: var(--surface); }

.nav-links a.resume-btn,
.btn-pill.btn-primary,
.btn {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 999px;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .7);
}

.theme-toggle,
.menu-toggle {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 7px 16px -14px rgba(0, 0, 0, .6);
}

main.container {
  width: min(var(--max), calc(100% - 64px));
  margin: 24px auto 0;
  overflow: visible;
}

.hero {
  width: 100%;
  margin: 0;
  padding: clamp(42px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--ui-shadow);
}

.hero .eyebrow,
.eyebrow {
  color: var(--ui-accent);
  font-family: "DM Sans", ui-sans-serif, sans-serif;
  letter-spacing: .11em;
}

.hero .eyebrow {
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 18%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent) 8%, var(--surface));
}

h1 { font-weight: 650; }
h2 { font-weight: 650; }
h3 { font-weight: 650; }

.hero .soft { color: var(--muted); }

.btn-pill {
  min-height: 42px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.btn-pill.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.hero-actions .btn-pill {
  min-height: 44px;
  padding: 0 20px;
  gap: 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  box-shadow: 0 9px 16px -11px rgba(29, 29, 27, .72);
  transition:
    transform .25s cubic-bezier(.2, .75, .2, 1),
    box-shadow .25s ease,
    background-color .25s ease;
}

.hero-actions .btn-pill.btn-primary {
  border: 0;
  color: #fff;
  background-image: linear-gradient(rgb(46, 46, 46) 0%, rgb(26, 26, 26) 50%, rgb(14, 14, 14) 100%);
  box-shadow:
    rgba(255, 255, 255, 0.14) 0px 1px 0px inset,
    rgba(0, 0, 0, 0.5) 0px -1px 0px inset,
    rgba(0, 0, 0, 0.22) 0px 1px 2px,
    rgba(0, 0, 0, 0.5) 0px 10px 22px -10px,
    rgba(255, 82, 6, 0.55) 0px 8px 18px -12px;
}

.hero-actions .btn-pill.btn-secondary {
  border: 0;
  color: #1d1d1b;
  background-image: linear-gradient(rgb(255, 255, 255) 0%, rgb(248, 248, 247) 55%, rgb(239, 239, 238) 100%);
  box-shadow:
    rgb(255, 255, 255) 0px 1px 0px inset,
    rgba(0, 0, 0, 0.05) 0px -1px 0px inset,
    rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.08) 0px 1px 2px,
    rgba(0, 0, 0, 0.28) 0px 8px 18px -10px;
}

.hero-actions .btn-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.hero-actions .btn-pill .arr {
  font-size: .9rem;
  transition: transform .25s cubic-bezier(.2, .75, .2, 1);
}

main > section,
main > section:nth-of-type(odd),
main > section:nth-of-type(even) {
  width: 100%;
  margin: 20px auto 0;
  padding: clamp(48px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: var(--ui-radius);
  background: var(--surface);
  box-shadow: var(--ui-shadow);
}

main > section > *,
.section-intro {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.section-intro { margin-bottom: 34px; }
.section-intro > * { max-width: 680px; }

.case-list { gap: 18px; }

.case-card,
.case-card:hover {
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 45%),
    var(--surface-2);
}

.case-card {
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--ui-radius);
  box-shadow: 0 8px 18px -18px rgba(0, 0, 0, .5);
  transform: translateY(0);
  transition:
    transform .9s cubic-bezier(.45, 0, .55, 1),
    box-shadow .9s cubic-bezier(.45, 0, .55, 1);
}

.case-card:hover {
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--ui-shadow-hover);
}

.case-preview--img img {
  transform: scale(1);
  transition: transform 1.1s cubic-bezier(.45, 0, .55, 1);
}

.case-card:hover .case-preview--img img { transform: scale(1.015); }

.case-link .arrow {
  display: inline-block;
  transform: translate(0, 0);
  transition: transform .9s cubic-bezier(.45, 0, .55, 1);
}

.case-card:hover .case-link .arrow { transform: translate(3px, -3px); }

.case-preview { padding: 16px 16px 0; }
.case-preview--img { height: 292px; }

.case-preview--img img {
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--ui-radius-sm);
  box-shadow: 0 18px 38px -28px rgba(0,0,0,.72);
}

.case-content { padding: 26px 26px 28px; }

.case-content .eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.impact {
  width: fit-content;
  border-color: color-mix(in srgb, var(--border) 75%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.impact-label::after { color: var(--ui-accent); }

.case-link { font-weight: 700; }

.about-grid,
.experience-grid { align-items: start; }

.client-row,
.card,
.metric,
.flow-step,
.result {
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  box-shadow: 0 8px 20px -22px rgba(0,0,0,.7);
}

.meta {
  gap: 10px;
  padding-top: 10px;
  border: 0;
}

.meta-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.meta-label { color: var(--ui-accent); }

.hero-visual,
.visual,
.screen--img,
.image-frame,
.gallery-item img {
  border-radius: var(--ui-radius-sm);
  border-color: var(--border);
  background: var(--surface-2);
}

.hero-visual--img img,
.screen--img img,
.image-frame img,
.gallery-item img { border-radius: var(--ui-radius-sm); }

.number,
.metric .sub,
.flow-step:not(:last-child)::after { color: var(--ui-accent); }

.next {
  width: min(var(--max), calc(100% - 64px));
  margin: 20px auto;
  padding: clamp(52px, 7vw, 82px) 32px;
  border-radius: var(--ui-radius);
  border-color: #343430;
  background: #1d1d1b;
  box-shadow: var(--ui-shadow);
}

.next .eyebrow { color: #ff8a6d; }
.next .btn,
.next .btn-pill.btn-primary {
  background: #ffffff;
  color: #1d1d1b;
  border-color: #ffffff;
}

.copybar {
  width: min(var(--max), calc(100% - 64px));
  padding: 16px 0 32px;
}

@media (max-width: 900px) {
  body > .container:first-child nav,
  main.container,
  .next,
  .copybar { width: calc(100% - 40px); }

  .hero { width: 100%; }
  main > section { padding: 48px 28px; }
}

@media (max-width: 640px) {
  body > .container:first-child {
    width: calc(100% - 20px);
    top: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    box-shadow: var(--ui-shadow);
  }

  body > .container:first-child nav { width: 100%; padding: 10px 12px; }

  body.menu-open > .container:first-child {
    min-height: min(700px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .nav-links {
    min-height: calc(min(700px, 100dvh - 20px) - 64px);
    padding: 24px 16px 18px;
  }

  .nav-links a,
  .nav-links a.resume-btn {
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    flex-shrink: 0;
  }

  .nav-links a:hover,
  .nav-links a.resume-btn:hover {
    background: transparent;
    color: var(--text);
  }

  .nav-links a:first-child { color: var(--text); }
  .nav-links .theme-toggle { flex-shrink: 0; }

  main.container { width: calc(100% - 24px); margin-top: 20px; }
  .hero { width: 100%; padding: 42px 24px; border-radius: 20px; }
  .hero .eyebrow { margin-bottom: 20px; }
  main > section { margin-top: 12px; padding: 42px 20px; border-radius: 18px; }
  .case-preview { padding: 12px 12px 0; }
  .case-preview--img { height: 224px; }
  .case-content { padding: 24px 20px 26px; }
  .meta { grid-template-columns: minmax(0, 1fr); }
  .meta-item { border-bottom: 1px solid var(--border); }
  .next { width: calc(100% - 24px); margin: 12px auto; border-radius: 18px; }
  .copybar { width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .case-card,
  .case-preview--img img,
  .case-link .arrow,
  .btn-pill { transition: none; }
}

/* The homepage lanyard hangs from the hero edge, without a separate frame. */
.homepage-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  overflow: hidden;
}

.homepage-hero .hero-copy { min-width: 0; position: relative; z-index: 2; pointer-events: none; }
.homepage-hero .hero-copy a { pointer-events: auto; }
.homepage-hero h1 { font-size: 58px; line-height: 1.02; }

.homepage-hero .hero-visual {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.homepage-hero .hero-badge { display: none; }

.homepage-hero .hero-visual { pointer-events: none; }
.homepage-hero .hero-visual.is-dragging { z-index: 3; }
.homepage-hero .hero-visual .lanyard {
  left: 50%;
  width: 50%;
  pointer-events: auto;
}

/* Extend the drawing surface, not the resting card position, across the hero. */
@media (min-width: 641px) {
  .homepage-hero .hero-visual .lanyard-canvas {
    position: absolute;
    left: -100%;
    width: 200%;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .homepage-hero { padding: 44px 32px; gap: 24px; }
  .homepage-hero h1 { font-size: 40px; line-height: 1.04; }
}

@media (max-width: 640px) {
  main:has(.homepage-hero) .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .homepage-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 24px 36px;
    gap: 8px;
    min-height: 0;
  }

  .homepage-hero .hero-visual {
    position: relative;
    overflow: visible;
    top: auto;
    left: auto;
    bottom: auto;
    order: -1;
    width: 100%;
    height: 340px;
  }

  .homepage-hero .hero-visual .lanyard { left: 0; width: 100%; }

  .homepage-hero h1 { font-size: 36px; line-height: 1.04; }
  .homepage-hero .hero-actions { flex-wrap: wrap; }
}

@media (min-width: 641px) and (max-width: 740px) {
  .homepage-hero h1 { font-size: 34px; }
}

@media (max-width: 360px) {
  .homepage-hero { padding-right: 20px; padding-left: 20px; }
  .homepage-hero h1 { font-size: 32px; }
  .homepage-hero .hero-visual { height: 300px; }
}