:root {
  --bg: #071013;
  --bg-soft: #0a1519;
  --panel: #0e1b20;
  --panel-strong: #13232a;
  --text: #e9f0ed;
  --muted: #9aa9a4;
  --accent: #b9f24b;
  --accent-dark: #162208;
  --line: rgba(233, 240, 237, 0.12);
  --line-strong: rgba(233, 240, 237, 0.23);
  --max-width: 1240px;
  --header-height: 76px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

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

.container {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(7, 16, 19, 0.88);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.wordmark-mark {
  width: 19px;
  height: 19px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  position: relative;
}

.wordmark-mark::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 1px;
  top: 8px;
  left: -5px;
  background: var(--accent);
  transform: rotate(-35deg);
}

.accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--text); }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.menu-toggle > span:not(.sr-only) {
  display: block;
  width: 23px;
  height: 1px;
  margin: 6px auto;
  background: currentColor;
}

.hero {
  min-height: max(700px, 100svh);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: calc(var(--header-height) + 54px) 0 104px;
  background:
    linear-gradient(90deg, rgba(3, 9, 12, 0.96) 0%, rgba(3, 9, 12, 0.86) 38%, rgba(3, 9, 12, 0.34) 70%, rgba(3, 9, 12, 0.12) 100%),
    linear-gradient(0deg, rgba(3, 9, 12, 0.62) 0%, transparent 38%, rgba(3, 9, 12, 0.18) 100%),
    url("assets/artemis-earthrise.jpg") center 56% / cover no-repeat;
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(233, 240, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 240, 237, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to right, black 0%, black 42%, transparent 72%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 76% 70%, transparent 0%, transparent 24%, rgba(3, 9, 12, 0.18) 58%, rgba(3, 9, 12, 0.42) 100%);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 920px);
  grid-template-areas: "portrait" "copy";
  justify-content: center;
  gap: 2.5rem;
  align-items: center;
}

.hero-copy {
  grid-area: copy;
  width: 100%;
  max-width: 920px;
  justify-self: center;
}

.hero-copy > * {
  animation: hero-enter 760ms cubic-bezier(.16, .78, .22, 1) both;
}

.hero-copy > :nth-child(1) { animation-delay: 80ms; }
.hero-copy > :nth-child(2) { animation-delay: 180ms; }
.hero-copy > :nth-child(3) { animation-delay: 300ms; }
.hero-copy > :nth-child(4) { animation-delay: 420ms; }

