:root {
  --ink: #0b1220;
  --ink-2: #111a2c;
  --ink-3: #18233a;
  --line: #24314d;
  --text: #e8ecf4;
  --muted: #9aa6bf;
  --accent: #f5b544;
  --accent-2: #ffd27f;
  --ok: #3ddc97;
  --radius: 16px;
  --max: 1160px;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.lead { color: var(--muted); font-size: 1.12rem; max-width: 60ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font: inherit; font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background .2s, transform .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--ink-3); border-color: var(--accent); color: var(--text); }
.btn--sm { padding: 9px 18px; font-size: .92rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand__name { font-weight: 500; letter-spacing: .08em; font-size: 1rem; }
.brand__name b { font-weight: 800; }
.nav__links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav__links a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; transition: color .2s; }
.nav__links a:not(.btn):hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__tools { display: flex; align-items: center; gap: 12px; }

.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  background: none; border: 0; color: var(--muted);
  font: inherit; font-size: .78rem; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink-3); color: var(--accent); }

.nav__toggle {
  display: none;
  width: 42px; height: 42px;
  background: none; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; position: relative;
}
.nav__toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text);
  transition: transform .2s, top .2s;
}
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 24px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 110px) 0 clamp(64px, 9vw, 120px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 80% 30%, rgba(245, 181, 68, .12), transparent 70%),
    radial-gradient(500px 400px at 10% 90%, rgba(91, 140, 255, .08), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .18;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.hero__visual { position: relative; margin: 0; }
.flow { width: 100%; max-width: 460px; margin-inline: auto; }
.flow__line { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 6; }
.flow__pulse { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.flow__ring { transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; }
@keyframes ring { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }

.chip {
  position: absolute;
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 8px 14px 8px 30px;
  border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.chip::before {
  content: ""; position: absolute; left: 12px; top: 50%;
  width: 8px; height: 8px; border-radius: 50%; transform: translateY(-50%);
}
.chip--a { top: 4%; right: 2%; animation: float 5s ease-in-out infinite; }
.chip--a::before { background: var(--ok); }
.chip--b { bottom: 30%; left: 0; animation: float 5s ease-in-out 1.5s infinite; }
.chip--b::before { background: var(--accent); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Sections */
.section { padding: clamp(72px, 9vw, 120px) 0; }
.section--alt { background: var(--ink-2); border-block: 1px solid var(--line); }
.section--page { padding-top: clamp(48px, 7vw, 88px); }
.section__head { max-width: 720px; margin-bottom: 56px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(245, 181, 68, .5); transform: translateY(-3px); }
.card p { color: var(--muted); }
.card ul { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--line); padding-top: 18px; }
.card li { position: relative; padding-left: 24px; margin-bottom: 8px; font-size: .95rem; }
.card li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.card__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(245, 181, 68, .1);
  border: 1px solid rgba(245, 181, 68, .25);
  margin-bottom: 22px;
}
.card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Split / stack */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split .lead { margin-bottom: 2rem; }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.stack li {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.stack li:nth-child(2) { margin-left: 28px; }
.stack li:nth-child(3) { margin-left: 56px; border-color: rgba(245, 181, 68, .45); }
.stack h3 { margin-bottom: .3em; }
.stack p { color: var(--muted); margin: 0; }
.stack__n { font-weight: 800; color: var(--accent); font-size: .95rem; padding-top: 2px; }

/* PCB gallery: equal tiles; click one to see it whole (lightbox below) */
.pcb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shot {
  position: relative; margin: 0; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  font-size: .78rem; font-weight: 600; line-height: 1.4;
  background: linear-gradient(transparent, rgba(11, 18, 32, .92) 50%);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.shot--ill img { object-fit: contain; padding: 4px; }
.shot--ill:hover img { transform: none; }
.shot--ill figcaption { display: none; }        /* full caption shown in the lightbox */
.shot__tag {
  position: absolute; top: 10px; left: 10px;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(11, 18, 32, .85);
  border: 1px solid rgba(245, 181, 68, .35);
  padding: 3px 9px; border-radius: 999px;
}
.shot--tall img { object-position: center 30%; }
.shot--panel img { object-position: center 45%; }
.shot--wide img { object-position: 45% center; }
.shot--proto img { object-position: center 55%; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 92vh;
  color: var(--text);
}
.lightbox::backdrop { background: rgba(5, 9, 18, .88); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 12px; background: var(--ink-2); }
.lightbox figcaption { margin-top: 12px; text-align: center; font-weight: 600; color: var(--muted); }
.lightbox figcaption:empty { display: none; }
.lightbox__close {
  position: fixed; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--ink-2); color: var(--text);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}

.hw__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.pcb-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  margin-top: 56px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2);
}
.pcb-cta p { margin: 0; font-size: 1.15rem; font-weight: 700; }
.pcb-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-top: 32px; }
.techs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 640px; }
.techs li {
  font-size: .85rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink-2); color: var(--text);
}
.process { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; counter-reset: p; }
.process li { counter-increment: p; font-size: .9rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; }
.process li::before {
  content: counter(p); display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent); font-size: .72rem; font-weight: 800;
}
.process li:not(:last-child)::after { content: ""; width: 22px; height: 1.5px; background: var(--line); margin: 0 10px; }

