/* =============================================
   TOKENS
   ============================================= */

:root {
  --c-bg: #fafaf9;
  --c-bg-alt: #f0f0ed;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-2: #5c5c56;
  --c-text-3: #6d6d67;
  --c-border: #d8d8d3;
  --c-btn: #1a1a1a;
  --c-btn-text: #fafaf9;
  --c-btn-hover: #363636;
  --c-header-bg: rgba(250, 250, 249, 0.82);
  --c-accent: #8a6a12;
  --c-accent-2: #c8a13a;
  --c-accent-hover: #6f5410;
  --c-accent-soft: rgba(176, 141, 45, 0.1);
  --c-accent-border: rgba(176, 141, 45, 0.38);
  --c-accent-text: #211a06;
  --grad-accent: linear-gradient(120deg, #a9791f 0%, #d4af37 46%, #f0d98a 100%);
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 12px 32px rgba(26, 26, 26, 0.07);
  --shadow-lg: 0 24px 64px rgba(26, 26, 26, 0.1);
  --shadow-accent: 0 14px 34px rgba(176, 141, 45, 0.28);

  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-xs: clamp(0.75rem, 0.72rem + 0.13vw, 0.8125rem);
  --f-sm: clamp(0.8125rem, 0.78rem + 0.16vw, 0.875rem);
  --f-base: clamp(0.9375rem, 0.9rem + 0.19vw, 1.0625rem);
  --f-lg: clamp(1.0625rem, 0.98rem + 0.41vw, 1.25rem);
  --f-xl: clamp(1.25rem, 1.12rem + 0.65vw, 1.5rem);
  --f-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --f-hero: clamp(2.25rem, 1.4rem + 4.25vw, 4.25rem);

  --s-xs: 0.25rem;
  --s-sm: 0.5rem;
  --s-md: 1rem;
  --s-lg: 1.5rem;
  --s-xl: 2rem;
  --s-2xl: 3rem;
  --s-3xl: 4rem;
  --s-section: clamp(4rem, 3rem + 5vw, 8rem);

  --max-w: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 3.75rem;
  --radius: 5px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #111110;
    --c-bg-alt: #19191a;
    --c-surface: #212121;
    --c-text: #ededeb;
    --c-text-2: #a0a09a;
    --c-text-3: #929289;
    --c-border: #2e2e2c;
    --c-btn: #ededeb;
    --c-btn-text: #111110;
    --c-btn-hover: #d4d4d0;
    --c-header-bg: rgba(17, 17, 16, 0.82);
    --c-accent: #e3c46b;
    --c-accent-2: #f0d98a;
    --c-accent-hover: #eed08a;
    --c-accent-soft: rgba(227, 196, 107, 0.12);
    --c-accent-border: rgba(227, 196, 107, 0.4);
    --c-accent-text: #171205;
    --grad-accent: linear-gradient(120deg, #bd952f 0%, #e6c877 50%, #f5e7b4 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.32);
    --shadow-accent: 0 14px 34px rgba(190, 150, 45, 0.42);
  }
}

:root[data-theme="dark"] {
  --c-bg: #111110;
  --c-bg-alt: #19191a;
  --c-surface: #212121;
  --c-text: #ededeb;
  --c-text-2: #a0a09a;
  --c-text-3: #929289;
  --c-border: #2e2e2c;
  --c-btn: #ededeb;
  --c-btn-text: #111110;
  --c-btn-hover: #d4d4d0;
  --c-header-bg: rgba(17, 17, 16, 0.82);
  --c-accent: #e3c46b;
  --c-accent-2: #f0d98a;
  --c-accent-hover: #eed08a;
  --c-accent-soft: rgba(227, 196, 107, 0.12);
  --c-accent-border: rgba(227, 196, 107, 0.4);
  --c-accent-text: #171205;
  --grad-accent: linear-gradient(120deg, #bd952f 0%, #e6c877 50%, #f5e7b4 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.32);
  --shadow-accent: 0 14px 34px rgba(190, 150, 45, 0.42);
}

:root[data-theme="light"] {
  --c-bg: #fafaf9;
  --c-bg-alt: #f0f0ed;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-2: #5c5c56;
  --c-text-3: #6d6d67;
  --c-border: #d8d8d3;
  --c-btn: #1a1a1a;
  --c-btn-text: #fafaf9;
  --c-btn-hover: #363636;
  --c-header-bg: rgba(250, 250, 249, 0.82);
  --c-accent: #8a6a12;
  --c-accent-2: #c8a13a;
  --c-accent-hover: #6f5410;
  --c-accent-soft: rgba(176, 141, 45, 0.1);
  --c-accent-border: rgba(176, 141, 45, 0.38);
  --c-accent-text: #211a06;
  --grad-accent: linear-gradient(120deg, #a9791f 0%, #d4af37 46%, #f0d98a 100%);
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 12px 32px rgba(26, 26, 26, 0.07);
  --shadow-lg: 0 24px 64px rgba(26, 26, 26, 0.1);
  --shadow-accent: 0 14px 34px rgba(176, 141, 45, 0.28);
}

/* =============================================
   RESET
   ============================================= */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: var(--f-base);
  line-height: 1.6;
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  opacity: 0.7;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 3px;
  border-radius: 2px;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* =============================================
   LAYOUT
   ============================================= */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* =============================================
   SCROLL PROGRESS (hidden by default, shown by motion)
   ============================================= */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--grad-accent);
  transform-origin: 0 0;
  transform: scaleX(0);
  z-index: 101;
  pointer-events: none;
  display: none;
}

/* =============================================
   HEADER
   ============================================= */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--c-header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--c-border);
  opacity: 0;
  pointer-events: none;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

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

