:root {
  --ink: #0b1220;
  --ink-soft: #152033;
  --paper: #e8eef6;
  --muted: #8b98ab;
  --line: rgba(232, 238, 246, 0.14);
  --accent: #3b6ea8;
  --accent-bright: #6ea8e0;
  --glow: rgba(59, 110, 168, 0.38);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --max: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #a8c8ef;
}

img {
  max-width: 100%;
  display: block;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--ink-soft);
  padding: 0.5rem 0.75rem;
}

/* —— Atmosphere —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 15% -10%, rgba(59, 110, 168, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 20%, rgba(70, 90, 120, 0.3), transparent 50%),
    linear-gradient(165deg, #070b14 0%, #0b1220 40%, #121a2a 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* —— Layout —— */
.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
}

.wordmark span {
  color: var(--accent-bright);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  font-size: 0.92rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--paper);
}

/* —— Hero —— */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(92vh, 52rem);
  display: grid;
  align-content: end;
  padding: 5rem 0 3.75rem;
  overflow: hidden;
  border-top: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.04);
  animation: hero- ken 28s ease-in-out infinite alternate;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(7, 11, 20, 0.88) 0%,
      rgba(11, 18, 32, 0.72) 42%,
      rgba(11, 18, 32, 0.35) 72%,
      rgba(11, 18, 32, 0.55) 100%
    ),
    linear-gradient(to top, rgba(7, 11, 20, 0.92) 0%, transparent 42%);
}

@keyframes hero-ken {
  from {
    transform: scale(1.04) translate(0, 0);
  }
  to {
    transform: scale(1.1) translate(-1.5%, 1%);
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
  animation: rise 0.9s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  margin: 1.15rem 0 0;
  max-width: 32rem;
  font-size: 1.15rem;
  color: rgba(232, 238, 246, 0.82);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #071018;
  box-shadow: 0 0 0 0 var(--glow);
}

.btn-primary:hover {
  background: var(--accent-bright);
  color: #071018;
  box-shadow: 0 0 24px var(--glow);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--paper);
  background: transparent;
}

.btn-ghost:hover {
  border-color: rgba(110, 168, 224, 0.45);
  color: var(--accent-bright);
}

/* —— Sections —— */
section {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 2rem;
  max-width: 36rem;
  color: rgba(232, 238, 246, 0.75);
}

/* Section intro plate — leader backdrop for “Framework, reference, lab” */
.section-head--backdrop {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 2.85rem;
  padding: 1.1rem 0.35rem 0.95rem;
}

.section-head--backdrop .work-backdrop,
.section-head--backdrop .work-backdrop-scrim {
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 28%,
      rgba(0, 0, 0, 0.2) 42%,
      #000 60%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 28%,
      rgba(0, 0, 0, 0.2) 42%,
      #000 60%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
  mask-composite: intersect;
}

.section-head--backdrop .work-backdrop {
  position: absolute;
  inset: 0 -0.75rem;
  z-index: 0;
  pointer-events: none;
}

.section-head--backdrop .work-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center;
  opacity: 0.32;
  transform: none;
  transition: opacity 0.35s ease;
}

.section-head--backdrop:hover .work-backdrop img {
  opacity: 0.78;
}

.section-head--backdrop .work-backdrop-scrim {
  position: absolute;
  inset: 0 -0.75rem;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(7, 11, 20, 0.7) 0%,
      rgba(11, 18, 32, 0.35) 38%,
      rgba(11, 18, 32, 0.12) 70%,
      rgba(11, 18, 32, 0.22) 100%
    ),
    linear-gradient(to top, rgba(7, 11, 20, 0.45) 0%, transparent 55%);
}

.section-head-copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
}

.section-head--backdrop .section-lead {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.45;
}

.section-head--lead .section-title {
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  margin-bottom: 0.45rem;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  animation: rise 0.7s ease-out both;
}

.work-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
}

.work-item:last-child {
  border-bottom: none;
}

#work {
  padding-bottom: 2rem;
}

.work-item:nth-child(1) {
  animation-delay: 0.05s;
}
.work-item:nth-child(2) {
  animation-delay: 0.12s;
}
.work-item:nth-child(3) {
  animation-delay: 0.19s;
}
.work-item:nth-child(4) {
  animation-delay: 0.26s;
}

