/* Tilzen — light/dark technical theme. Brand: blue #3d8bfd */

:root {
  color-scheme: light;
  --bg:          #f6f8fb;
  --bg-alt:      #edf1f6;
  --surface:     #ffffff;
  --line:        #dbe1ea;
  --text:        #171b22;
  --muted:       #545f6d;
  --faint:       #8b96a4;
  --accent:      #2e6fe0;
  --accent-hi:   #3d8bfd;
  --accent-soft: rgba(46, 111, 224, 0.08);
  --accent-line: rgba(46, 111, 224, 0.35);
  --nav-bg:      rgba(246, 248, 251, 0.82);
  --shot-shadow: 0 24px 60px rgba(23, 37, 61, 0.16);
  --mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans:      "Fira Sans", system-ui, -apple-system, sans-serif;
  --display:   "Space Grotesk", var(--sans);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0b0d10;
  --bg-alt:      #10131a;
  --surface:     #151922;
  --line:        #232a35;
  --text:        #e9edf2;
  --muted:       #9aa5b1;
  --faint:       #5c6673;
  --accent:      #3d8bfd;
  --accent-hi:   #6aa6ff;
  --accent-soft: rgba(61, 139, 253, 0.07);
  --accent-line: rgba(61, 139, 253, 0.35);
  --nav-bg:      rgba(11, 13, 16, 0.82);
  --shot-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 780px; }

::selection { background: var(--accent); color: #fff; }

/* ---------- typography ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 1.1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.kicker::before { content: "// "; color: var(--muted); }

.content p { color: var(--muted); margin-bottom: 1rem; }
.content strong { color: var(--text); font-weight: 600; }
.content em { color: var(--text); }
.content a { color: var(--accent-hi); }

.content ul {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0;
  display: grid;
  gap: 0.9rem;
}
.content ul li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
}
.content ul li::before {
  content: "▸";
  position: absolute;
  left: 0.2rem;
  color: var(--accent);
}
.content ul li strong { color: var(--text); }

code { font-family: var(--mono); font-size: 0.9em; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand img { display: block; }

.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta { color: var(--accent-hi); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
.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); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-hi); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- hero ---------- */

.hero {
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  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;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}
.hero .wrap { position: relative; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-copy h1 {
  max-width: 14ch;
  margin-bottom: 1.2rem;
}
.hero-line {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 2rem;
}
.hero-line strong { color: var(--text); }

.hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.hero-shot { margin: 0; }
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shot-shadow);
}
.hero-shot figcaption {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hi); }

/* ---------- sections ---------- */

[id] { scroll-margin-top: 84px; }

.section { padding: clamp(3.5rem, 8vh, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

/* ---------- services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.6rem;
  margin-top: 2rem;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}
.service-card:hover { border-color: var(--accent-line); }

/* ---------- stack strip ---------- */

.stack-strip {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.2rem;
}
.stack-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.7rem;
}
.stack-legacy .stack-label { color: var(--muted); }
.stack-modern .stack-label { color: var(--accent-hi); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.stack-modern .chip {
  border-color: var(--accent-line);
  color: var(--text);
  background: var(--accent-soft);
}
.stack-arrow { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  text-align: center;
}
.footer-inner { display: grid; gap: 0.6rem; justify-items: center; }
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer .muted { color: var(--faint); font-size: 0.82rem; }

/* ---------- reveal animation ---------- */

.js .section .wrap > *,
.js .service-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .section .wrap.in > *,
.js .service-card.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section .wrap > *, .service-card { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot { max-width: 640px; }
}

@media (max-width: 800px) {
  .services { grid-template-columns: 1fr; }
  .stack-strip { grid-template-columns: 1fr; }
  .stack-arrow { transform: rotate(90deg); justify-self: center; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 24px 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0; width: 100%; }
}

/* ---------- distribuidores form ---------- */

.dist-form { margin-top: 1.8rem; display: grid; gap: 1.1rem; justify-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; width: 100%; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.form-grid input {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  transition: border-color 0.15s;
}
.form-grid input:focus { outline: none; border-color: var(--accent); }
.form-msg { font-size: 0.9rem; min-height: 1.2em; }
.form-msg.ok { color: #2fa35f; }
.form-msg.err { color: #d05555; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