.header-logo {
  font-family: var(--f-display);
  font-size: var(--f-base);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.header-logo:hover {
  opacity: 1;
}

.nav-menu {
  display: flex;
  gap: var(--s-lg);
}

.nav-link {
  font-size: var(--f-sm);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  padding-bottom: 2px;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.is-active {
  background-size: 100% 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--c-text);
  border-radius: 1px;
  transform-origin: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
}

/* =============================================
   THEME TOGGLE
   ============================================= */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border-radius: 50%;
  color: var(--c-text-2);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  opacity: 1;
  color: var(--c-text);
  background-color: var(--c-bg-alt);
}

.theme-icon {
  width: 18px;
  height: 18px;
}

/* Sun shows in dark mode (click → go light); moon shows in light mode */
.theme-icon--sun {
  display: none;
}
.theme-icon--moon {
  display: block;
}
:root[data-theme="dark"] .theme-icon--sun {
  display: block;
}
:root[data-theme="dark"] .theme-icon--moon {
  display: none;
}

/* =============================================
   HERO
   ============================================= */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + var(--s-3xl));
  padding-bottom: var(--s-section);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  background:
    radial-gradient(
      circle at 30% 30%,
      var(--c-accent) 0%,
      transparent 62%
    ),
    radial-gradient(
      circle at 75% 70%,
      var(--c-accent-2) 0%,
      transparent 60%
    );
  opacity: 0.14;
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .hero::before {
    opacity: 0.22;
  }
}

:root[data-theme="dark"] .hero::before {
  opacity: 0.22;
}

:root[data-theme="light"] .hero::before {
  opacity: 0.14;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-2xl);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s-md);
}

.hero-eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
}

.hero-heading {
  font-family: var(--f-display);
  font-size: var(--f-hero);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: var(--s-lg);
}

.hero-line {
  display: block;
  overflow: hidden;
}

.hero-line-inner {
  display: block;
}

.hero-subline {
  font-size: var(--f-lg);
  line-height: 1.65;
  color: var(--c-text-2);
  max-width: 540px;
  margin-bottom: var(--s-xl);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-lg);
}

.hero-secondary {
  font-size: var(--f-sm);
  font-weight: 500;
  color: var(--c-text-2);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  padding-bottom: 1px;
  cursor: pointer;
}

.hero-secondary:hover {
  background-size: 100% 1px;
}

.hero-portrait {
  position: relative;
  max-width: 320px;
  margin-inline: auto;
}

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: auto -12px -12px auto;
  width: 78%;
  height: 78%;
  border-radius: 6px;
  background: var(--grad-accent);
  opacity: 0.9;
  z-index: -1;
}

.hero-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--f-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  opacity: 1;
}

