/* ============================================================
   SHIVALLIX — shared styles
   Tokens, reset, nav, footer, buttons, type, reveal utilities.
   Every page links this file in <head>. Page-specific styles
   live in each page's own <style>.
   ============================================================ */

:root {
  /* palette: indigo night + marigold, chalk text */
  --ink:        #110f2e;   /* page background */
  --ink-2:      #181548;   /* raised surface */
  --ink-3:      #232060;   /* hover / borders on surfaces */
  --line:       rgba(244, 239, 230, 0.12);
  --line-strong:rgba(244, 239, 230, 0.28);
  --chalk:      #f4efe6;   /* primary text */
  --mist:       #aca8cc;   /* secondary text */
  --marigold:   #ffb11b;   /* the one accent */
  --marigold-2: #ffc95c;   /* accent hover */
  --sky:        #8fd3ff;   /* used only inside the 3D field */

  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;

  /* type scale (1.25 ratio from 1.0625rem) */
  --t-xs:   0.8125rem;
  --t-sm:   0.9375rem;
  --t-base: 1.0625rem;
  --t-lg:   1.3125rem;
  --t-xl:   1.625rem;
  --t-2xl:  2.0625rem;
  --t-3xl:  2.625rem;
  --t-4xl:  clamp(2.75rem, 6vw, 5.25rem);
  --t-5xl:  clamp(3.25rem, 9vw, 8rem);

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 62ch;
  --nav-h: 76px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--marigold); color: var(--ink); }

a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--t-5xl); font-weight: 800; letter-spacing: -0.035em; font-variation-settings: 'opsz' 96, 'wdth' 100; }
h2 { font-size: var(--t-4xl); letter-spacing: -0.03em; font-variation-settings: 'opsz' 96; }
h3 { font-size: var(--t-2xl); }
h4 { font-size: var(--t-lg); }

p { max-width: var(--measure); }
.lede { font-size: var(--t-lg); line-height: 1.45; color: var(--mist); }
.muted { color: var(--mist); }

/* ── Layout ── */
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
.section { padding-block: clamp(96px, 14vw, 180px); position: relative; }
.section + .section { padding-top: 0; }

.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2vw, 32px); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--t-sm);
  padding: 15px 26px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; line-height: 1;
  transition: background .25s var(--ease-out), color .25s, border-color .25s, transform .25s var(--ease-out);
  white-space: nowrap;
}
.btn-fill { background: var(--marigold); color: var(--ink); }
.btn-fill:hover { background: var(--marigold-2); transform: translateY(-1px); }
.btn-line { border-color: var(--line-strong); color: var(--chalk); }
.btn-line:hover { border-color: var(--chalk); }
.btn-lg { padding: 20px 34px; font-size: var(--t-base); }
.btn .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Plain text link with an underline that draws in */
.link {
  text-decoration: none; position: relative; font-weight: 600; color: var(--chalk);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: left bottom;
  transition: background-size .35s var(--ease-out);
}
.link:hover { background-size: 100% 1px; }

/* ── Nav ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  transition: background .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(17, 15, 46, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.03em;
  text-decoration: none; color: var(--chalk); display: inline-flex; align-items: baseline; gap: 2px;
}
.logo i { font-style: normal; color: var(--marigold); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-clock { color: var(--mist); font-size: var(--t-xs); font-variant-numeric: tabular-nums; margin-right: 14px; display: inline-flex; align-items: center; gap: 8px; }
.nav-clock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #5ee19a; box-shadow: 0 0 8px #5ee19a; }
.nav-links a {
  text-decoration: none; color: var(--mist); font-weight: 500; font-size: var(--t-sm);
  padding: 10px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--chalk); }
.nav-links a.is-active { color: var(--chalk); }
.nav-links a.btn { margin-left: 10px; padding: 11px 20px; color: var(--ink); }
.nav-links a.btn:hover { color: var(--ink); background: var(--marigold-2); }

.hamburger {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px; border-radius: 50%; z-index: 102;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--chalk); transition: transform .3s var(--ease-out), opacity .3s; }
.hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 101; background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; padding-inline: var(--gutter);
  gap: 6px; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 10vw, 3.5rem);
  letter-spacing: -0.03em; text-decoration: none; color: var(--chalk); padding: 8px 0;
  border-bottom: 1px solid var(--line);
  transform: translateY(16px); opacity: 0; transition: transform .5s var(--ease-out), opacity .5s;
}
.mobile-menu.is-open a { transform: none; opacity: 1; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: .05s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: .1s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: .15s; }
.mobile-menu a.is-cta { color: var(--marigold); border-bottom: 0; }
.mobile-menu small { color: var(--mist); margin-top: 28px; font-size: var(--t-sm); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ── Footer ── */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: clamp(56px, 8vw, 96px) var(--gutter) 32px;
  background: var(--ink);
}
.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  max-width: 1440px; margin-inline: auto;
}
.footer-brand p { color: var(--mist); font-size: var(--t-sm); max-width: 30ch; margin-top: 14px; }
.footer h4 { font-family: var(--font-body); font-size: var(--t-sm); font-weight: 600; color: var(--chalk); margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer li a { color: var(--mist); text-decoration: none; font-size: var(--t-sm); transition: color .2s; }
.footer li a:hover { color: var(--chalk); }
.footer-social { display: flex; gap: 8px; margin-top: 22px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: var(--t-xs); font-weight: 600; color: var(--mist); transition: border-color .2s, color .2s;
}
.footer-social a:hover { border-color: var(--marigold); color: var(--marigold); }
.footer-bottom {
  max-width: 1440px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--mist); font-size: var(--t-xs);
}
.footer-bottom a { color: var(--mist); text-decoration: none; margin-left: 18px; }
.footer-bottom a:hover { color: var(--chalk); }
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
.footer-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #5ee19a; box-shadow: 0 0 10px #5ee19a; }

