/* ============================================================
   KOTIA - BASE / GLOBAL
   ============================================================ */
@import "grid.css";

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

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

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.container { padding-left: var(--pad-x); padding-right: var(--pad-x); }

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

/* ---------- NAV ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 105;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid transparent;
  transition: transform 0.4s var(--ease-out), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), backdrop-filter var(--dur-base) var(--ease-out);
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.nav-open .nav {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav-progress {
  position: absolute; bottom: -1px; left: 0;
  height: 1px; background: var(--gradient-forge);
  width: 0%; z-index: 100;
  transition: width 0.1s linear;
}

.nav-brand { display: flex; align-items: center; gap: 0.7rem; z-index: 101; }
.nav-brand .nav-logo-mark { width: 30px; height: auto; display: block; }
.nav-brand .wave { stroke: var(--accent); transition: stroke 0.4s var(--ease-inout); }
.nav-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nav-brand .nav-brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem; letter-spacing: 0.1em; font-weight: 700;
  line-height: 1;
}
.nav-brand .nav-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.55rem; letter-spacing: 0.15em; font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-links { display: flex; gap: 2.4rem; }
.nav-links a {
  position: relative; font-size: 0.92rem; padding: 4px 0;
  color: var(--text-dim);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after {
  transform: scaleX(1); transform-origin: left;
}

.nav-right { display: flex; align-items: center; gap: 1.1rem; z-index: 101; }

/* Theme toggle: viewfinder brackets close on hover */
.theme-toggle {
  position: relative; width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: color var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover, .nav-back:hover { color: var(--text); }
form input:focus,
form textarea:focus,
form select:focus {
  border-bottom-color: var(--accent);
  outline: none;
}
.form-row {
  display: flex;
  gap: 1.5rem;
  flex-direction: column;
}
@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
  }
  .form-row > * {
    flex: 1;
  }
}
.form-submit {
  width: 100%;
}
.theme-toggle .bracket {
  position: absolute; width: 9px; height: 9px;
  border-color: var(--accent); border-style: solid; border-width: 0;
  opacity: 0; transition: all var(--dur-fast) var(--ease-out);
}
.theme-toggle .b-tl { top: 4px; left: 4px; border-top-width: 1.5px; border-left-width: 1.5px; }
.theme-toggle .b-tr { top: 4px; right: 4px; border-top-width: 1.5px; border-right-width: 1.5px; }
.theme-toggle .b-bl { bottom: 4px; left: 4px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.theme-toggle .b-br { bottom: 4px; right: 4px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.theme-toggle:hover .bracket { opacity: 1; }
.theme-toggle:hover .b-tl { top: 1px; left: 1px; }
.theme-toggle:hover .b-tr { top: 1px; right: 1px; }
.theme-toggle:hover .b-bl { bottom: 1px; left: 1px; }
.theme-toggle:hover .b-br { bottom: 1px; right: 1px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Route-drawing CTA (nav + hero primary) */
.cta-route {
  position: relative; display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 500;
  padding: 0.72rem 1.35rem;
  color: var(--on-accent); background: var(--accent);
  transition: background-color var(--dur-fast) var(--ease-out), transform 0.15s var(--ease-out);
  overflow: hidden;
  border-radius: var(--radius);
}
.cta-route:hover { background: var(--accent-bright); }
.cta-route:active { transform: scale(0.97); }
.cta-route .route {
  width: 26px; height: 10px; overflow: visible; flex-shrink: 0;
}
.cta-route .route path {
  stroke: currentColor; stroke-width: 1.5; fill: none;
  stroke-dasharray: 3 3;
}
.cta-route .route .head {
  transition: transform var(--dur-base) var(--ease-out);
}
.cta-route:hover .route .head { transform: translateX(6px); }

/* Hairline text link */
.link-hairline {
  position: relative; display: inline-block;
  font-family: var(--font-display); font-size: 0.92rem;
  padding-bottom: 3px; color: var(--text);
}
.link-hairline::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--line-strong);
}
.link-hairline::before {
  content: ""; position: absolute; left: 0; bottom: 0; z-index: 1;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-base) var(--ease-out);
}
.link-hairline:hover::before { transform: scaleX(1); transform-origin: left; }

