:root {
  --cream: #f7f1e6;
  --sand: #efe5d8;
  --clay: #e57a43;
  --terra: #c95b2f;
  --ink: #13110f;
  --stone: #3f3a34;
  --muted: #867d70;
  font-size: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff9f1 0%, #f6efe4 40%, #f0e6d8 100%);
  padding: 2.5rem clamp(1.25rem, 6vw, 6rem) 4rem;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1.25rem;
  padding: 0.55rem 1.2rem;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  z-index: 50;
  box-shadow: 0 8px 20px rgba(18, 14, 10, 0.12);
}

.skip-link:focus {
  left: 1.5rem;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 246, 238, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 18px 40px rgba(25, 20, 16, 0.08);
  backdrop-filter: blur(12px);
}

.logo {
  font-weight: 600;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.logo-letter {
  font-weight: 600;
  color: var(--ink);
}

.logo-rest {
  display: inline-block;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 320ms ease, opacity 200ms ease, transform 280ms ease;
  transform: translateX(-0.2rem);
}

.logo:hover .logo-rest,
.logo:focus-visible .logo-rest {
  max-width: 12rem;
  opacity: 1;
  transform: translateX(0);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pill {
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
  cursor: pointer;
}

.pill.primary {
  background: var(--clay);
  color: #fff;
  border-color: transparent;
}

.pill.ghost {
  background: transparent;
}

.pill.fill {
  width: 100%;
  justify-content: center;
}

.pill:is(:hover, :focus-visible) {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(17, 14, 12, 0.14);
}

.pill.is-disabled,
.pill:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

main {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  margin-top: 2.5rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 3.7rem);
  line-height: 1.1;
  margin: 1rem 0 1.2rem;
}

.hero-copy p {
  color: var(--stone);
  line-height: 1.6;
}

.hero-copy p,
.card p,
.project-content p {
  max-width: 60ch;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  display: grid;
  gap: 1.5rem;
  position: relative;
}

.hero-card {
  background: var(--sand);
  border-radius: 32px;
  padding: 1.8rem;
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 26px 45px rgba(18, 14, 11, 0.12);
}

.hero-card h2 {
  margin-top: 0.4rem;
}

.hero-card p {
  color: var(--stone);
  line-height: 1.5;
}

.hero-burst {
  width: 55%;
  justify-self: end;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.25));
}

.section-title h2 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  margin-top: 0.4rem;
}

.section-title p {
  max-width: 65ch;
}

.about-grid,
.skills-grid,
.proof-grid,
.case-grid,
.project-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  perspective: 1400px;
}

.project-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.card {
  background: #fff;
  border-radius: 30px;
  padding: 1.75rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 35px rgba(16, 12, 10, 0.08);
}

.card.sand {
  background: var(--sand);
}

.card h3 {
  margin-bottom: 0.8rem;
}

.card p {
  color: var(--stone);
  line-height: 1.6;
}

.muted {
  color: var(--muted) !important;
}

.list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  color: var(--stone);
}

.checklist li {
  position: relative;
  padding-left: 1.3rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(229, 122, 67, 0.95), rgba(201, 91, 47, 0.75));
  box-shadow: 0 10px 18px rgba(18, 14, 10, 0.16);
}

.proof-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.proof-card {
  padding: 1.25rem 1.4rem;
}

.proof-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.proof-card p {
  font-size: 0.95rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #f7f2ea;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
}

.project-card {
  background: #fff;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 24px 50px rgba(18, 14, 10, 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease;
  transform-style: preserve-3d;
}

.project-card:not(.tilting):hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 60px rgba(18, 14, 10, 0.18);
}

.project-card.clay {
  background: #fef3eb;
}

.project-card.sand {
  background: #f6efe4;
}