@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* ── WhatsApp ── */
.btn-wa { background: #25d366; color: #0b1f12; border-color: #25d366; }
.btn-wa:hover { background: #3ee07c; transform: translateY(-1px); }
.wa-ico { display: inline-block; width: 18px; height: 18px; border-radius: 50% 50% 50% 4px; border: 2px solid currentColor; position: relative; flex-shrink: 0; }
.wa-ico::after { content: ''; position: absolute; left: 4px; top: 5px; width: 6px; height: 2px; background: currentColor; box-shadow: 0 3px 0 currentColor; border-radius: 1px; }
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: #25d366; color: #0b1f12; text-decoration: none; font-weight: 600; font-size: var(--t-sm);
  padding: 14px 18px 14px 16px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08) inset;
  transition: transform .25s var(--ease-out), background .25s, box-shadow .25s;
}
.wa-float:hover { background: #3ee07c; transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.4); }
.wa-float .wa-ico { width: 22px; height: 22px; }
.wa-float .wa-ico::after { left: 5px; top: 7px; width: 8px; }
@media (max-width: 600px) {
  .wa-float { right: 14px; bottom: 14px; padding: 14px; }
  .wa-float .wa-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ── Scroll reveal utilities (driven by site.js / GSAP) ── */
/* Line splitting helper (home hero) */
[data-reveal-lines] .line { display: block; overflow: hidden; }
.has-gsap .hero [data-reveal-lines] .line > span { display: block; transform: translateY(110%); }

/* Blueprint outline that draws around headings (see site.js initDraw) */
.has-draw { position: relative; width: fit-content; max-width: 100%; justify-self: start; }
.draw-box { position: absolute; inset: -10px -14px; width: calc(100% + 28px); height: calc(100% + 20px); overflow: visible; pointer-events: none; }
.draw-box rect { fill: none; stroke: var(--marigold); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.draw-box .draw-tag { font: 600 11px/1 var(--font-body); fill: var(--marigold); letter-spacing: 0.04em; }

/* Particle box: a canvas that fills whatever element it sits in */
.orb-box { position: relative; pointer-events: none; }
.orb-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-box canvas.is-off { display: none; }
.page { position: relative; z-index: 1; }

/* Subpage hero particle box (top right, behind nothing) */
.page-hero { position: relative; }
.page-hero .orb-box { position: absolute; right: var(--gutter); top: 50%; width: min(38vw, 520px); aspect-ratio: 1; transform: translateY(-50%); }
@media (max-width: 1100px) { .page-hero .orb-box { width: 30vw; opacity: 0.8; } }
@media (max-width: 860px) { .page-hero .orb-box { opacity: 1; position: relative; right: auto; top: auto; transform: none; width: min(70vw, 320px); margin: 0 auto 24px; } }

/* Subpage hero (packages / portfolio / contact / privacy) */
.page-hero { padding: calc(var(--nav-h) + clamp(64px, 10vw, 140px)) 0 clamp(48px, 7vw, 96px); }
.page-hero h1 { font-size: var(--t-4xl); max-width: 14ch; position: relative; z-index: 1; }
.page-hero .lede { margin-top: 24px; max-width: 48ch; position: relative; z-index: 1; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .has-gsap .hero [data-reveal-lines] .line > span { transform: none !important; }
  .draw-box { display: none; }
}