/* Product shot as atmospheric full-row background (hero-style scrim) */
.work-item--backdrop {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-height: 0;
  padding: 1.35rem 0.35rem;
  margin-inline: 0;
  border-radius: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.work-backdrop,
.work-backdrop-scrim {
  /* Feather sides + bottom only — keep top hard against the list rule */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  mask-composite: intersect;
}

/* Product shots: dissolve in from the left so copy stays clear (ECAN plate does this in-image) */
.work-item--fade-in .work-backdrop,
.work-item--fade-in .work-backdrop-scrim {
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 10%,
      rgba(0, 0, 0, 0.35) 26%,
      #000 48%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 10%,
      rgba(0, 0, 0, 0.35) 26%,
      #000 48%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.work-item--fade-in .work-backdrop img {
  object-position: 62% top;
}

/*
 * Ultra-wide UI strips: object-position X is a no-op under cover
 * (scaled to width). Shift with translateX instead; parent overflow clips.
 */
.work-item--brain .work-backdrop img {
  object-position: left top;
  transform: translateX(32%) scaleY(0.9);
  transform-origin: left center;
}

.work-item--brain.work-item--backdrop:hover .work-backdrop img {
  transform: translateX(32%) scaleY(0.92);
}

.work-item--lab .work-backdrop img {
  object-position: left top;
  transform: translateX(10%) scaleY(0.9);
  transform-origin: left center;
}

.work-item--lab.work-item--backdrop:hover .work-backdrop img {
  transform: translateX(10%) scaleY(0.92);
}

.work-item--lab .work-backdrop,
.work-item--lab .work-backdrop-scrim,
.work-item--brain .work-backdrop,
.work-item--brain .work-backdrop-scrim {
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 28%,
      rgba(0, 0, 0, 0.2) 42%,
      #000 60%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 28%,
      rgba(0, 0, 0, 0.2) 42%,
      #000 60%,
      #000 90%,
      transparent 100%
    ),
    linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.work-backdrop {
  position: absolute;
  inset: 0 -0.75rem;
  z-index: 0;
  pointer-events: none;
}

.work-backdrop img {
  width: 100%;
  height: 100%;
  /* Cover (natural aspect) — mild Y compress so a bit more UI fits without hard fill-squash */
  object-fit: cover;
  object-position: center top;
  opacity: 0.25;
  transform: scaleY(0.9);
  transform-origin: center top;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.work-item--backdrop:hover .work-backdrop img {
  opacity: 0.75;
  transform: scaleY(0.92);
}

.work-backdrop-scrim {
  position: absolute;
  inset: 0 -0.75rem;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(7, 11, 20, 0.72) 0%,
      rgba(11, 18, 32, 0.45) 38%,
      rgba(11, 18, 32, 0.18) 72%,
      rgba(11, 18, 32, 0.28) 100%
    ),
    linear-gradient(to top, rgba(7, 11, 20, 0.55) 0%, transparent 50%);
}

.work-item--backdrop .work-copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
}

.work-item--backdrop .work-meta {
  margin-top: 0;
  color: rgba(232, 238, 246, 0.7);
}

.work-item--backdrop p {
  color: rgba(232, 238, 246, 0.82);
}

.work-copy {
  min-width: 0;
}

.work-item h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.work-item h3 a {
  color: var(--paper);
  text-decoration: none;
}

.work-item h3 a:hover {
  color: var(--accent-bright);
}

.work-item p {
  margin: 0.35rem 0 0;
  color: rgba(232, 238, 246, 0.72);
  max-width: 40rem;
}

.work-meta {
  display: inline-block;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.services {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.service {
  padding-top: 0.5rem;
  border-top: 2px solid var(--accent);
}

.service h3 {
  margin: 0.75rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.service p {
  margin: 0;
  color: rgba(232, 238, 246, 0.72);
  font-size: 0.98rem;
}

.about-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .work-item {
    grid-template-columns: 1fr;
  }

  .work-item--backdrop {
    padding: 1.35rem 0.35rem;
    margin-inline: 0;
  }

  .work-backdrop-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(7, 11, 20, 0.35) 0%,
        rgba(11, 18, 32, 0.5) 45%,
        rgba(7, 11, 20, 0.72) 100%
      );
  }

  .hero-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(7, 11, 20, 0.55) 0%,
        rgba(11, 18, 32, 0.78) 48%,
        rgba(7, 11, 20, 0.94) 100%
      );
  }

  .hero-media img {
    object-position: center 48%;
  }
}

.people {
  margin: 0;
  padding: 0;
  list-style: none;
}

.people li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.people li:last-child {
  border-bottom: 1px solid var(--line);
}

.people strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.people span {
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}

.contact-block a.mail {
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}
