/* fractal. — shared design tokens + components (nav, buttons, footer, mobile).
   Linked from index.html, hola.html, film.html. Page-specific styles (hero,
   phone widget, field demo, work cards, etc.) stay inline per page. */

:root {
  --snow: #FCFCFD;
  --cloud: #F4F6F8;
  --mist: #E7EBEF;
  --ink: #161A21;
  --slate: #5B636E;
  --ash: #9AA2AD;
  --azure: #3E6BFF;
  --azure-soft: #EAF0FF;
  --sky: #7FA0FF;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1080px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.625;
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; color: var(--ink); margin: 0; }
p { margin: 0; color: var(--slate); }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ash);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
section { padding: 128px 0; }
@media (max-width: 720px) {
  section { padding: 84px 0; }
  .container { padding: 0 24px; }
}

/* Pre-animation states (GSAP/ScrollTrigger reveal primitives) ------------ */
[data-reveal] { opacity: 0; transform: translateY(14px); }
.no-motion [data-reveal] { opacity: 1 !important; transform: none !important; }
.reveal-line { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0; line-height: 1.05; }
.reveal-line > span { display: inline-block; will-change: transform; }
body:not(.anim-ready):not(.no-motion) .reveal-line > span { visibility: hidden; }

/* Video poster component (film.html gallery + any page referencing a real video) */
.vid-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  cursor: pointer;
  overflow: hidden;
}
.vid-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0.92;
  transition: opacity 320ms var(--ease), transform 600ms var(--ease);
}
.vid-frame:hover img { opacity: 1; transform: scale(1.03); }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 999px;
  background: rgba(22, 26, 33, 0.82);
  border: 1px solid rgba(252, 252, 253, 0.25);
  display: flex; align-items: center; justify-content: center;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
  pointer-events: none;
}
.vid-frame:hover .play { background: rgba(22, 26, 33, 0.95); transform: translate(-50%, -50%) scale(1.06); }
.play svg { width: 18px; height: 18px; fill: var(--snow); margin-left: 3px; }

/* Fractal motif — sparing, static decorative line/fold system ------------- */
.motif-fold { position: absolute; pointer-events: none; z-index: 0; opacity: 0.9; }
.motif-fold svg { width: 100%; height: 100%; display: block; }
.motif-fold--tr { top: -10%; right: -6%; width: 260px; height: 260px; }
.motif-fold--bl { bottom: -8%; left: -8%; width: 220px; height: 220px; }
@media (max-width: 720px) { .motif-fold { display: none; } }

/* Section heads --------------------------------------------------------- */
.section-head { margin-bottom: 72px; }
.section-head .eyebrow { display: inline-block; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; max-width: 22ch; }
.section-head p { margin-top: 18px; max-width: 60ch; font-size: 17px; }

/* Nav --------------------------------------------------------------------
   Fixed, blurred, hides on scroll-down (site-wide, JS in js/nav.js). */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: rgba(252, 252, 253, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--mist);
  transition: transform 420ms var(--ease);
}
.nav.nav-hidden { transform: translateY(-100%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 18px; letter-spacing: -0.04em; color: var(--ink);
}
.wordmark .dot { color: var(--azure); }
.wordmark svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a:not(.nav-cta) { font-weight: 500; font-size: 14px; color: var(--slate); transition: color 200ms var(--ease); }
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--mist); border-radius: 8px;
  font-weight: 500; font-size: 14px; color: var(--ink) !important;
  transition: background 200ms var(--ease);
}
.nav-cta:hover { background: var(--cloud); }

/* Hamburger toggle (mobile only) */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--mist); border-radius: 8px;
  cursor: pointer; padding: 0;
}
.nav-burger svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 720px) {
  .nav-links > a:not(.nav-cta) { display: none; }
  .nav-burger { display: inline-flex; }
}

/* Mobile drawer menu (built by js/nav.js, works with no JS: nav-cta still visible) */
.nav-drawer-backdrop {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(22,26,33,0.32);
  opacity: 0; animation: navFade 220ms var(--ease) forwards;
}
.nav-drawer-backdrop[hidden] { display: none; }
@keyframes navFade { to { opacity: 1; } }
.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 96;
  width: 300px; max-width: 84vw;
  background: var(--snow);
  border-left: 1px solid var(--mist);
  padding: 20px 24px 28px;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  animation: navSlide 280ms var(--ease) forwards;
}
.nav-drawer[hidden] { display: none; }
@keyframes navSlide { to { transform: translateX(0); } }
.nav-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.nav-drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 0; color: var(--slate); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-drawer-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-drawer-links { display: flex; flex-direction: column; gap: 4px; }
.nav-drawer-links a:not(.btn) {
  padding: 14px 4px; font-size: 16px; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--mist);
}
.nav-drawer-links .btn { margin-top: 20px; justify-content: center; }

/* Sticky mobile CTA bar (appears after hero scrolls out) */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--snow);
  border-top: 1px solid var(--mist);
  box-shadow: 0 -8px 24px rgba(22,26,33,0.06);
  transform: translateY(100%);
  transition: transform 280ms var(--ease);
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .btn { width: 100%; justify-content: center; }
@media (max-width: 720px) { .sticky-cta { display: block; } }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 8px;
  font-family: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer; border: 1px solid transparent;
  position: relative;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}
.btn .btn-inner {
  display: inline-flex; align-items: center; gap: 8px;
  pointer-events: none;
  transition: transform 220ms var(--ease);
}
.btn:hover .btn-inner { transform: translateX(2px); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-primary, .btn-ink { background: var(--azure); color: var(--snow); }
.btn-primary:hover, .btn-ink:hover { background: #3560E8; }
.btn-primary:focus-visible, .btn-ink:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--azure-soft); }
.btn-secondary { background: var(--snow); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--snow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--mist); }
.btn-ghost:hover { background: var(--cloud); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.magnetic { will-change: transform; }

/* Chips (audience cue, sketch, etc.) --------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-static {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 14px;
  border: 1px solid var(--mist); border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--slate);
}

/* Footer -------------------------------------------------------------------- */
footer { background: var(--ink); color: var(--ash); padding: 96px 0 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 64px; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 48px; } }
footer .wordmark { color: var(--snow); font-size: 22px; }
footer .wordmark .dot { color: var(--sky); }
footer p { color: var(--ash); font-size: 14px; margin-top: 20px; max-width: 36ch; }
footer h4 {
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--snow); margin: 0 0 20px;
}
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
footer ul a { font-size: 14px; color: var(--ash); transition: color 200ms var(--ease); }
footer ul a:hover { color: var(--snow); }
.footer-bottom {
  margin-top: 72px; padding-top: 32px;
  border-top: 1px solid #2A2F38;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--ash);
}

/* Simple footer variant (hola.html / film.html) */
footer.simple { background: var(--snow); color: var(--ash); border-top: 1px solid var(--mist); padding: 40px 0; }
.foot-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--ash); }
.foot-inner a { color: var(--slate); font-weight: 500; }
.foot-inner a:hover { color: var(--ink); }

/* Reduced motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reveal-line > span { visibility: visible !important; transform: none !important; }
  [data-fade] { opacity: 1 !important; transform: none !important; }
}
