/* =========================================================
   Trace Solutions — on time. on budget. on target.
   Single stylesheet. No frameworks. Mobile-first.
   ========================================================= */

:root {
  --ink:        #101828;   /* Midnight Blue — primary */
  --ink-soft:   #1E293B;
  --secondary:  #155EEF;   /* Sapphire */
  --accent:     #14B8A6;   /* Teal */
  --accent-ink: #FFFFFF;
  --muted:      #334155;   /* Slate — body text */
  --muted-soft: #64748B;   /* slate-500, for secondary copy */
  --line:       #E2E8F0;   /* slate-200 */
  --bg:         #F8FAFC;   /* Cool White */
  --bg-elev:    #FFFFFF;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.14);

  --container: 1180px;
  --gutter: clamp(20px, 4vw, 48px);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont,
                  'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.6rem, 6vw + 1rem, 5.5rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 2.2vw + 1rem, 3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 1em; color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease,
              color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn--primary:hover { background: var(--secondary); border-color: var(--secondary); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: #fff; }

.btn--small { padding: 10px 16px; font-size: 0.9rem; }
.btn--large { padding: 18px 28px; font-size: 1.1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0; z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}
.brand__logo {
  width: 88px; height: 88px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent);
}
.brand--footer .brand__logo {
  width: 56px; height: 56px;
  box-shadow: 0 0 0 2px var(--accent);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}
.primary-nav a {
  font-weight: 500;
  color: var(--ink);
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
.primary-nav a:hover { border-bottom-color: var(--accent); }
.primary-nav .nav-cta {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border-bottom: none;
}
.primary-nav .nav-cta:hover { background: var(--accent); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 44px; height: 44px;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
}
.section__head {
  max-width: 760px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 120px) var(--gutter) clamp(48px, 6vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 1; }
.hero__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.6vw + 1.1rem, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.35em;
}
.hero__title { margin-top: 0.1em; }
.hero__lede {
  font-size: clamp(1.05rem, 0.8vw + 0.9rem, 1.25rem);
  max-width: 56ch;
  color: var(--muted);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.6rem;
}

.hero__visual {
  position: relative;
  height: clamp(340px, 48vw, 600px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: clamp(-24px, -2vw, -8px);
}
.pcb-image {
  width: 115%;
  height: 115%;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

/* ---------- About ---------- */
.about .section__head {
  margin-inline: auto;
  text-align: center;
}
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.about__lead {
  font-size: clamp(1.1rem, 0.6vw + 1rem, 1.35rem);
  color: var(--ink);
  line-height: 1.5;
}
.about__values {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 14px;
  text-align: center;
}
.about__values li {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.about__values strong { color: var(--ink); }

/* ---------- What we do ---------- */
.section__lede {
  margin-top: 0.6rem;
  font-size: clamp(1.02rem, 0.5vw + 0.95rem, 1.18rem);
  color: var(--muted);
  max-width: 60ch;
}
.work {
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(21,94,239,0.06), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(20,184,166,0.07), transparent 60%);
  border-radius: var(--radius-lg);
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  justify-content: center;
  gap: clamp(18px, 2.4vw, 28px);
}
.work-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.4vw, 32px);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}
.work-card__icon {
  width: clamp(112px, 11vw, 144px);
  height: clamp(112px, 11vw, 144px);
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 6px #F1F5F9;
}
.work-card__icon img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Make any colored line-icons feel cohesive with the brand without
     touching the source files. Mix-blend keeps fine line details. */
  mix-blend-mode: multiply;
}
/* The e-bike source has a lot of white space around the artwork —
   scale it up so it visually matches the size of the other icons. */
.work-card__icon img[src*="e-bike"] {
  transform: scale(1.45);
}
.work-card__title { margin-bottom: 6px; }
.work-card__desc { font-size: 0.98rem; margin: 0; }

/* ---------- Team ---------- */
.team {
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(20,184,166,0.10), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(21,94,239,0.08), transparent 60%);
  border-radius: var(--radius-lg);
}
.team .section__head,
.work .section__head {
  margin-inline: auto;
  text-align: center;
}
.team .section__head .section__lede,
.work .section__head .section__lede { margin-inline: auto; }
.team__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
/* Centered two-up layout for a 2-person team. */
.team__grid--duo {
  grid-template-columns: repeat(2, minmax(0, 340px));
  justify-content: center;
}
.member {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.4vw, 32px);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.member:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}
.member__avatar {
  width: clamp(140px, 16vw, 200px);
  height: clamp(140px, 16vw, 200px);
  border-radius: 50%;
  margin: 0 auto 18px;
  background: #F1F5F9;
  object-fit: cover;
}
.member__name { margin-bottom: 4px; }
.member__role {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.member__bio {
  font-size: 0.98rem;
  margin-bottom: 18px;
}

/* ---------- Experience ---------- */
.experience .section__head {
  margin-inline: auto;
  text-align: center;
}

/* ---------- Logo marquee rows ---------- */
.marquee-row { margin-top: clamp(28px, 3vw, 44px); }
.marquee-row:first-of-type { margin-top: 0; }

.marquee-row__title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  text-align: center;
  margin: 0 0 14px;
}