.project-visual {
  --project-icon-size: clamp(120px, 20vw, 170px);
  padding: 2rem;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.project-visual img,
.project-visual svg {
  transition: transform 320ms ease, filter 320ms ease;
  transform-origin: center;
  width: var(--project-icon-size);
  height: var(--project-icon-size);
}

.project-visual img {
  object-fit: contain;
  background: #111;
  border-radius: 28px;
}

.project-card.research-topic .project-visual {
  background: transparent;
}

.project-card.research-topic .project-visual img,
.project-card.research-topic .project-visual svg {
  background: transparent;
}

.project-card:hover .project-visual img,
.project-card:hover .project-visual svg {
  animation: iconFloat 2.8s ease-in-out infinite;
  filter: drop-shadow(0 16px 26px rgba(18, 14, 10, 0.18));
}

.project-card.research-topic:hover .project-visual img,
.project-card.research-topic:hover .project-visual svg {
  animation: iconSpin 6s linear infinite;
}

.project-card.meridien:hover .project-visual svg {
  filter: drop-shadow(0 18px 30px rgba(47, 143, 184, 0.35));
}

.project-card.no-motion:hover {
  transform: none;
  box-shadow: 0 24px 50px rgba(18, 14, 10, 0.12);
}

.project-card.no-motion:hover .project-visual img,
.project-card.no-motion:hover .project-visual svg {
  animation: none;
  filter: none;
  transform: none;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes iconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.meridien-icon {
  width: var(--project-icon-size, 170px);
  height: var(--project-icon-size, 170px);
  transition: filter 300ms ease;
}

.meridien-icon .heartbeat-base {
  opacity: 0.9;
}

.meridien-icon .heartbeat-glow {
  stroke-dasharray: 70 220;
  stroke-dashoffset: 260;
  opacity: 0;
}

.meridien-icon .heartbeat-dot {
  opacity: 0.7;
}

.project-card.meridien .project-visual:hover .heartbeat-glow {
  animation: meridienPulse 3.4s linear infinite;
  filter: drop-shadow(0 0 10px rgba(63, 191, 154, 0.6));
  opacity: 1;
}

.project-card.meridien .project-visual:hover .heartbeat-dot {
  animation: meridienDots 3.4s linear infinite;
}

@keyframes meridienPulse {
  0% {
    stroke-dashoffset: 260;
    opacity: 0.35;
  }
  35% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -260;
    opacity: 0.7;
  }
}

@keyframes meridienDots {
  0%,
  40% {
    opacity: 0.4;
  }
  55%,
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.project-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-content p {
  color: var(--stone);
}

.feature-card {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) 1fr;
  gap: 1.5rem;
  align-items: center;
}

.feature-media {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}

.feature-content {
  display: grid;
  gap: 0.75rem;
}

.title-gradient {
  background: linear-gradient(110deg, #2f8fb8, #3fbf9a);
  -webkit-background-clip: text;
  color: transparent;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

.project-card .button-row {
  flex-wrap: nowrap;
  align-items: center;
}

.project-card .button-row .pill {
  flex: 1 1 0;
  justify-content: center;
  white-space: nowrap;
}

.project-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 300ms ease;
}

.overlay-curtain {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(229, 122, 67, 0.95), rgba(201, 91, 47, 0.95), #130f0c);
  transform: translateY(-100%);
  transition: transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 90vw);
  border-radius: 36px;
  padding: clamp(2rem, 5vw, 3rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  color: #f7f1e6;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 300ms ease, transform 350ms ease;
}

.overlay .eyebrow {
  color: rgba(247, 241, 230, 0.7);
}

.overlay-nav {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
}

.overlay-nav a {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f7f1e6;
}

.overlay-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.overlay-close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f1e6;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.overlay.is-open,
.overlay.is-transitioning {
  opacity: 1;
  pointer-events: auto;
}

.overlay.is-open .overlay-curtain,
.overlay.is-transitioning .overlay-curtain {
  transform: translateY(0);
}

.overlay.is-open .overlay-panel {
  opacity: 1;
  transform: translateY(0);
}

.overlay.is-transitioning .overlay-panel {
  opacity: 0;
  transform: translateY(30px);
}

body.overlay-open {
  overflow: hidden;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

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

.contact-stage {
  position: relative;
  padding: clamp(1.2rem, 2.8vw, 2rem);
  border-radius: 40px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background:
    radial-gradient(circle at 18% 10%, rgba(229, 122, 67, 0.16), transparent 55%),
    radial-gradient(circle at 78% 18%, rgba(63, 191, 154, 0.12), transparent 52%),
    radial-gradient(circle at 70% 92%, rgba(47, 143, 184, 0.11), transparent 54%),
    rgba(255, 255, 255, 0.65);
  box-shadow: 0 28px 60px rgba(18, 14, 10, 0.1);
  overflow: hidden;
}

.contact-stage::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(19, 17, 15, 0.04) 0px,
      rgba(19, 17, 15, 0.04) 1px,
      transparent 1px,
      transparent 44px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(19, 17, 15, 0.03) 0px,
      rgba(19, 17, 15, 0.03) 1px,
      transparent 1px,
      transparent 44px
    );
  opacity: 0.28;
  mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.9), transparent 70%);
  pointer-events: none;
}