.btn-primary {
  position: relative;
  background: var(--grad-accent);
  background-size: 140% 140%;
  background-position: 0% 50%;
  color: var(--c-accent-text);
  padding: 0.7rem 1.4rem;
}

.btn-lg {
  padding: 0.85rem 1.8rem;
  font-size: var(--f-base);
}

/* =============================================
   SECTION HEADINGS
   ============================================= */

.section-heading {
  font-family: var(--f-display);
  font-size: var(--f-2xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: var(--s-2xl);
}

.section-heading::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: var(--s-md);
  border-radius: 3px;
  background: var(--grad-accent);
}

.label-heading {
  font-size: var(--f-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s-md);
}

/* =============================================
   PROOF STRIP
   ============================================= */

.proof {
  padding-block: var(--s-2xl);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  background-color: var(--c-accent-soft);
}

.proof-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-xl);
}

.proof-item {
  display: flex;
  flex-direction: column;
  gap: var(--s-xs);
}

.proof-num {
  font-family: var(--f-display);
  font-size: var(--f-2xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.proof-label {
  font-size: var(--f-sm);
  line-height: 1.5;
  color: var(--c-text-2);
  max-width: 32ch;
}

/* =============================================
   ABOUT
   ============================================= */

.about {
  padding-block: var(--s-section);
  background-color: var(--c-bg-alt);
}

.about-body {
  max-width: 640px;
}

.about-lead {
  font-size: var(--f-lg);
  line-height: 1.7;
  margin-bottom: var(--s-2xl);
}

.about-block {
  margin-bottom: var(--s-2xl);
}

.about-block:last-child {
  margin-bottom: 0;
}

.about-list li {
  position: relative;
  padding-left: var(--s-lg);
  margin-bottom: var(--s-sm);
  color: var(--c-text-2);
  font-size: var(--f-sm);
  line-height: 1.65;
}

.about-list li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: var(--c-accent);
}

.about-list a {
  color: var(--c-accent);
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  padding-bottom: 1px;
}

.about-list a:hover {
  background-size: 100% 1px;
  opacity: 1;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

.stack-tag {
  font-size: var(--f-xs);
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: 100px;
  color: var(--c-text-2);
  white-space: nowrap;
  cursor: default;
}

.stack-tag:hover {
  background: var(--grad-accent);
  color: var(--c-accent-text);
  border-color: transparent;
}

/* =============================================
   CASES
   ============================================= */

.cases {
  padding-block: var(--s-section);
}

.cases-grid {
  display: grid;
  gap: var(--s-lg);
}

.case-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--s-lg);
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  cursor: default;
}

.case-card--flagship {
  border-left-width: 3px;
  border-left-color: var(--c-accent);
}

.case-title {
  font-family: var(--f-display);
  font-size: var(--f-lg);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: var(--s-md);
}

.case-body {
  flex: 1;
}

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

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

.case-label {
  display: inline-block;
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 0.15rem;
}

.case-section p {
  font-size: var(--f-sm);
  line-height: 1.6;
  color: var(--c-text-2);
}

.case-result {
  position: relative;
  font-size: var(--f-sm);
  font-weight: 700;
  line-height: 1.5;
  padding-top: var(--s-md);
  border-top: 1px solid var(--c-border);
  margin-top: auto;
}

.case-result::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 3px;
  border-radius: 3px;
  background: var(--grad-accent);
}

.case-stack {
  margin-top: var(--s-md);
}

.case-stack .case-label {
  margin-bottom: 0.4rem;
}

/* =============================================
   CONTACT / FOOTER
   ============================================= */

.contact {
  padding-block: var(--s-section);
  background-color: var(--c-bg-alt);
}

.contact-inner {
  max-width: 560px;
}

.contact-subline {
  font-size: var(--f-base);
  line-height: 1.7;
  color: var(--c-text-2);
  margin-bottom: var(--s-xl);
}

.contact-cta {
  margin-bottom: var(--s-2xl);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  font-size: var(--f-sm);
  color: var(--c-text-2);
}

.contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--c-text-3);
}

.contact-item a {
  color: var(--c-accent);
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  padding-bottom: 1px;
  cursor: pointer;
}

