/* ============================================================
   Loominost — Design Tokens + Base
   ============================================================ */

:root {
  /* Palette — Hyonix-style blue + black on near-white */
  --bg: #F5F7FA;              /* cool near-white */
  --bg-2: #EAEFF5;            /* panel tint */
  --bg-3: #DCE4EE;            /* card tint */
  --ink: #0A1220;             /* near-black with blue cast */
  --ink-2: #2A3544;           /* secondary text */
  --ink-3: #5A6778;           /* tertiary / meta */
  --line: #D6DEE8;            /* hairlines */
  --line-2: #BFCAD8;          /* stronger hairlines */

  --accent: #2563EB;          /* Hyonix-style blue */
  --accent-ink: #1D4ED8;      /* deeper blue for text */
  --accent-wash: #DBEAFE;     /* pale blue fill */
  --accent-glow: #60A5FA;     /* light blue glow */

  --ok: #2F7D5B;
  --warn: #B45309;
  --err: #B91C1C;

  /* Type — Hyonix-style geometric sans throughout */
  --font-serif: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --maxw: 1240px;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-sm: 6px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

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

/* Italic <em> in headings → render as plain bold accent (Hyonix-style) */
em { font-style: normal; font-weight: 600; }

/* ---------- Type scale ---------- */

.display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-size: clamp(44px, 6.2vw, 88px);
}
.display em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-ink);
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.h-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.h-eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  transform: translateY(-1px);
}

.mono { font-family: var(--font-mono); font-feature-settings: "ss01"; }

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 160ms var(--ease);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .arrow { transition: transform 160ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* ---------- Utilities ---------- */

.hide { display: none !important; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: rgba(255,255,255,0.5);
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47,125,91,0.15);
}

/* ---------- Grainy background texture ---------- */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(37,99,235,0.06), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(96,165,250,0.08), transparent 50%);
  mix-blend-mode: multiply;
}

/* ---------- Scroll reveal on hover (simple) ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 600ms var(--ease) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ============================================================
   RESPONSIVE — tablet & mobile
   ============================================================ */

/* Tablet: <= 980px */
@media (max-width: 980px) {
  .wrap { padding: 0 22px; }
  .display { font-size: clamp(36px, 6vw, 64px) !important; }

  /* Two-col grids → stack */
  [style*="grid-template-columns: 1.1fr 0.9fr"],
  [style*="gridTemplateColumns: \"1.1fr 0.9fr\""],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="gridTemplateColumns: \"1fr 1fr\""],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 0.9fr 1.1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Three-col grids → 2-col */
  [style*="grid-template-columns: repeat(3"],
  [style*="gridTemplateColumns: \"repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Four-col → 2-col */
  [style*="grid-template-columns: repeat(4"],
  [style*="gridTemplateColumns: \"repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Reduce hero / section vertical padding */
  section[style*="padding: 120px"],
  section[style*="padding: 100px"],
  div[style*="padding: 120px"] {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }
}

/* Mobile: <= 720px */
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .display { font-size: clamp(32px, 9vw, 48px) !important; line-height: 1.05 !important; }

  /* All multi-col grids → single column */
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="gridTemplateColumns: \"repeat(2"],
  [style*="gridTemplateColumns: \"repeat(3"],
  [style*="gridTemplateColumns: \"repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Buttons full-width groups */
  .hero-cta-row { flex-direction: column !important; align-items: stretch !important; }
  .hero-cta-row .btn { width: 100%; justify-content: center; }

  /* Pricing toggle wraps */
  .seg { flex-wrap: wrap; }

  /* Tables — let them scroll horizontally instead of breaking layout */
  table { font-size: 12px !important; }
  .matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Larger touch targets */
  .btn { min-height: 44px; }

  /* Mobile: hide desktop nav menu, show hamburger */
  .nav-menu { display: none !important; }
  .nav-actions .btn-ghost { display: none !important; }
  .nav-mobile-toggle { display: inline-flex !important; }

  /* Mobile drawer */
  .nav-drawer {
    position: fixed; inset: 72px 0 0 0;
    background: #fff;
    z-index: 39;
    padding: 24px 22px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
  }
  .nav-drawer a { display: block; padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--line); }

  /* Footer big text smaller */
  footer .wrap > div:first-child { gap: 24px !important; padding-bottom: 40px !important; }

  /* Reduce paddings */
  section[style*="padding: 80px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
}

.nav-mobile-toggle { display: none; }