.hero-portrait {
  grid-area: portrait;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  justify-self: center;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(233, 240, 237, 0.28);
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  animation: hero-portrait-enter 850ms 300ms cubic-bezier(.16, .78, .22, 1) both;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translate3d(-34px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hero-portrait-enter {
  from {
    opacity: 0;
    transform: translate3d(24px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.eyebrow,
.section-index,
.project-kicker,
.frame-label,
.project-media figcaption,
.visual-note {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  margin-bottom: 1.7rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(185, 242, 75, 0.09);
}

.hero-intro {
  max-width: 920px;
  margin: 0;
  text-align: center;
  color: var(--text);
  font-size: clamp(2.2rem, 3.65vw, 3.75rem);
  line-height: 1.11;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
}

.hero-intro span {
  display: inline;
  color: var(--accent);
}

.button {
  min-height: 49px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 160ms ease, background-color 160ms ease;
}

.button:hover,
.button:focus-visible { transform: translateY(-2px); }

.button-primary {
  background: var(--accent);
  color: var(--accent-dark);
}

.button-primary:hover,
.button-primary:focus-visible { background: #ceff69; }

.system-visual {
  min-height: 570px;
  position: relative;
  border: 1px solid var(--line-strong);
  background: rgba(10, 21, 25, 0.72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 0.75rem 0.75rem 2.8rem;
}

.system-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.025), transparent 42%, rgba(185,242,75,0.025));
}

.system-schematic {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

.schematic-grid path { fill: none; stroke: rgba(233, 240, 237, 0.045); stroke-width: 1; }
.schematic-boundary rect { fill: rgba(19, 35, 42, 0.32); stroke: rgba(233, 240, 237, 0.2); stroke-width: 1; stroke-dasharray: 5 6; }
.schematic-boundary text,
.schematic-section-label,
.schematic-callout text,
.schematic-pump-detail text,
.schematic-legend text,
.schematic-flow text {
  fill: #9aa9a4;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
}
.schematic-callout tspan,
.schematic-pump-detail text tspan { fill: var(--accent); }
.schematic-main { fill: none; stroke: rgba(233, 240, 237, 0.82); stroke-width: 1.5; }
.schematic-muted { fill: none; stroke: rgba(233, 240, 237, 0.34); stroke-width: 1.2; }
.schematic-fill { fill: rgba(19, 35, 42, 0.85); }
.schematic-accent { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.schematic-node { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.schematic-callout path,
.schematic-callout-line { fill: none; stroke: rgba(233, 240, 237, 0.38); stroke-width: 1; }
.schematic-callout circle { fill: var(--accent); }
.schematic-detail-ring { fill: rgba(7, 16, 19, 0.76); stroke: rgba(185, 242, 75, 0.62); stroke-width: 1.2; stroke-dasharray: 3 4; }
.schematic-legend circle { fill: rgba(233, 240, 237, 0.6); }
.schematic-legend path { fill: none; stroke: rgba(233, 240, 237, 0.38); stroke-width: 1.2; }
.schematic-legend .legend-accent { stroke: var(--accent); }

.visual-note {
  position: absolute;
  z-index: 6;
  left: 0;
  bottom: 1%;
  color: var(--muted);
}

.visual-note span { color: var(--accent); margin: 0 0.35rem; }

.hero-credit {
  position: absolute;
  z-index: 2;
  right: max(24px, calc((100vw - var(--max-width)) / 2));
  bottom: 22px;
  margin: 0;
  color: rgba(233, 240, 237, 0.62);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.hero-foot {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-foot a { color: var(--text); }

.projects-section {
  background: var(--bg-soft);
  padding: clamp(6rem, 10vw, 9rem) 0 0;
}

.projects-heading {
  max-width: 820px;
  margin-bottom: 2.8rem;
}

.section-index {
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.projects-heading h2,
.contact-strip h2 {
  margin: 0;
  font-size: clamp(2.8rem, 4.7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 650;
}

.projects-heading > p:not(.section-index) {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.project-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.project-media {
  position: relative;
  aspect-ratio: 1.38;
  margin: 0;
  overflow: hidden;
  background: #303846;
  border-bottom: 1px solid var(--line);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.2,.7,.2,1);
}

.project-card:hover .project-media img { transform: scale(1.025); }
.project-media-pump img,
.project-media-stand img { object-fit: contain; }

.project-media figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 0.42rem 0.55rem;
  color: var(--text);
  background: rgba(7, 16, 19, 0.8);
  backdrop-filter: blur(8px);
}

.project-summary {
  min-height: 235px;
  padding: 1.45rem 1.4rem 1.25rem;
}

.project-kicker {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.project-summary h3 {
  min-height: 3.2em;
  margin: 0;
  font-size: clamp(1.65rem, 2vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 650;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.34rem 0.48rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-details {
  border-top: 1px solid var(--line);
}

.project-details summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-details summary::-webkit-details-marker { display: none; }

.details-icon {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 180ms ease;
}

.project-details[open] .details-icon { transform: rotate(45deg); }

.details-body {
  padding: 0 1.4rem 1.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.details-body > p { margin: 0 0 1.25rem; }

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.detail-block h4 {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-block p { margin: 0; }
.detail-block ul { margin: 0; padding-left: 1.05rem; }
.detail-block li + li { margin-top: 0.38rem; }

.contact-strip {
  margin-top: clamp(5rem, 9vw, 8rem);
  display: grid;
  grid-template-columns: 1.15fr auto;
  gap: 5rem;
  align-items: end;
  padding: clamp(3.5rem, 7vw, 6.5rem);
  background: var(--accent);
  color: var(--bg);
}

.contact-strip .section-index {
  color: var(--bg);
  opacity: 0.64;
}

.contact-strip h2 {
  max-width: 760px;
  font-size: clamp(2.7rem, 5vw, 5.4rem);
}

.contact-strip p:not(.section-index) {
  max-width: 760px;
  margin: 1.6rem 0 0;
  font-size: 1rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.button-light {
  flex-shrink: 0;
  border-color: var(--bg);
  color: var(--bg);
  white-space: nowrap;
}

.button-light:hover,
.button-light:focus-visible {
  background: var(--bg);
  color: var(--accent);
}

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid rgba(7, 16, 19, 0.28);
  color: var(--muted);
  padding: 1.7rem 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer a,
.legal-header a,
.legal-card a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
}

.site-footer a:hover,
.legal-header a:hover,
.legal-card a:hover {
  color: var(--accent);
}

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  border-bottom: 1px solid var(--line);
  padding: 1.2rem 0;
}

.legal-main {
  flex: 1;
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(5rem, 12vw, 8rem);
}

.legal-main h1 {
  margin: 0.6rem 0 2rem;
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 1.1;
}

.legal-card {
  max-width: 620px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  background: var(--panel);
}

.legal-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.legal-card h2:not(:first-child) { margin-top: 2rem; }
.legal-card address { font-style: normal; }
.legal-card p { margin: 0; }

@media (max-width: 1080px) {
  .hero {
    min-height: max(720px, 100svh);
    padding: calc(var(--header-height) + 54px) 0 104px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 820px);
    grid-template-areas: "portrait" "copy";
    justify-content: center;
    gap: 2.2rem;
  }

  .hero-copy { max-width: 820px; }
  .hero-portrait { max-width: 200px; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card:last-child { grid-column: 1 / -1; width: calc(50% - 0.5rem); }
  .contact-strip { grid-template-columns: 1fr; gap: 2rem; }
  .contact-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
  :root { --header-height: 68px; }
  .container { width: min(calc(100% - 30px), var(--max-width)); }

  .site-nav {
    position: static;
    flex-direction: row;
    gap: 1.35rem;
    padding: 0;
    background: transparent;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .site-nav a { font-size: 0.68rem; }

  .hero {
    min-height: max(720px, 100svh);
    padding: 94px 0 78px;
    background-position: 52% center;
  }
  .hero-grid { background-size: 48px 48px; }
  .hero-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "portrait" "copy";
    gap: 1.8rem;
  }
  .hero-copy { grid-area: copy; }
  .hero-portrait {
    grid-area: portrait;
    grid-column: auto;
    width: 112px;
    aspect-ratio: 1;
    justify-self: center;
    border-radius: 50%;
    box-shadow: 0 15px 38px rgba(0, 0, 0, 0.34);
  }
  .hero-portrait img {
    object-position: center;
  }
  .hero-intro {
    margin-bottom: 1.8rem;
    font-size: clamp(1.72rem, 7.6vw, 2.2rem);
    line-height: 1.13;
  }
  .hero-credit { right: 15px; bottom: 16px; }

  .projects-section { padding-top: 5.5rem; }
  .projects-heading h2 { font-size: clamp(3rem, 13vw, 4.8rem); }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card:last-child { grid-column: auto; width: auto; }
  .project-summary { min-height: auto; }
  .project-summary h3 { min-height: auto; }

  .contact-strip {
    margin-inline: -15px;
    padding: 3.4rem 1.25rem;
  }

  .contact-strip .button {
    width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .contact-actions { width: 100%; }

  .site-footer .container { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
