/* Design tokens */
:root {
  --color-bg: #f7f7f5;
  --color-bg-alt: #eceded;
  --color-text: #15181c;
  --color-text-muted: #5f666e;
  --color-accent: #12429b;
  --color-accent-dark: #0d3178;
  --color-border: #d8dad9;
  --color-idea: #e8a70f;

  --font-sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --container-max: 1120px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.btn {
  display: inline-block;
  padding: 0.8125rem var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 2px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover, .btn:focus-visible { background: var(--color-accent); }
.btn:disabled { opacity: 0.6; cursor: default; }

/* Nav */
#site-header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  position: relative;
}
.nav-wordmark {
  display: flex;
  align-items: center;
  gap: 0.6875rem;
  text-decoration: none;
  font-size: 1.1875rem;
  font-stretch: 112%;
  letter-spacing: -0.005em;
}
.nav-wordmark em { font-style: normal; font-weight: 700; }
.mark { width: 30px; height: 30px; flex: none; }
/* Same cube as the favicon, lit from the same side, inverted for this ground:
   the favicon is a light cube on blue, this is a blue cube on light. */
.mark-top { fill: var(--color-accent); opacity: 0.78; }
.mark-left { fill: var(--color-accent); }
.mark-right { fill: var(--color-accent-dark); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-menu a:not(.btn) {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}
.nav-menu a:not(.btn):hover { color: var(--color-text); }
.nav-menu .btn { padding: 0.625rem var(--space-2); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 0.9375rem 0.5rem;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
  }
  .nav-menu.is-open { display: flex; }
}

/* Hero */
#hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-12) 0 calc(var(--space-12) + var(--space-4));
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.hero-inner { position: relative; }

/* Engineering paper under the tinted bands, so they read as a drawing sheet
   rather than a flat colour field. Minor lines at 26px, majors every fifth. */
#hero, #process {
  background-image:
    linear-gradient(to right, rgba(21, 24, 28, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 24, 28, 0.045) 1px, transparent 1px),
    linear-gradient(to right, rgba(21, 24, 28, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 24, 28, 0.055) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 130px 130px;
}

/* Enough height to read as a space rather than a strip. Gated above the
   breakpoint where the art moves and the layout goes single column. */
@media (min-width: 901px) {
  #hero {
    min-height: min(78vh, 760px);
    display: flex;
    align-items: center;
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
  #hero > .hero-inner { width: 100%; }
}

/* Oversized technical drawing, deliberately cropped */
.hero-art {
  position: absolute;
  top: 50%;
  /* Sits close enough to the copy to read as one composition. Further right and
     a wide window opens a dead band between the two. */
  left: 62%;
  width: min(48rem, 64vw);
  transform: translateY(-46%);
  color: var(--color-text);
  pointer-events: none;
}
.art-rings path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
/* A touch of fill so the plates read as thin material rather than bare outlines,
   which is what separates a stack from a flat pattern. */
.art-rings path.art-plate { fill: currentColor; fill-opacity: 0.14; }

/* The stack assembles from the base up, then the finished part lands last. */
@keyframes hero-fade { to { opacity: 1; } }
@keyframes hero-rise { from { transform: translateY(34px); } to { transform: none; } }

.js .plate-wrap,
.js .solid-wrap { opacity: 0; animation: hero-fade 0.55s ease forwards; }
.js .art-plate,
.js .art-solid { animation: hero-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

.js .art-rings > *:nth-child(1), .js .art-rings > *:nth-child(1) > * { animation-delay: 0.06s; }
.js .art-rings > *:nth-child(2), .js .art-rings > *:nth-child(2) > * { animation-delay: 0.14s; }
.js .art-rings > *:nth-child(3), .js .art-rings > *:nth-child(3) > * { animation-delay: 0.22s; }
.js .art-rings > *:nth-child(4), .js .art-rings > *:nth-child(4) > * { animation-delay: 0.30s; }
.js .art-rings > *:nth-child(5), .js .art-rings > *:nth-child(5) > * { animation-delay: 0.38s; }
.js .solid-wrap, .js .solid-wrap > * { animation-delay: 0.52s; }

@media (prefers-reduced-motion: reduce) {
  .js .plate-wrap, .js .solid-wrap { opacity: 1; animation: none; }
  .js .art-plate, .js .art-solid { animation: none; }
}
/* Same cube as the logo, lit from the same side. */
.art-cube-top { fill: var(--color-accent); opacity: 0.78; }
.art-cube-left { fill: var(--color-accent); }
.art-cube-right { fill: var(--color-accent-dark); }

@media (max-width: 900px) {
  .hero-art {
    left: auto;
    top: auto;
    right: -24vw;
    bottom: -14vw;
    width: 74vw;
    transform: none;
    opacity: 0.5;
  }
  #hero { padding-bottom: calc(var(--space-12) + var(--space-6)); }
}
#hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.25rem);
  font-weight: 700;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.015em;
  /* Narrow enough that "From idea to" and "reality." each hold their own line. */
  max-width: 11ch;
  text-wrap: balance;
}
/* Same light-then-bold move as the wordmark: the setup reads quieter than the
   promise it lands on. */
.h1-lead { font-weight: 400; }
.hero-sub {
  margin-top: var(--space-3);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 38ch;
}
.hero-location {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
#hero .btn { margin-top: var(--space-4); }

/* Services */
#services { padding: var(--space-12) 0; }
#services h2 { font-size: 1.75rem; font-weight: 700; font-stretch: 115%; letter-spacing: -0.01em; margin-bottom: var(--space-6); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4) var(--space-4);
}
.service-card {
  padding-top: var(--space-2);
  border-top: 2px solid var(--color-text);
  transition: border-color 0.2s ease;
}
.service-card h3 { transition: color 0.2s ease; }
.service-card:hover { border-top-color: var(--color-accent); }
.service-card:hover h3 { color: var(--color-accent); }
/* Photo sits directly under the rule, same 8:5 block on every card so the grid
   stays even. */
.service-media {
  display: block;
  width: 100%;
  /* height:auto is load-bearing. The width/height attributes on the img become a
     UA presentational hint, so without this the block renders 500px tall. */
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  margin-bottom: 0.75rem;
  background: var(--color-bg-alt);
}
.service-card h3 { font-size: 1.0625rem; font-weight: 700; font-stretch: 108%; margin-bottom: var(--space-1); }
.service-card p { color: var(--color-text-muted); }

@media (max-width: 1000px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* Process */
#process {
  padding: var(--space-12) 0;
  background: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}
#process h2 { font-size: 1.75rem; font-weight: 700; font-stretch: 115%; letter-spacing: -0.01em; margin-bottom: var(--space-6); }
.process-list { display: flex; flex-direction: column; gap: var(--space-3); max-width: 640px; position: relative; }
.process-list li { display: flex; gap: var(--space-3); align-items: flex-start; }
/* The rail runs behind the number chips, so the sequence is something you see
   rather than something you infer from the digits. */
.process-list::before {
  content: "";
  position: absolute;
  left: 1.125rem;
  top: 1.125rem;
  bottom: 1.125rem;
  width: 1px;
  background: var(--color-border);
}
.process-num {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: var(--color-bg);
  font-size: 1.0625rem;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1;
  color: var(--color-accent);
  position: relative;
  z-index: 1;
}
.process-list h3 { font-size: 1.0625rem; font-weight: 700; font-stretch: 108%; margin-bottom: 0.25rem; }
.process-list p { color: var(--color-text-muted); }

/* Contact */
#contact { padding: var(--space-12) 0; }
#contact .container { position: relative; }

/* A wire off the header ending in a bulb you can switch. Fixed to the viewport
   so it stays with you down the page. */
.idea-cord {
  position: fixed;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.idea-cord.is-ready { opacity: 1; }

.cord-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cord-path {
  fill: none;
  stroke: #c2beb3;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke 0.5s ease;
}
.is-lit .cord-path { stroke: #a8a496; }
.pendant {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 127px;
  margin-left: -50px;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
}
.pendant:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 6px;
}
.pendant-art {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;   /* the lit halo spills past the glass */
}
/* pulled down like a cord switch, then sprung back */
.pendant-art.is-pulling { animation: lamp-pull 0.62s; }
@keyframes lamp-pull {
  0% { transform: translateY(0); }
  24% { transform: translateY(8px); }
  36% { transform: translateY(8px); }
  64% { transform: translateY(-2.2px); }
  82% { transform: translateY(0.9px); }
  93% { transform: translateY(-0.35px); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pendant-art.is-pulling { animation: none; }
}
.bulb-cap { fill: var(--color-text); }
.bulb-thread {
  stroke: rgba(247, 247, 245, 0.28);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.bulb-glass {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bulb-tint { fill: #fff; opacity: 0.5; }
.bulb-filament {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
  transition: stroke 0.45s ease, opacity 0.45s ease, stroke-width 0.45s ease;
}
.bulb-shine {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.15;
}
.bulb-halo,
.bulb-warm {
  opacity: 0;
  transition: opacity 0.55s ease;
}
.is-lit .bulb-halo,
.is-lit .bulb-warm { opacity: 1; }
.is-lit .bulb-filament {
  stroke: #f0a91c;
  stroke-width: 2.6;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .bulb-halo,
  .bulb-warm,
  .bulb-filament { transition: none; }
}

/* Needs real margin to hang in, so it only appears on wide screens */
@media (max-width: 1280px) {
  .idea-cord { display: none; }
}

#contact h2 { font-size: 1.75rem; font-weight: 700; font-stretch: 115%; letter-spacing: -0.01em; margin: var(--space-1) 0 var(--space-4); }
.contact-inner { max-width: none; }
/* The form stays narrow for usability, but the section no longer leaves half a
   page empty beside it. */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 290px);
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 1000px) {
  .contact-grid { grid-template-columns: minmax(0, 560px); }
  .contact-aside { margin-top: var(--space-4); }
}
.reply-block {
  margin: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}
.reply-block > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.5rem var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.reply-block > div:last-child { border-bottom: 0; }
.reply-block dt { color: var(--color-text-muted); }
.reply-block dd { margin: 0; text-align: right; }
.reply-block dd a { text-decoration: none; color: var(--color-accent); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.form-row { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: var(--space-3); }
.form-row label { font-weight: 700; font-size: 0.9375rem; }
.form-row input,
.form-row textarea {
  font: inherit;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: #fff;
  color: var(--color-text);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.form-row textarea { resize: vertical; }
.form-row ::placeholder { color: var(--color-text-muted); opacity: 0.7; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; gap: 0; }
}

/* Tap-to-answer rows */
.pick-row { border: none; padding: 0; margin-inline: 0; }
.pick-row legend { padding: 0; font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pill span {
  display: block;
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: #fff;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill span:hover { border-color: var(--color-accent); }
.pill input:checked + span {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.pill input:focus-visible + span {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .pills { gap: 0.375rem; }
  .pill span { padding: 0.6875rem 0.625rem; font-size: 0.875rem; }
}
@media (max-width: 400px) {
  .pills { gap: 0.3125rem; }
  .pill span { padding: 0.6875rem 0.5rem; font-size: 0.8125rem; }
}

#form-status { margin-top: var(--space-3); font-weight: 600; }
#form-status.is-error { color: #b3261e; }
#form-status.is-success { color: #1e6b3e; }

/* Success state */
.form-success {
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: var(--color-bg-alt);
  text-align: center;
  animation: success-in 0.4s ease both;
}
.form-success:focus { outline: none; }
.form-success h3 { font-size: 1.375rem; font-weight: 700; font-stretch: 115%; margin-bottom: var(--space-1); }
.form-success p { color: var(--color-text-muted); }
.success-meta { margin-top: var(--space-3); font-size: 0.9375rem; }
.success-check {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-3);
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-check circle,
.success-check path {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw-check 0.6s ease forwards;
}
.success-check path { animation-delay: 0.35s; }

@keyframes success-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .form-success, .success-check circle, .success-check path { animation: none; }
  .success-check circle, .success-check path { stroke-dashoffset: 0; }
}

/* Scroll reveals. Only active once script.js has confirmed it can drive them,
   so content is never left hidden. */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Footer */
#site-footer { border-top: 1px solid var(--color-border); padding: var(--space-4) 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.footer-inner a { text-decoration: none; }
.footer-made { display: flex; align-items: center; gap: 0.5rem; }
.flag { width: 30px; height: 16px; border: 1px solid var(--color-border); }
