/* =========================================================
   Klavsuts — shared design system (Trust & Authority + Aurora)
   ========================================================= */
:root {
  --ink: #0B1020;
  --text: #1E2433;
  --muted: #51607A;
  --bg: #FBFAFF;
  --surface: #FFFFFF;
  --border: #E7E4F3;

  --indigo: #4F46E5;
  --violet: #7C3AED;
  --blue:   #2563EB;
  --cyan:   #06B6D4;
  --emerald:#10B981;
  --amber:  #F59E0B;
  --rose:   #F43F5E;

  --cta: var(--indigo);
  --max: 1140px;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Lato', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--text); background: var(--bg);
  line-height: 1.7; font-size: 17px; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.12; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section[id], header[id] { scroll-margin-top: 108px; }

.grad-text {
  background: linear-gradient(100deg, var(--indigo), var(--violet) 40%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; margin-bottom: 16px; display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  padding: 13px 24px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(100deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 8px 22px rgba(79,70,229,.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(124,58,237,.42); }
.btn-primary::after { content:""; position:absolute; top:0; left:-120%; width:60%; height:100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); }
.btn-primary:hover::after { animation: shine .8s ease; }
@keyframes shine { to { left: 130%; } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid rgba(124,58,237,.45); outline-offset: 3px; }

/* ---------- Navbar ---------- */
.nav-spacer { height: 92px; }
nav.bar {
  position: fixed; top: 16px; left: 16px; right: 16px; z-index: 50;
  max-width: calc(var(--max) + 32px); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 22px;
  background: rgba(255,255,255,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 6px 30px rgba(11,16,32,0.06);
  transition: box-shadow .3s ease, background .3s ease;
}
nav.bar.scrolled { box-shadow: 0 10px 40px rgba(11,16,32,0.12); background: rgba(255,255,255,0.85); }
.brand { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ink); }
.brand .dot { color: var(--violet); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a.link { font-size: 15px; color: var(--muted); padding: 8px 14px; border-radius: 9px; transition: color .2s ease, background .2s ease; position: relative; }
.nav-links a.link:hover { color: var(--indigo); background: rgba(79,70,229,.08); }
.nav-links a.link.active { color: var(--indigo); }
.nav-links a.link.active::after { content:""; position:absolute; left:14px; right:14px; bottom:2px; height:2px; border-radius:2px; background: linear-gradient(90deg, var(--indigo), var(--violet)); }
.nav-cta { margin-left: 10px; }

.hamburger { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center; }
.hamburger svg { width: 22px; height: 22px; color: var(--ink); }
.mobile-menu { display: none; position: fixed; top: 80px; left: 16px; right: 16px; z-index: 49; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: 0 18px 50px rgba(11,16,32,.16); }
.mobile-menu a { display: block; padding: 13px 16px; border-radius: 10px; color: var(--ink); font-weight: 700; }
.mobile-menu a:hover, .mobile-menu a.active { background: rgba(79,70,229,.08); color: var(--indigo); }
.mobile-menu.open { display: block; }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero { position: relative; padding: 92px 0 56px; overflow: hidden; }
.aurora { position: absolute; inset: -30% -10% auto -10%; height: 150%; z-index: 0; filter: blur(60px); opacity: .5; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; mix-blend-mode: multiply; }
.blob.b1 { width: 460px; height: 460px; background: var(--indigo); top: -80px; left: -40px; animation: float1 14s ease-in-out infinite; }
.blob.b2 { width: 400px; height: 400px; background: var(--cyan); top: 20px; right: -60px; animation: float2 16s ease-in-out infinite; }
.blob.b3 { width: 360px; height: 360px; background: var(--rose); top: 160px; left: 40%; animation: float3 18s ease-in-out infinite; }
.blob.b4 { width: 280px; height: 280px; background: var(--amber); top: -40px; left: 48%; animation: float1 20s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(40px,30px) scale(1.08)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-50px,40px) scale(1.12)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(30px,-40px) scale(1.06)} }
.page-hero .wrap { position: relative; z-index: 1; max-width: 860px; }
.page-hero h1 { font-size: clamp(38px, 5.6vw, 64px); margin: 12px 0 18px; }
.page-hero .lead { font-size: 20px; color: var(--muted); max-width: 62ch; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--indigo); }

/* big homepage hero */
.hero { position: relative; padding: 96px 0 80px; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 66px); margin: 12px 0 24px; }
.hero .lead { font-size: 20px; color: var(--muted); max-width: 56ch; margin-bottom: 36px; }
.portrait-wrap { position: relative; justify-self: center; }
.portrait-wrap::before { content:""; position:absolute; inset:-14px; border-radius:28px; background: linear-gradient(135deg,var(--indigo),var(--violet) 45%,var(--cyan)); filter: blur(2px); opacity:.9; }
.portrait { position: relative; width: 320px; height: 380px; object-fit: cover; border-radius: 22px; box-shadow: 0 24px 60px rgba(11,16,32,.28); }
.portrait-badge { position:absolute; bottom:-16px; left:50%; transform:translateX(-50%); white-space:nowrap; background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:9px 18px; font-size:13px; font-weight:700; color:var(--ink); box-shadow:0 8px 24px rgba(11,16,32,.12); z-index:2; }
.portrait-badge .dotg { color: var(--emerald); }
@media (max-width: 880px){
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait-wrap { order: -1; }
  .portrait { width: 240px; height: 290px; }
}

