/* ============================================================
   LETAKOF — Security Solutions
   Design system / tokens / base
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Schibsted+Grotesk:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Accent (overridable by tweaks) */
  --accent:        #2FE0C8;
  --accent-deep:   #16B6A2;
  --accent-soft:   rgba(47, 224, 200, 0.14);
  --accent-line:   rgba(47, 224, 200, 0.30);
  --accent-glow:   rgba(47, 224, 200, 0.45);
  --accent-ink:    #04211D; /* text on accent fills */

  /* Dark base (default theme) — deep cool slate (Hematite-tinted) */
  --bg:        #0E1114;
  --bg-2:      #11151A;
  --bg-3:      #161B21;
  --surface:   rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.045);
  --solid:     #181D24;
  --border:    rgba(255, 255, 255, 0.085);
  --border-2:  rgba(255, 255, 255, 0.14);

  --text:      #EBEFF1;
  --text-dim:  #9BA6AD;
  --text-faint:#616B72;

  /* Glass */
  --glass-blur: 22px;
  --glass-bg:   rgba(16, 21, 26, 0.55);
  --glass-brd:  rgba(255, 255, 255, 0.10);

  /* Motion */
  --motion: 1;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Type */
  --font: 'Schibsted Grotesk', -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-accent: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;

  /* Section rhythm */
  --sec-pad: clamp(96px, 13vw, 184px);

  color-scheme: dark;
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  /* Cloud Dancer PANTONE 11-4201 */
  --bg:        #F0EEE4;
  --bg-2:      #EBE9DE;
  --bg-3:      #E5E2D5;
  --surface:   rgba(20, 24, 28, 0.028);
  --surface-2: rgba(20, 24, 28, 0.05);
  --solid:     #FBFAF7;
  --border:    rgba(15, 23, 30, 0.10);
  --border-2:  rgba(15, 23, 30, 0.16);
  --text:      #14181C;
  --text-dim:  #545C63;
  --text-faint:#8B939A;
  --glass-bg:  rgba(251, 250, 247, 0.62);
  --glass-brd: rgba(15, 23, 30, 0.10);
  --accent-ink:#04211D;
  color-scheme: light;
}

/* ---------- Midnight (deep blue) theme ---------- */
:root[data-theme="midnight"] {
  --bg:        #060814;
  --bg-2:      #080B1A;
  --bg-3:      #0B0F22;
  --solid:     #11162E;
  --border:    rgba(150, 170, 255, 0.10);
  --border-2:  rgba(150, 170, 255, 0.18);
  --text-dim:  #95A0C4;
  --text-faint:#5B6488;
  --glass-bg:  rgba(11, 15, 34, 0.55);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--sec-pad); position: relative; }

/* ---------- Eyebrow / kicker ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.kicker--dot::before {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Headings ---------- */
.h-display {
  font-weight: 700;
  font-size: clamp(2.7rem, 7.4vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h1 {
  font-weight: 700;
  font-size: clamp(2.1rem, 4.7vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h2 {
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.lead {
  font-size: clamp(1.05rem, 1.55vw, 1.32rem);
  line-height: 1.55;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: -0.006em;
  text-wrap: pretty;
}
.section-head { max-width: 720px; }
.section-head .kicker { margin-bottom: 22px; }
.section-head .lead { margin-top: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --b: 1px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 14px 24px;
  border-radius: 100px;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease),
              color 0.3s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 var(--accent-glow), 0 10px 30px -12px var(--accent-glow);
}
.btn--primary:hover {
  box-shadow: 0 0 0 5px var(--accent-soft), 0 16px 40px -14px var(--accent-glow);
  transform: translateY(-2px);
}
.btn--primary .btn__arrow { transition: transform 0.4s var(--ease); }
.btn--primary:hover .btn__arrow { transform: translateX(4px); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.btn--lg { padding: 17px 30px; font-size: 1.05rem; }

/* ============================================================
   GLASS CARD primitive
   ============================================================ */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.45s var(--ease), background 0.45s var(--ease),
              transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(calc(30px * var(--motion))) scale(calc(1 - 0.012 * var(--motion)));
  filter: blur(calc(6px * var(--motion)));
  transition: opacity 0.95s var(--ease-out), transform 1s var(--ease-out), filter 0.9s var(--ease-out);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform, filter;
}
[data-reveal].in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ---------- Scroll-driven reveal (progressive enhancement) ----------
   Modern browsers tie the reveal to the scroll position via a view()
   timeline, so sections ease in continuously as they enter the viewport.
   Falls back to the IntersectionObserver class toggle above when
   animation-timeline is unsupported. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal] {
      opacity: 1;
      animation: revealScroll linear both;
      animation-timeline: view();
      animation-range: entry 6% entry 56%;
    }
    @keyframes revealScroll {
      from {
        opacity: 0;
        transform: translateY(calc(30px * var(--motion))) scale(calc(1 - 0.012 * var(--motion)));
        filter: blur(calc(6px * var(--motion)));
      }
      to { opacity: 1; transform: none; filter: none; }
    }
    /* mobile pricing carousel: keep cards solid, no scroll-linked hide */
    @media (max-width: 900px) {
      .price__grid [data-reveal] { animation: none; opacity: 1; transform: none; filter: none; }
    }
  }
}
