/* Impala Konsult AB — main stylesheet */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Brand palette (sampled from the logo) */
  --brand-blue: #2a4883;
  --blue: #3e6ad0;
  --blue-bright: #6f95ee;
  --gold-deep: #9e7127;
  --gold: #c9a14e;
  --gold-light: #ecd391;

  /* Surfaces */
  --bg: #060b1b;
  --bg-2: #0a1330;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9edf6;
  --muted: #9ba7c3;

  --gold-gradient: linear-gradient(135deg, #f3dc9c 0%, #c9a14e 45%, #9e7127 100%);
  --radius: 18px;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--bg); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--gold); color: var(--bg);
  font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Background layers ---------- */

.bg-glow {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 85% -10%, rgba(62, 106, 208, 0.16), transparent 60%),
    radial-gradient(50vw 50vw at -10% 110%, rgba(201, 161, 78, 0.10), transparent 60%),
    var(--bg);
}

#detector-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; pointer-events: none; opacity: 0.75;
}

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  transition: background 0.4s var(--ease), border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(6, 11, 27, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.header-inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 36px; width: auto; opacity: 0; transform: translateY(-6px); transition: opacity 0.5s, transform 0.5s var(--ease); }
.site-header.scrolled .brand img { opacity: 1; transform: none; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative; text-decoration: none; font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.02em; color: var(--muted); transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.lang-switch {
  display: flex; align-items: center; padding: 3px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
}
.lang-switch a {
  padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--gold-gradient); color: var(--bg); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--text); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.3s var(--ease), background 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 24px;
    background: rgba(6, 11, 27, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.25s;
  }
  .nav-links a { display: block; padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .nav-open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav-open .site-header { background: rgba(6, 11, 27, 0.96); }
  .nav { gap: 12px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 96px; text-align: center; overflow: hidden;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.fx .hero { cursor: crosshair; }
.hero > *:not(canvas) { position: relative; z-index: 1; }

.hero-logo {
  width: min(82vw, 700px); height: auto; aspect-ratio: 482 / 233;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  animation: fade-up 1.2s var(--ease) both;
}
.fx .hero-logo { animation: none; opacity: 0; transition: opacity 1.6s ease; }
.fx.logo-ready .hero-logo { opacity: calc(0.32 - var(--sp, 0) * 0.9); transition: opacity 1.6s ease; }
.fx.logo-ready.scrolling .hero-logo { transition: none; }

.hero-copy { max-width: 640px; margin-top: clamp(28px, 5vh, 52px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before, .eyebrow::after { content: ""; width: 26px; height: 1px; background: currentColor; opacity: 0.6; }
.hero-title {
  margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em;
}
.hero-lead { margin: 16px auto 0; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }
.hero-hint {
  margin: clamp(28px, 6vh, 56px) 0 0;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); opacity: 0.6;
  display: none;
}
.fx .hero-hint { display: block; }
@media (hover: none) { .hero-hint .hint-pointer { display: none; } }
@media (hover: hover) { .hero-hint .hint-touch { display: none; } }

.fx .hero-copy > *, .fx .hero-hint { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.fx.hero-in .hero-copy > *, .fx.hero-in .hero-hint { opacity: 1; transform: none; }
.fx.hero-in .hero-hint { opacity: 0.55; }
.fx.hero-in .hero-copy > :nth-child(2) { transition-delay: 0.12s; }
.fx.hero-in .hero-copy > :nth-child(3) { transition-delay: 0.24s; }
.fx.hero-in .hero-copy > :nth-child(4) { transition-delay: 0.36s; }
.fx.hero-in .hero-hint { transition-delay: 1.2s; }

.no-fx .hero-copy { animation: fade-up 1.2s 0.2s var(--ease) both; }

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

.btn {
  --pad-y: 14px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--pad-y) 26px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform 0.25s var(--ease), box-shadow 0.3s, border-color 0.3s, background 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gold-gradient); color: #1a1405; box-shadow: 0 8px 30px -10px rgba(201, 161, 78, 0.7); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.8s var(--ease);
}
.btn-primary:hover { box-shadow: 0 12px 40px -10px rgba(201, 161, 78, 0.9); transform: translateY(-2px); }
.btn-primary:hover::before { transform: translateX(120%); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: rgba(201, 161, 78, 0.6); background: rgba(201, 161, 78, 0.06); transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Sections ---------- */

main { position: relative; }
.section { position: relative; padding: clamp(80px, 12vw, 140px) var(--gutter); }
.container { max-width: var(--max); margin: 0 auto; }
.section-head { max-width: 680px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head .eyebrow::before { display: none; }
.section-head.center .eyebrow::before { display: block; }
.section-title {
  margin: 0; font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em;
}
.section-lead { margin: 18px 0 0; color: var(--muted); font-size: 1.1rem; }
.text-gold { background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr; } }

.card {
  --mx: 50%; --my: 50%;
  position: relative; padding: 34px 30px 32px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: transform 0.4s var(--ease), border-color 0.4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(201, 161, 78, 0.14), transparent 60%);
}
.card:hover { transform: translateY(-4px); border-color: rgba(201, 161, 78, 0.35); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(62, 106, 208, 0.25), rgba(201, 161, 78, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08); color: var(--gold-light);
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { margin: 0 0 10px; font-size: 1.25rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); }
.card ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.card li { position: relative; padding-left: 20px; font-size: 0.94rem; color: var(--text); }
.card li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 10px var(--gold);
}

/* Process / steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 161, 78, 0.5), rgba(62, 106, 208, 0.5), transparent);
}
@media (max-width: 960px) { .steps { grid-template-columns: 1fr; } .steps::before { display: none; } }
.step { position: relative; padding: 0 8px; text-align: center; }
.step-num {
  width: 68px; height: 68px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em; color: var(--gold-light);
  background: radial-gradient(circle at 30% 30%, rgba(201, 161, 78, 0.25), rgba(6, 11, 27, 0.95) 70%);
  border: 1px solid rgba(201, 161, 78, 0.45);
  box-shadow: 0 0 0 6px rgba(6, 11, 27, 1), 0 0 30px -4px rgba(201, 161, 78, 0.45);
}
.step h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 600; }
.step p { margin: 0 auto; max-width: 320px; color: var(--muted); }

/* About */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 960px) { .about { grid-template-columns: 1fr; } }
.about p { color: var(--muted); }
.about p strong { color: var(--text); font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fact {
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
}
.fact:first-child { grid-column: span 2; }
.fact-value { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.fact-label { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Contact ---------- */

.contact {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 6vw, 72px);
  padding: clamp(28px, 5vw, 56px); border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px circle at 0% 0%, rgba(62, 106, 208, 0.16), transparent 60%),
    radial-gradient(500px circle at 100% 100%, rgba(201, 161, 78, 0.12), transparent 60%),
    rgba(10, 19, 48, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.contact-intro p { color: var(--muted); }
.privacy {
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted);
}
.privacy summary { cursor: pointer; color: var(--text); font-weight: 500; }
.privacy p { margin: 10px 0 0; }

.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.field label .req { color: var(--gold); }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(6, 11, 27, 0.6); color: var(--text); font: inherit; font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(155, 167, 195, 0.55); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: rgba(201, 161, 78, 0.7); background: rgba(6, 11, 27, 0.85);
  box-shadow: 0 0 0 4px rgba(201, 161, 78, 0.12);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: #e06c75; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.form-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.form-status { margin: 0; min-height: 1.5em; font-size: 0.95rem; font-weight: 500; }
.form-status.ok { color: var(--gold-light); }
.form-status.err { color: #f19aa1; }

/* ---------- Footer ---------- */

.site-footer { padding: 40px var(--gutter) 48px; border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between; font-size: 0.86rem; color: var(--muted);
}
.footer-inner img { height: 30px; width: auto; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--gold-light); }

/* ---------- Simple pages (thank you / 404) ---------- */

.simple-page {
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 40px var(--gutter); text-align: center;
}
.simple-page img { width: min(70vw, 340px); margin: 0 auto 36px; }
.simple-page h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.simple-page p { margin: 0 auto 28px; max-width: 520px; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
