/* ==========================================================================
   Webletica — base.css
   Design tokens, fonts, reset, typography, buttons, layout primitives.
   Layout uses flexbox only (maps 1:1 to Elementor flex containers).
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (→ Elementor Site Settings: Global Colors / Fonts) ---------- */
:root {
  /* Colors */
  --c-bg: #0a0a0d;
  --c-bg-2: #0f0f14;
  --c-surface: #14141b;
  --c-surface-2: #1b1b24;
  --c-line: rgba(255, 255, 255, 0.08);
  --c-line-2: rgba(255, 255, 255, 0.16);
  --c-text: #f4f4f0;
  --c-muted: #a6a6b0;
  --c-dim: #8b8b97;
  --c-volt: #d7ff3a;          /* accent 1 */
  --c-volt-ink: #0a0a0d;      /* text on volt */
  --c-violet: #8c7bff;        /* accent 2, used sparingly */

  /* Type */
  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing & shape */
  --container: 1240px;
  --container-narrow: 780px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(88px, 11vw, 168px);
  --radius: 22px;
  --radius-sm: 12px;
  --header-h: 76px;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
::selection { background: var(--c-volt); color: var(--c-volt-ink); }

:focus-visible {
  outline: 2px solid var(--c-volt);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--c-volt);
  color: var(--c-volt-ink);
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--c-text);
  text-wrap: balance;
}
.h-display {
  font-size: clamp(3rem, 8.2vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: -0.048em;
  font-weight: 700;
}
h1, .h1 {
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.042em;
}
h2, .h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.036em;
}
h3, .h3 {
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
}
h4, .h4 {
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 650;
}
.text-accent { color: var(--c-volt); }
.text-muted { color: var(--c-muted); }
.lead {
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--c-muted);
  max-width: 62ch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-volt);
}
.kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 12px rgba(215, 255, 58, 0.6);
}

.mono {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

/* ---------- Buttons (→ Elementor Button widget + CSS class) ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-line-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  padding: 0.95em 1.5em;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
    background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.35s var(--ease-out);
}
.btn:hover svg { transform: translateX(4px); }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  --btn-bg: var(--c-volt);
  --btn-fg: var(--c-volt-ink);
  --btn-bd: var(--c-volt);
}
.btn-primary:hover {
  box-shadow: 0 14px 40px -10px rgba(215, 255, 58, 0.55);
}
.btn-ghost:hover {
  --btn-bd: var(--c-volt);
  --btn-fg: var(--c-volt);
}
.btn-small {
  padding: 0.7em 1.15em;
  font-size: 0.9rem;
}
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-line-2);
  padding-bottom: 4px;
  transition: color 0.25s, border-color 0.25s, gap 0.3s var(--ease-out);
}
.link-arrow svg { width: 16px; height: 16px; }
.link-arrow:hover {
  color: var(--c-volt);
  border-color: var(--c-volt);
  gap: 0.8em;
}

/* ---------- Layout primitives (flex only) ---------- */
/* .section  = Elementor outer container (full width)
   .container = Elementor inner container (boxed)
   .row       = Elementor container, direction row, wrap
   .col-*     = child containers with % width            */
.section {
  position: relative;
  padding-block: var(--section-y);
}
.section-tight { padding-block: clamp(56px, 7vw, 96px); }
.section-alt { background: var(--c-bg-2); }
.section-line { border-top: 1px solid var(--c-line); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 3vw, 40px);
}
.row-center { align-items: center; }
.row-between { justify-content: space-between; }
.row-end { align-items: flex-end; }
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.col { flex: 1 1 0; min-width: 0; }
.col-40 { flex: 0 1 calc(40% - 20px); min-width: 0; }
.col-50 { flex: 0 1 calc(50% - 20px); min-width: 0; }
.col-60 { flex: 0 1 calc(60% - 20px); min-width: 0; }
.col-33 { flex: 1 1 calc(33.333% - 27px); min-width: 260px; }
.col-25 { flex: 1 1 calc(25% - 30px); min-width: 220px; }

@media (max-width: 900px) {
  .col-40, .col-50, .col-60 { flex-basis: 100%; }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head .section-head-text { flex: 1 1 520px; max-width: 760px; }
.section-head h2 { margin-bottom: 0.35em; }
.section-head .lead { margin: 0; }

/* ---------- Reveal on scroll (→ Elementor Motion Effects: Fade In Up) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Spacing utilities ---------- */
.mt-section { margin-top: clamp(48px, 6vw, 88px); }
.mt-md { margin-top: 32px; }
figure { margin: 0; }
a.browser-frame { display: block; }
.stack-start { align-items: flex-start; }