/* Mobile nav */
.nav-burger { display: none; z-index: 101; width: 38px; height: 38px; position: relative; background: transparent; border: none; cursor: pointer; }
.nav-burger span {
  position: absolute; left: 8px; right: 8px; height: 1.5px;
  background: var(--text); transition: all var(--dur-fast) var(--ease-out);
}
.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 22px; }
.nav-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }
.nav-overlay-links a {
  font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3.2rem);
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  display: flex; align-items: center; gap: 1rem;
}
.nav-overlay-links a i { color: var(--accent); font-size: 0.85em; }
.nav-overlay-social a {
  font-size: 1.8rem; color: var(--text-dim); transition: color var(--dur-fast);
}
.nav-overlay-social a:hover { color: var(--text); }
.nav-overlay.open .nav-overlay-logo { opacity: 1 !important; transform: none !important; transition-delay: 0.05s !important; }
.nav-overlay.open .nav-overlay-links a { opacity: 1; transform: none; }
.nav-overlay.open .nav-overlay-links a:nth-child(1) { transition-delay: 0.1s; }
.nav-overlay.open .nav-overlay-links a:nth-child(2) { transition-delay: 0.15s; }
.nav-overlay.open .nav-overlay-links a:nth-child(3) { transition-delay: 0.2s; }
.nav-overlay.open .nav-overlay-links a:nth-child(4) { transition-delay: 0.25s; }
.nav-overlay.open .nav-overlay-social { opacity: 1 !important; transform: none !important; transition-delay: 0.3s !important; }
body.nav-open { overflow: hidden; }
body.nav-open .nav-burger span:nth-child(1) { top: 18px; transform: rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { top: 18px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-right .cta-route { display: none; }
}

/* ---------- KM READOUT ---------- */

.km-readout {
  position: fixed; left: var(--pad-x); bottom: 1.4rem; z-index: 80;
  font-family: var(--font-mono); font-size: var(--text-mono);
  letter-spacing: 0.12em; color: var(--text-dim);
  display: flex; align-items: center; gap: 0.6rem;
  pointer-events: none;
}
.km-readout::before {
  content: ""; width: 22px; height: 1px; background: var(--accent);
}
@media (max-width: 768px) { .km-readout { display: none; } }

/* ---------- FOOTER ---------- */

.footer { position: relative; border-top: 1px solid var(--line); margin-top: var(--section-gap); overflow: hidden; }
.footer-ghost {
  position: absolute; bottom: -0.1em; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 26vw; font-weight: 700;
  line-height: 0.8; color: var(--text); opacity: 0.06;
  z-index: -1; white-space: nowrap; pointer-events: none;
}
.footer-route { 
  position: relative; height: 64px; margin: 0 var(--pad-x); 
  cursor: pointer;
}
.footer-route svg { width: 100%; height: 100%; overflow: visible; }
.footer-route .track { 
  stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; fill: none; 
  animation: trackScroll 10s linear infinite;
}
@keyframes trackScroll {
  to { stroke-dashoffset: -100; }
}
.footer-route .node-dot {
  fill: var(--bg); stroke: var(--accent); stroke-width: 2;
  transition: fill var(--dur-base) var(--ease-out), filter var(--dur-base) var(--ease-out);
}
.footer-route:hover .node-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(244, 67, 33, 0.8));
}
.footer-route .check { 
  stroke: var(--accent); stroke-dasharray: 24; stroke-dashoffset: 24; 
  filter: drop-shadow(0 0 4px rgba(244, 67, 33, 0.6));
}
.footer-route text {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  fill: var(--text-dim); text-transform: uppercase;
  transition: fill var(--dur-base) ease;
}
.footer-route:hover text {
  fill: var(--bone);
}
:root[data-theme="light"] .footer-route:hover text {
  fill: var(--ink);
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem; padding: 2.8rem var(--pad-x) 3.2rem;
}
.footer-grid h4 {
  font-family: var(--font-mono); font-size: var(--text-mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1.1rem; font-weight: 400;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-grid a { color: var(--text-dim); font-size: 0.92rem; transition: color var(--dur-fast); }
.footer-grid a:hover { color: var(--text); }
.footer-brand p { color: var(--text-dim); font-size: 0.92rem; max-width: 34ch; margin-top: 1rem; }
.social-row { display: flex; gap: 1rem; margin-top: 1.5rem; }
.social-row a { display: flex; color: var(--text-dim); transition: color var(--dur-fast); }
.social-row a:hover { color: var(--text); }
.social-row svg { width: 20px; height: 20px; }
.btn-whatsapp {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.5rem; padding: 0.6rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-display); font-size: 0.92rem; font-weight: 500;
  border-radius: 4px; transition: border-color var(--dur-fast);
}
.btn-whatsapp svg { width: 18px; height: 18px; fill: var(--accent); }
.btn-whatsapp:hover { border-color: var(--accent); color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between;
  padding: 1.3rem var(--pad-x);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--text-mono);
  letter-spacing: 0.08em; color: var(--text-dim);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- SCROLL REVEALS ----------
   Rule: nothing may sit fully invisible waiting on a viewport trigger.
   Animate from visible-but-offset/blurred states only, so a headless
   screenshot taken at any point still shows real, legible content. */

.reveal {
  transform: translateY(22px);
  filter: blur(5px);
}
.reveal.in {
  transform: none; filter: blur(0);
  transition: transform 0.7s var(--ease-out), filter 0.7s var(--ease-out);
}

/* ---------- DEV VARIANT SWITCHER (removed at launch) ---------- */

.dev-switcher {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 200;
  display: flex; gap: 6px; padding: 8px;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em;
}
.dev-switcher button {
  padding: 5px 9px; border: 1px solid var(--line);
  color: var(--text-dim); text-transform: uppercase;
}
.dev-switcher button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
