/* ==========================================================================
   LAMBALI: SHARED DESIGN SYSTEM
   Loaded on every page through assets/meta.php.
   Palette comes from the logo: royal blue shield, gold, teal lettering.
   Page-specific styles live in home.css and pages.css.
   ========================================================================== */

:root {
  /* Brand */
  --navy: #0a1a3f;
  --navy-2: #122a5c;
  --blue: #1f5bd8;
  --blue-dk: #1647b0;
  --blue-soft: #e8efff;
  --blue-line: #cfdcf7;
  --gold: #f2b01e;
  --gold-dk: #c98a00;
  --gold-soft: #fff6dc;
  --teal: #0f9d9a;
  --teal-soft: #dff6f4;
  --stamp: #d4353b;

  /* Text and surfaces */
  --ink: #0a1a3f;
  --ink-2: #122a5c;
  --ink-soft: #33415f;
  --muted: #5b6b8a;
  --line: #dbe3f3;
  --bg: #f7f9ff;
  --card: #ffffff;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #c0392b;
  --red-bg: #fee2e2;

  /* Legacy names still used by privacy.php and disclaimer.php. Do not remove. */
  --indigo: var(--blue);
  --indigo-dk: var(--blue-dk);
  --indigo-lt: var(--blue-soft);
  --amber: var(--gold);
  --amber-dk: var(--gold-dk);
  --amber-lt: var(--gold-soft);

  /* Shape and depth */
  --r: 14px;
  --r2: 22px;
  --sh: 0 1px 2px rgba(10, 26, 63, .06), 0 6px 18px rgba(10, 26, 63, .07);
  --sh2: 0 2px 4px rgba(10, 26, 63, .06), 0 24px 56px rgba(10, 26, 63, .14);

  /* Type */
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;

  --nav-h: 68px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  font-family: var(--font-body);
  background-color: var(--bg);
  /* Notebook paper: ruled lines run down the whole page */
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(31, 91, 216, .11) 35px, rgba(31, 91, 216, .11) 36px);
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
/* Red margin line, full page height */
body::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(10px, calc((100vw - 1160px) / 2 + 12px), 140px); width: 2px; background: rgba(212, 53, 59, .24); z-index: 2; pointer-events: none; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; margin-bottom: 12px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.sec { padding: clamp(60px, 8vw, 104px) 0; }
.tc { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Skip link and scroll progress ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 400; background: linear-gradient(90deg, var(--gold), var(--blue)); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* ---------- Navigation ---------- */
.site-nav { position: sticky; top: 0; z-index: 300; height: var(--nav-h); display: flex; align-items: center; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s; }
.site-nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(10, 26, 63, .06); }
.nav-in { display: flex; align-items: center; gap: 28px; width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; transition: transform .35s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.08); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-head); font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.brand-text small { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { position: relative; color: var(--ink-soft); padding: 8px 14px; border-radius: 8px; font-size: 14.5px; font-weight: 600; transition: color .18s, background .18s; }
.nav-links a:hover { color: var(--navy); background: var(--blue-soft); }
.nav-links a.act { color: var(--blue); }
.nav-links a.act::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold); }

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; align-items: center; background: none; border: 0; cursor: pointer; border-radius: 10px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-in { gap: 10px; }
  .nav-toggle { display: flex; }
  .nav-cta { padding: 10px 14px; font-size: 13.5px; }
  .brand-text small { display: none; }
  .nav-links { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(10, 26, 63, .1); padding: 0 16px; max-height: 0; overflow: hidden; visibility: hidden; transition: max-height .3s var(--ease), padding .3s var(--ease), visibility 0s .3s; }
  .nav-links.open { max-height: 380px; padding: 8px 16px 14px; visibility: visible; transition: max-height .3s var(--ease), padding .3s var(--ease); }
  .nav-links a { padding: 14px 8px; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a.act::after { display: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 14px 26px; border-radius: 12px; font-size: 15px; font-weight: 700; line-height: 1.1; cursor: pointer; border: 1.5px solid transparent; font-family: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 22px rgba(31, 91, 216, .32); }
.btn-primary:hover { background: var(--blue-dk); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 91, 216, .38); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 8px 22px rgba(242, 176, 30, .34); }
.btn-gold:hover { background: #ffc13a; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(242, 176, 30, .42); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--blue-line); }
.btn-ghost:hover { background: var(--blue-soft); border-color: var(--blue); transform: translateY(-2px); }
.btn-ghost-inv { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost-inv:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); transform: translateY(-2px); }
.btn-wa { background: #1faa59; color: #fff; box-shadow: 0 8px 22px rgba(31, 170, 89, .3); }
.btn-wa:hover { background: #178a49; transform: translateY(-2px); }
.btn-lg { padding: 17px 32px; font-size: 16.5px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- Section heading (left aligned) ---------- */
.sec-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head h2 { font-size: clamp(1.9rem, 3.9vw, 2.9rem); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; margin-bottom: 14px; text-wrap: balance; }
.sec-head p { font-size: 1.05rem; color: var(--muted); max-width: 56ch; }

/* ---------- Page heads ---------- */
/* Notebook-paper page head, used by features, contact and download */
.page-head { position: relative; padding: clamp(44px, 7vw, 84px) 0 clamp(40px, 6vw, 68px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; max-width: 18ch; text-wrap: balance; margin-bottom: 14px; }
.page-head p { font-size: 1.1rem; color: var(--muted); max-width: 54ch; }

/* Dark hero, still used by privacy.php (do not remove) */
.pg-hero { background: linear-gradient(160deg, #0a1a3f 0%, #122a5c 60%, #1647b0 100%); padding: 64px 0; text-align: center; color: #fff; position: relative; overflow: hidden; }
.pg-hero::before { content: ''; position: absolute; top: -100px; right: -100px; width: 340px; height: 340px; background: rgba(242, 176, 30, .1); border-radius: 50%; filter: blur(40px); }
.pg-hero h1 { color: #fff; font-size: clamp(26px, 3.8vw, 42px); font-weight: 800; margin-bottom: 12px; letter-spacing: -.02em; position: relative; z-index: 1; }
.pg-hero p { font-size: 16px; color: rgba(255, 255, 255, .72); max-width: 540px; margin: 0 auto; position: relative; z-index: 1; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-lbl { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.form-lbl small { font-weight: 500; color: var(--muted); font-size: 12px; }
.form-inp, .form-sel, .form-ta { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); transition: border-color .18s, box-shadow .18s; outline: none; }
.form-inp:focus, .form-sel:focus, .form-ta:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 91, 216, .12); }
.form-inp.bad, .form-sel.bad, .form-ta.bad { border-color: var(--red); box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.form-ta { resize: vertical; min-height: 110px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 13px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; margin-top: 14px; display: none; }
.alert.show { display: block; }
.a-ok { background: var(--green-bg); color: #14532d; border: 1px solid #86efac; }
.a-err { background: var(--red-bg); color: #7f1d1d; border: 1px solid #fecaca; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 16px; background: rgba(10, 26, 63, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.modal.open { opacity: 1; visibility: visible; transition: opacity .25s; }
.modal-box { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 30px; box-shadow: var(--sh2); transform: translateY(18px) scale(.97); transition: transform .3s var(--ease); }
.modal.open .modal-box { transform: none; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--blue-soft); color: var(--navy); border-radius: 50%; cursor: pointer; font-size: 18px; transition: background .2s, transform .2s; }
.modal-x:hover { background: var(--blue-line); transform: rotate(90deg); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 900; transform: translate(-50%, 24px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--sh2); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal (only when JavaScript is on) ---------- */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- CTA band ---------- */
.cta-ban { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue-dk) 100%); border-radius: var(--r2); padding: clamp(36px, 6vw, 64px); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta-ban::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(255, 255, 255, .06) 35px, rgba(255, 255, 255, .06) 36px); }
.cta-ban h2 { color: #fff; margin-bottom: 8px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.03em; }
.cta-ban p { color: rgba(255, 255, 255, .78); max-width: 46ch; }
.cta-acts { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .btn { padding: 13px 22px; font-size: 14.5px; }
  .btn-lg { padding: 15px 26px; font-size: 15.5px; }
  .modal-box { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .rv { opacity: 1; transform: none; }
}