.contact-item a:hover {
  background-size: 100% 1px;
}

.contact-item a,
.contact-item span {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.footer-bottom {
  margin-top: var(--s-3xl);
  padding-top: var(--s-lg);
  border-top: 1px solid var(--c-border);
  font-size: var(--f-xs);
  color: var(--c-text-3);
}

/* =============================================
   MOBILE NAV (< 768px)
   ============================================= */

@media (max-width: 767px) {
  /* lock the page behind the drawer */
  body.nav-open {
    overflow: hidden;
  }

  /* hamburger stays on top of the drawer so it can close it */
  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 10000;
  }

  /* dimmed backdrop — covers the page, sits below the top bar */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background-color: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  /* the side drawer itself — pinned to the viewport, full height */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    height: 100dvh;
    width: min(82vw, 360px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--s-lg);
    padding: calc(var(--header-h) + var(--s-2xl)) var(--s-2xl) var(--s-2xl);
    background-color: var(--c-bg);
    border-left: 1px solid var(--c-border);
    box-shadow: -30px 0 80px -20px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    counter-reset: navitem;
    transform: translateX(100%);
    visibility: hidden;
  }

  body.nav-open .nav-menu {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-menu li {
    counter-increment: navitem;
    width: 100%;
  }

  .nav-menu .nav-link {
    display: flex;
    align-items: baseline;
    gap: var(--s-sm);
    font-size: var(--f-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    background-size: 0% 1px;
  }

  .nav-menu .nav-link::before {
    content: "0" counter(navitem);
    font-size: var(--f-xs);
    font-weight: 500;
    letter-spacing: 0.05em;
    opacity: 0.4;
    font-variant-numeric: tabular-nums;
  }

  /* hamburger -> X */
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* backdrop never shows on desktop */
@media (min-width: 768px) {
  .nav-backdrop {
    display: none;
  }
}

/* =============================================
   TABLET (>= 768px)
   ============================================= */

@media (min-width: 768px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    gap: var(--s-3xl);
  }

  .hero-content {
    flex: 1;
    min-width: 0;
  }

  .hero-portrait {
    flex-shrink: 0;
    max-width: 280px;
    margin-inline: 0;
  }

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

  .proof-inner {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-2xl);
  }
}

/* =============================================
   DESKTOP (>= 1024px)
   ============================================= */