/* about photo */
.about-photo { width: 100%; border-radius: 18px; object-fit: cover; box-shadow: 0 16px 40px rgba(11,16,32,.14); }

/* case outcomes table */
.outcomes { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 24px; background: var(--surface); }
.outcomes .orow { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 15px; }
.outcomes .orow:first-child { border-top: none; }
.outcomes .orow span:first-child { color: var(--muted); }
.outcomes .orow .ov { font-weight: 700; font-family: var(--serif); font-size: 18px; color: var(--ink); white-space: nowrap; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--indigo); }
.pill .ping { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); animation: ping 2s ease-out infinite; }
@keyframes ping { 0%{box-shadow:0 0 0 0 rgba(16,185,129,.6)} 70%{box-shadow:0 0 0 10px rgba(16,185,129,0)} 100%{box-shadow:0 0 0 0 rgba(16,185,129,0)} }

/* ---------- Trust strip ---------- */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 44px 24px; }
.stat .num { font-family: var(--serif); font-size: 46px; font-weight: 700; }
.stat:nth-child(1) .num { color: var(--indigo); }
.stat:nth-child(2) .num { color: var(--cyan); }
.stat:nth-child(3) .num { color: var(--rose); }
.stat:nth-child(4) .num { color: var(--amber); }
.stat .lbl { font-size: 14px; color: var(--muted); }