/* Steps */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  position: relative;
}
.steps::before {
  content: ""; position: absolute; top: 22px; left: 22px; right: 22px;
  height: 2px; background: linear-gradient(90deg, var(--accent), var(--line));
}
.steps li { position: relative; }
.steps p { color: var(--muted); }
.steps__dot {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--accent); color: var(--accent);
  font-weight: 800; margin-bottom: 20px;
}

/* Projects */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.project h3 { font-size: 1.35rem; margin-top: 14px; }
.project p { color: var(--muted); margin: 0; }
.project__link { text-decoration: none; }
.project__link span { color: var(--accent); font-size: .9em; }
.project__link:hover { color: var(--accent); }
.tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: rgba(245, 181, 68, .1);
  border: 1px solid rgba(245, 181, 68, .25);
  padding: 4px 10px; border-radius: 999px;
}

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact__list { list-style: none; padding: 0; margin: 2rem 0 0; }
.contact__list li { display: flex; gap: 12px; color: var(--muted); margin-bottom: 8px; }
.contact__list li > span { min-width: 80px; }
.contact__list a { color: var(--text); font-weight: 600; }
.form {
  display: grid; gap: 18px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.form input, .form select, .form textarea {
  font: inherit; color: var(--text);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form [aria-invalid="true"] { border-color: #ff6b6b; }
.form__status { margin: 0; font-size: .9rem; min-height: 1.4em; color: var(--muted); }

/* WhatsApp floating button */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25d366;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; color: var(--muted); font-size: .9rem; }
.footer__inner p { margin: 0; }
.footer__copy { margin-left: auto !important; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
  .hero__inner, .split, .contact { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { max-width: 460px; width: 100%; margin-inline: auto; }
  .cards, .projects { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
  .stack li:nth-child(n) { margin-left: 0; }
}

@media (max-width: 640px) {
  .pcb-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .shot { border-radius: 10px; }
  .shot figcaption { display: none; }           /* tiles are small here; captions open with the photo */
}

@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); border-bottom: 1px solid var(--line);
    padding: 8px 20px 20px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: 16px; }
}

@media (max-width: 560px) {
  .nav__inner { gap: 10px; }
  .nav__tools { gap: 8px; }
  .brand__name { font-size: .9rem; letter-spacing: .05em; }
  .lang button { padding: 5px 8px; }
  .steps { grid-template-columns: 1fr; }
  .chip { font-size: .72rem; }
  .footer__copy { margin-left: 0 !important; }
}

@media (max-width: 360px) {
  .container { width: calc(100% - 24px); }
  .brand { gap: 7px; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: .8rem; letter-spacing: .03em; }
  .lang button { padding: 4px 6px; font-size: .72rem; }
  .nav__toggle { width: 38px; height: 38px; }
  .nav__toggle span { left: 10px; right: 10px; }
  .nav__toggle span:first-child { top: 13px; }
  .nav__toggle span:last-child { top: 22px; }
  .nav__toggle[aria-expanded="true"] span:first-child,
  .nav__toggle[aria-expanded="true"] span:last-child { top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .flow__pulse { display: none; }
  .reveal { opacity: 1; transform: none; }
}