.marquee {
  position: relative;
  overflow: hidden;
  /* soft fade at the edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 32px);
  width: max-content;
  list-style: none;
  padding: 4px;
  margin: 0;
  animation: marquee-scroll var(--marquee-duration, 38s) linear infinite;
}
.marquee__track--reverse {
  animation-direction: reverse;
}
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.logo-tile {
  flex: 0 0 auto;
  /* Fixed visual footprint so every logo occupies the same space,
     regardless of its native aspect ratio. */
  width: clamp(150px, 16vw, 190px);
  height: clamp(72px, 8vw, 92px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: transparent;
  border-radius: var(--radius-md);
  transition: transform 160ms ease, background-color 160ms ease;
}
.logo-tile:hover {
  transform: translateY(-2px);
  background: var(--bg-elev);
}
.logo-tile span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted-soft);
  white-space: nowrap;
}
.logo-tile img {
  /* Cap the visual height so a tall mark and a wide wordmark read at
     the same optical weight. Width is bounded by the tile's own width. */
  max-width: 100%;
  max-height: clamp(38px, 4.4vw, 52px);
  width: auto;
  height: auto;
  object-fit: contain;
  /* Black-and-white wash for a unified logo wall.
     Hover restores the original color for one logo at a time. */
  filter: grayscale(1) contrast(1.05) brightness(0.85);
  opacity: 0.72;
  transition: filter 220ms ease, opacity 220ms ease;
}
.logo-tile:hover img {
  filter: none;
  opacity: 1;
}
/* Sources with a lot of empty padding baked in — scale up so they
   read at the same visual weight as the others on the wall. */
.logo-tile img[src*="porsche"],
.logo-tile img[src*="rimac"],
.logo-tile img[src*="storck"] {
  transform: scale(1.5);
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(96px, 12vw, 160px); }
.contact__inner {
  position: relative;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 72px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}
/* PCB watermark — colored traces on transparent PNG, used at low
   opacity in the corner of the dark contact panel. */
.contact__inner::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto auto;
  width: 60%;
  aspect-ratio: 5 / 6;
  background: url('assets/pcb-traces.png') no-repeat center / contain;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}
.contact__inner > * { position: relative; z-index: 1; }
.contact__inner .eyebrow { color: var(--accent); }
.contact__title {
  color: #fff;
  font-size: clamp(2rem, 2.2vw + 1rem, 3.2rem);
  max-width: 18ch;
}
.contact__lede {
  color: #CBD5E1;
  max-width: 56ch;
  margin-bottom: 1.6rem;
}
.contact__inner .btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.contact__inner .btn--primary:hover {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.contact-form {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #E2E8F0;
}
.field input, .field textarea {
  font: inherit;
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: #94A3B8; }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.10);
  outline: none;
}
.contact-form button { justify-self: start; }
.contact-form__status {
  grid-column: 1 / -1;
  font-size: 0.95rem;
  margin: 0;
  min-height: 1.2em;
  color: #CBD5E1;
}
.contact-form__status.is-success {
  color: var(--accent);
  font-weight: 600;
}
.contact-form__status.is-error {
  color: #FCA5A5;
  font-weight: 600;
}
.contact-form button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer__meta { color: var(--muted-soft); margin: 0; font-size: 0.9rem; }
.brand--footer { gap: 14px; }
.site-footer__tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    order: -1;
    height: clamp(220px, 50vw, 340px);
  }
  .about__grid { grid-template-columns: 1fr; }
  .team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute;
    top: 100%; right: var(--gutter);
    left: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    transform-origin: top right;
    transform: scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 160ms ease, opacity 160ms ease;
  }
  .primary-nav.is-open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav a {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .primary-nav a:last-child { border-bottom: 0; }
  .primary-nav .nav-cta {
    margin-top: 6px;
    border-radius: var(--radius-sm);
    text-align: center;
  }

  .team__grid { grid-template-columns: 1fr; }
  .work__grid { grid-template-columns: 1fr; }
  .timeline__item { padding-left: 76px; }
  .contact-form { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