.contact-grid--overhaul {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.contact-handoff h3 {
  margin-bottom: 0.9rem;
}

.mini-note {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-card {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

.has-js .contact-card {
  transform: translateY(24px) rotateX(8deg) rotateY(-6deg);
  opacity: 0;
  transition: transform 720ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 720ms ease,
    opacity 420ms ease;
}

.has-js .contact-card:nth-child(2) {
  transform: translateY(24px) rotateX(6deg) rotateY(6deg);
}

.contact-card::before,
.contact-card::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.contact-card::before {
  inset: -2px;
  background: linear-gradient(130deg, rgba(47, 143, 184, 0.18), rgba(63, 191, 154, 0.12));
  opacity: 0;
  filter: blur(12px);
  transform: translate3d(0, 18px, -40px);
  transition: opacity 700ms ease, transform 700ms ease;
  z-index: -1;
}

.contact-card::after {
  left: 12%;
  right: 12%;
  bottom: -28px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(20, 16, 12, 0.35), transparent 70%);
  filter: blur(10px);
  opacity: 0;
  transform: translateY(0);
  transition: opacity 700ms ease, transform 700ms ease;
  z-index: -2;
}

.has-js .contact-card.in-view {
  transform: translateY(0) rotateX(0deg) rotateY(0deg);
  opacity: 1;
  box-shadow: 0 30px 60px rgba(18, 14, 10, 0.16);
}

.has-js .contact-card.in-view::before {
  opacity: 1;
  transform: translate3d(0, 12px, -60px);
}

.has-js .contact-card.in-view::after {
  opacity: 1;
  transform: translateY(6px);
}

.has-js .contact-card.in-view:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 38px 70px rgba(18, 14, 10, 0.2);
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--stone);
}

.contact-form input,
.contact-form textarea {
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border 200ms ease, box-shadow 200ms ease;
}

.contact-form select {
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border 200ms ease, box-shadow 200ms ease;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(19, 17, 15, 0.7) 50%),
    linear-gradient(135deg, rgba(19, 17, 15, 0.7) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.contact-form select:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(229, 122, 67, 0.2);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(229, 122, 67, 0.2);
}

.fineprint {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.contact-details {
  display: grid;
  gap: 0.8rem;
}

.site-footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--muted);
}

.scroll-tag {
  position: fixed;
  right: 6%;
  top: 30%;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 16px 35px rgba(18, 14, 10, 0.15);
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  transition: opacity 320ms ease, transform 320ms ease, background 320ms ease;
  pointer-events: none;
}

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

.scroll-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--clay);
}

.scroll-label {
  font-size: 0.85rem;
}

@media (max-width: 800px) {
  .feature-card {
    grid-template-columns: 1fr;
  }

  .project-card .button-row {
    flex-wrap: wrap;
  }

  .project-card .button-row .pill {
    flex: 1 1 140px;
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .scroll-tag {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .contact-card {
    transform: none !important;
    opacity: 1 !important;
  }

  .contact-card::before,
  .contact-card::after {
    opacity: 0 !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .project-card {
    transform: none !important;
  }

  .overlay-curtain {
    transition-duration: 0.01ms !important;
  }
}