/* ---------- Generic section ---------- */
section.block { padding: 88px 0; }
.section-head { max-width: 64ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 18px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Expertise cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card::before { content:""; position:absolute; top:0; left:0; right:0; height:4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(11,16,32,.10); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 20px; color: #fff; background: var(--accent); box-shadow: 0 8px 18px var(--glow); transition: transform .25s ease; }
.card:hover .icon { transform: scale(1.08) rotate(-3deg); }
.icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 22px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 16px; }
.c-indigo  { --accent: linear-gradient(135deg,#6366F1,#4F46E5); --glow: rgba(79,70,229,.35); }
.c-cyan    { --accent: linear-gradient(135deg,#22D3EE,#06B6D4); --glow: rgba(6,182,212,.35); }
.c-emerald { --accent: linear-gradient(135deg,#34D399,#10B981); --glow: rgba(16,185,129,.35); }
.c-amber   { --accent: linear-gradient(135deg,#FBBF24,#F59E0B); --glow: rgba(245,158,11,.35); }
.c-violet  { --accent: linear-gradient(135deg,#A78BFA,#7C3AED); --glow: rgba(124,58,237,.35); }
.c-rose    { --accent: linear-gradient(135deg,#FB7185,#F43F5E); --glow: rgba(244,63,94,.35); }
.c-blue    { --accent: linear-gradient(135deg,#60A5FA,#2563EB); --glow: rgba(37,99,235,.35); }

/* ---------- Service modules (Expertise page) ---------- */
.modules { display: grid; gap: 16px; }
.module { display: grid; grid-template-columns: 64px 1fr auto; gap: 22px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 28px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.module:hover { transform: translateX(6px); box-shadow: 0 14px 34px rgba(11,16,32,.08); border-color: transparent; }
.module .mnum { font-family: var(--serif); font-size: 30px; font-weight: 700; background: linear-gradient(120deg,var(--indigo),var(--cyan)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.module h3 { font-size: 21px; margin-bottom: 4px; }
.module p { color: var(--muted); font-size: 16px; }
.duration { white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--violet); background: rgba(124,58,237,.1); padding: 7px 14px; border-radius: 999px; align-self: start; margin-top: 4px; }
.module { align-items: start; }
.module .dlv { list-style: none; margin: 14px 0 0; display: grid; gap: 8px; }
.module .dlv li { display: flex; gap: 9px; align-items: flex-start; color: var(--text); font-size: 15px; }
.module .dlv li svg { width: 17px; height: 17px; color: var(--indigo); flex-shrink: 0; margin-top: 4px; }
@media (max-width: 680px){ .module { grid-template-columns: 40px 1fr; } .module .duration { grid-column: 2; justify-self: start; } }

/* ---------- Approach (dark) ---------- */
.approach { background: radial-gradient(120% 120% at 0% 0%, #161B33 0%, #0B1020 60%); color: #fff; position: relative; overflow: hidden; }
.approach::after { content:""; position:absolute; right:-120px; top:-120px; width:380px; height:380px; border-radius:50%; background: linear-gradient(135deg,var(--violet),var(--cyan)); filter: blur(80px); opacity:.4; }
.approach .wrap { position: relative; z-index: 1; }
.approach h2 { color: #fff; }
.approach .section-head p { color: #9AA6C4; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { padding: 28px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.03); transition: transform .25s ease, background .25s ease, border-color .25s ease; }
.step:hover { transform: translateY(-6px); background: rgba(255,255,255,.06); border-color: rgba(124,58,237,.5); }
.step .num { font-family: var(--serif); font-size: 34px; font-weight: 700; background: linear-gradient(120deg,#A78BFA,#22D3EE); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.step h3 { color: #fff; font-size: 22px; margin: 12px 0 8px; }
.step p { color: #9AA6C4; font-size: 16px; }

/* ---------- Proof highlights (Background page) ---------- */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.proof .pcard { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; transition: transform .2s ease, box-shadow .2s ease; }
.proof .pcard:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(11,16,32,.08); }
.proof .big { font-family: var(--serif); font-size: 44px; font-weight: 700; }
.proof .pcard p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.deliver { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.deliver li { list-style: none; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.deliver li svg { width: 22px; height: 22px; color: var(--emerald); flex-shrink: 0; margin-top: 3px; }
.deliver li strong { color: var(--ink); }
.deliver li span { color: var(--muted); font-size: 15px; }

/* ---------- Case studies ---------- */
.case { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; display: flex; flex-direction: column; }
.case:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(11,16,32,.10); }
.case .thumb { height: 170px; position: relative; overflow: hidden; }
.case .thumb svg { position:absolute; inset:0; width:100%; height:100%; }
.case .body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.tag { display: inline-block; align-self: flex-start; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 14px; padding: 5px 12px; border-radius: 999px; }
.t-violet { color: var(--violet); background: rgba(124,58,237,.12); }
.t-cyan { color: var(--cyan); background: rgba(6,182,212,.14); }
.t-rose { color: var(--rose); background: rgba(244,63,94,.12); }
.t-amber { color: var(--amber); background: rgba(245,158,11,.14); }
.case h3 { font-size: 21px; margin-bottom: 10px; }
.case p { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.metric { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; }
.metric .big { font-family: var(--serif); font-size: 36px; font-weight: 700; }
.metric .small { font-size: 14px; color: var(--muted); }
.case .more { margin-top: 16px; font-weight: 700; color: var(--indigo); display: inline-flex; align-items: center; gap: 6px; }
.case .more svg { width: 16px; height: 16px; transition: transform .2s ease; }
.case:hover .more svg { transform: translateX(4px); }

/* case detail page */
.detail { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.detail .prose h3 { font-size: 26px; margin: 36px 0 12px; }
.detail .prose p { color: var(--text); margin-bottom: 16px; }
.detail .prose ul { margin: 0 0 16px 0; padding-left: 0; }
.detail .prose li { list-style: none; display: flex; gap: 10px; margin-bottom: 10px; color: var(--text); }
.detail .prose li svg { width: 20px; height: 20px; color: var(--emerald); flex-shrink: 0; margin-top: 4px; }
.aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; position: sticky; top: 110px; }
.aside-card h4 { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.aside-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 15px; }
.aside-card .row:first-of-type { border-top: none; }
.aside-card .row .v { font-weight: 700; color: var(--ink); text-align: right; }
@media (max-width: 880px){ .detail { grid-template-columns: 1fr; } .aside-card { position: static; } }

/* ---------- About preview ---------- */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
.about p { color: var(--text); margin-bottom: 18px; }
.pubs { background: linear-gradient(160deg,#fff, #F5F3FF); border: 1px solid var(--border); border-radius: 20px; padding: 30px; }
.pubs h3 { font-size: 19px; margin-bottom: 18px; }
.pub { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.pub:first-of-type { border-top: none; }
.pub .pic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.pub .pic svg { width: 19px; height: 19px; }
.pub div strong { display: block; color: var(--ink); font-weight: 700; font-size: 15px; }
.pub div span { font-size: 14px; color: var(--muted); }

/* ---------- Roles ---------- */
.roles { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.role { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; text-align: center; transition: transform .2s ease, box-shadow .2s ease; }
.role:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(11,16,32,.08); }
.role .icon { margin: 0 auto 18px; }

/* ---------- Contact band ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: 26px; padding: 60px; text-align: center; color: #fff; background: linear-gradient(120deg, var(--indigo), var(--violet) 55%, var(--cyan)); background-size: 200% 200%; animation: gradientMove 12s ease infinite; }
@keyframes gradientMove { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.cta-band h2 { color: #fff; font-size: clamp(28px, 4vw, 42px); margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,.9); font-size: 18px; max-width: 54ch; margin: 0 auto 28px; }
.news-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.news-form input { flex: 1; padding: 14px 16px; border: 1px solid rgba(255,255,255,.4); border-radius: 12px; font-family: var(--sans); font-size: 15px; background: rgba(255,255,255,.95); color: var(--ink); }
.cta-band .btn-primary { background: #fff; color: var(--indigo); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.cta-band .btn-primary:hover { color: var(--violet); }
.hint { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 14px; }
.hint a { color: #fff; font-weight: 700; text-decoration: underline; }

footer { border-top: 1px solid var(--border); padding: 48px 0; margin-top: 28px; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.foot .brand { font-size: 18px; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a { font-size: 15px; color: var(--muted); transition: color .2s ease; }
.foot-links a:hover { color: var(--violet); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; } .reveal.d6 { transition-delay: .48s; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .trust .wrap { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .grid, .grid-3, .steps, .proof, .roles, .deliver { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .cta-band { padding: 40px 24px; }
  .news-form { flex-direction: column; }
}

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