@media (min-width: 1024px) {
  .hero-portrait {
    max-width: 360px;
  }

  .cases-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================
   ALL MOTION — only when user hasn't requested
   reduced motion. Under "reduce" everything above
   renders in its final, static state.
   ============================================= */

@media (prefers-reduced-motion: no-preference) {
  /* --- keyframes ------------------------------------------------ */

  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes line-rise {
    from {
      transform: translateY(110%);
    }
    to {
      transform: translateY(0);
    }
  }

  @keyframes wipe-in {
    from {
      clip-path: inset(0 100% 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }

  /* --- scroll progress ------------------------------------------ */

  .scroll-progress {
    display: block;
    will-change: transform;
  }

  /* --- header transition ---------------------------------------- */

  .site-header {
    transition:
      background-color 0.4s ease,
      box-shadow 0.4s ease;
  }

  /* --- hero entrance -------------------------------------------- */

  .hero-eyebrow {
    animation: fade-up 0.5s var(--ease) 0.05s both;
  }

  .hero-line-inner {
    animation: line-rise 0.5s var(--ease) both;
  }

  .hero-line:nth-child(1) .hero-line-inner {
    animation-delay: 0.15s;
  }
  .hero-line:nth-child(2) .hero-line-inner {
    animation-delay: 0.24s;
  }
  .hero-line:nth-child(3) .hero-line-inner {
    animation-delay: 0.33s;
  }

  .hero-subline {
    animation: fade-up 0.5s var(--ease) 0.42s both;
  }

  .hero-actions {
    animation: fade-up 0.5s var(--ease) 0.52s both;
  }

  .hero-portrait {
    animation: wipe-in 0.6s var(--ease) 0.5s both;
    will-change: clip-path;
  }

  /* --- scroll reveal -------------------------------------------- */

  .reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition:
      opacity 0.6s var(--ease),
      transform 0.6s var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  /* --- stack-tag staggered reveal ------------------------------- */

  .stack-tag {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition:
      opacity 0.45s var(--ease),
      transform 0.45s var(--ease),
      background-color 0.35s var(--ease),
      color 0.35s var(--ease),
      border-color 0.35s var(--ease),
      box-shadow 0.35s var(--ease);
    transition-delay: calc(var(--i, 0) * 50ms);
  }

  .is-visible .stack-tag {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .stack-tag:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px) scale(1.04);
  }

  /* --- card hover ----------------------------------------------- */

  .case-card {
    transition:
      transform 0.2s var(--ease),
      box-shadow 0.2s var(--ease),
      border-color 0.2s var(--ease);
  }

  .case-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
  }

  .case-card--flagship:hover {
    border-left-color: var(--c-accent);
  }

  /* --- button hover --------------------------------------------- */

  .btn {
    transition:
      background-color 0.2s ease,
      background-position 0.5s var(--ease),
      transform 0.2s var(--ease),
      box-shadow 0.2s var(--ease);
  }

  .btn-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
  }

  .btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
    transition-duration: 0.1s;
  }

  /* --- theme toggle --------------------------------------------- */

  .theme-toggle {
    transition:
      background-color 0.2s ease,
      color 0.2s ease,
      transform 0.2s var(--ease);
  }

  .theme-toggle:active {
    transform: scale(0.9);
    transition-duration: 0.1s;
  }

  .theme-icon {
    transition: transform 0.3s var(--ease);
  }

  .theme-toggle:hover .theme-icon {
    transform: rotate(18deg);
  }

  /* --- link underline animations -------------------------------- */

  .nav-link {
    transition: background-size 0.4s var(--ease);
  }

  .nav-link:hover {
    opacity: 1;
  }

  .hero-secondary {
    transition: background-size 0.4s var(--ease);
  }

  .hero-secondary:hover {
    opacity: 1;
  }

  .about-list a {
    transition: background-size 0.4s var(--ease);
  }

  .about-list a:hover {
    opacity: 1;
  }

  .contact-item a {
    transition: background-size 0.4s var(--ease);
  }

  .contact-item a:hover {
    opacity: 1;
  }

  /* --- contact item hover --------------------------------------- */

  .contact-item {
    transition: transform 0.3s var(--ease);
  }

  .contact-item:hover {
    transform: translateX(4px);
  }

  .contact-icon {
    transition: color 0.3s ease;
  }

  .contact-item:hover .contact-icon {
    color: var(--c-accent);
  }

  /* --- mobile nav transition ------------------------------------ */

  @media (max-width: 767px) {
    .nav-toggle-bar {
      transition:
        transform 0.3s var(--ease),
        opacity 0.3s var(--ease);
    }

    /* drawer glides in, backdrop fades in */
    .nav-menu {
      transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.55s;
    }

    .nav-backdrop {
      transition:
        opacity 0.5s ease,
        visibility 0.5s;
    }

    /* tap / hover micro-interaction on drawer links */
    .nav-menu .nav-link {
      transition:
        transform 0.35s var(--ease),
        background-size 0.4s var(--ease);
    }

    .nav-menu .nav-link:hover,
    .nav-menu .nav-link:active,
    .nav-menu .nav-link.is-active {
      transform: translateX(8px);
      background-size: 100% 1px;
    }

    .nav-menu .nav-link:hover::before,
    .nav-menu .nav-link.is-active::before {
      opacity: 1;
    }

    .nav-menu .nav-link::before {
      transition: opacity 0.35s var(--ease);
    }

    /* links glide in with a stagger once the drawer is open */
    body.nav-open .nav-menu .nav-link {
      animation: navLinkIn 0.55s var(--ease) backwards;
    }

    body.nav-open .nav-menu li:nth-child(1) .nav-link {
      animation-delay: 0.14s;
    }
    body.nav-open .nav-menu li:nth-child(2) .nav-link {
      animation-delay: 0.22s;
    }
    body.nav-open .nav-menu li:nth-child(3) .nav-link {
      animation-delay: 0.3s;
    }

    @keyframes navLinkIn {
      from {
        opacity: 0;
        transform: translateX(28px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
  }
}
