/* ==========================================================================
   DSC::Energy Analytics — Design System
   Brand: azure #0292CE · navy · grey
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand: #0292CE;
  --brand-600: #027bb0;
  --brand-700: #036391;
  --brand-300: #38b6e6;
  --brand-100: #d8eefa;
  --cyan: #16c7e0;

  /* Neutrals */
  --navy-900: #07172a;
  --navy-800: #0b2138;
  --navy-700: #122c47;
  --ink: #16263a;
  --text: #25394d;
  --muted: #5d748b;
  --line: #e4edf3;
  --bg: #ffffff;
  --bg-soft: #f3f8fc;
  --bg-soft-2: #eaf3f9;
  --white: #ffffff;

  /* Effects */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(11, 33, 56, .06), 0 1px 2px rgba(11, 33, 56, .04);
  --shadow: 0 10px 30px -12px rgba(11, 33, 56, .18);
  --shadow-lg: 0 30px 60px -20px rgba(7, 23, 42, .35);
  --ring: 0 0 0 3px rgba(2, 146, 206, .35);

  --grad: linear-gradient(120deg, var(--brand) 0%, var(--cyan) 100%);
  --grad-navy: linear-gradient(160deg, #0b2138 0%, #07172a 100%);

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);

  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--header-h) + 14px); }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); }
p { color: var(--text); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--muted); line-height: 1.7; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); position: relative; }
.section--soft { background: var(--bg-soft); }
.section--navy { background: var(--grad-navy); color: #d7e6f2; }
.section--navy h2, .section--navy h3 { color: #fff; }
.narrow { max-width: 760px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-600);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad); border-radius: 2px; }
.section--navy .eyebrow { color: var(--brand-300); }

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: 16px; }

.grid { display: grid; gap: clamp(18px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(2,146,206,.7); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(2,146,206,.8); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { color: var(--brand-700); border-color: var(--brand-300); background: var(--bg-soft); transform: translateY(-2px); }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255,255,255,.2); color: #fff; transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 34px; width: auto; transition: opacity .3s ease; }
.brand .logo-dark { display: none; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 34px); }
.nav a.navlink {
  font-family: var(--font-display); font-weight: 500; font-size: .96rem; color: #eaf4fb;
  position: relative; padding: 6px 2px; transition: color .2s ease;
}
.nav a.navlink::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--grad); border-radius: 2px; transition: width .25s ease;
}
.nav a.navlink:hover::after, .nav a.navlink.active::after { width: 100%; }

/* Solid header (scrolled or inner pages) */
.site-header.solid {
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(7,23,42,.5);
}
.site-header.solid .brand .logo-light { display: none; }
.site-header.solid .brand .logo-dark { display: block; }
.site-header.solid .nav a.navlink { color: var(--ink); }
.site-header.solid .nav a.navlink:hover { color: var(--brand-700); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: clamp(620px, 92vh, 900px);
  display: flex; align-items: center;
  color: #eaf4fb; isolation: isolate; padding-top: var(--header-h);
}
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7,23,42,.92) 0%, rgba(7,23,42,.72) 42%, rgba(7,23,42,.30) 100%),
    linear-gradient(0deg, rgba(7,23,42,.85) 0%, rgba(7,23,42,0) 45%);
}
.hero__grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(56,182,230,.10) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(56,182,230,.10) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(80% 60% at 30% 40%, #000 0%, transparent 75%);
}
.hero__inner { max-width: 760px; padding-block: 60px; }
.hero .eyebrow { color: var(--brand-300); }
.hero h1 { color: #fff; margin-top: 18px; }
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { font-size: clamp(1.08rem, 1.7vw, 1.32rem); color: #c6dbeb; margin-top: 22px; max-width: 620px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(22px, 4vw, 54px); margin-top: 52px; }
.hero__stats .stat b { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.3rem); color: #fff; font-weight: 700; display: block; line-height: 1; }
.hero__stats .stat span { font-size: .9rem; color: #a9c4d8; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 32px); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  height: 100%;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.card .ic {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-100), #eef8fd); color: var(--brand-600);
  margin-bottom: 18px;
}
.card .ic svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .98rem; }

/* Service card top accent */
.svc { position: relative; overflow: hidden; }
.svc::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.svc:hover::before { transform: scaleX(1); }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.about__media { position: relative; }
.about__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 4/3; object-fit: cover; }
.about__media .badge {
  position: absolute; bottom: 18px; left: 18px; right: 18px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow); display: flex; gap: 18px; align-items: center;
}
.about__media .badge b { font-family: var(--font-display); font-size: 1.5rem; color: var(--brand-700); }
.about__media .badge span { font-size: .82rem; color: var(--muted); }
.feature-list { display: grid; gap: 14px; margin-top: 26px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; margin-top: 2px; }
.feature-list .tick svg { width: 14px; height: 14px; }
.feature-list b { color: var(--ink); }

/* ---------- Approach / pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; counter-reset: step; }
.pstep {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 22px 18px; position: relative;
}
.pstep .num { font-family: var(--font-display); font-weight: 700; color: var(--brand-300); font-size: .9rem; letter-spacing: .08em; }
.pstep h4 { color: #fff; font-size: 1rem; margin-top: 8px; }
.pstep p { color: #9fbdd4; font-size: .86rem; margin-top: 4px; }

.tech-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.tech-badges span {
  font-family: var(--font-display); font-size: .85rem; font-weight: 500;
  padding: 8px 15px; border-radius: 999px; color: #d7e6f2;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}

/* ---------- Stats / counters ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 3vw, 32px); text-align: center; }
.stat-card .n { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .l { color: #a9c4d8; margin-top: 10px; font-size: .96rem; }

/* ---------- Case studies ---------- */
.case {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 26px; transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.case:hover { transform: translateY(-6px); border-color: var(--brand-300); background: rgba(255,255,255,.07); }
.case .tag { display: inline-block; font-family: var(--font-display); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-900); background: var(--brand-300); padding: 4px 11px; border-radius: 999px; font-weight: 600; }
.case h3 { color: #fff; margin: 14px 0 10px; font-size: 1.18rem; }
.case p { color: #9fbdd4; font-size: .94rem; }
.case .metric { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: baseline; gap: 10px; }
.case .metric b { font-family: var(--font-display); color: var(--brand-300); font-size: 1.5rem; }
.case .metric span { color: #b9d0e2; font-size: .85rem; }

/* ---------- Sectors ---------- */
.sector {
  display: flex; gap: 16px; align-items: center; padding: 20px 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.sector:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.sector .ic { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-100), #eef8fd); color: var(--brand-600); }
.sector .ic svg { width: 25px; height: 25px; }
.sector b { font-family: var(--font-display); color: var(--ink); font-size: 1rem; display: block; }
.sector span { font-size: .85rem; color: var(--muted); }

/* ---------- Capabilities band ---------- */
.capband { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; align-items: start; }
.capband .ci b { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); color: #fff; display: block; }
.capband .ci span { color: #9fbdd4; font-size: .9rem; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact__info { display: grid; gap: 22px; }
.contact__info .row { display: flex; gap: 16px; align-items: flex-start; }
.contact__info .ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-100), #eef8fd); color: var(--brand-600); }
.contact__info .ic svg { width: 22px; height: 22px; }
.contact__info b { font-family: var(--font-display); color: var(--ink); display: block; font-size: 1rem; }
.contact__info a, .contact__info p { color: var(--muted); }
.contact__map { margin-top: 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.contact__map iframe { width: 100%; height: 220px; border: 0; display: block; }

form .field { margin-bottom: 18px; }
form label { font-family: var(--font-display); font-weight: 500; font-size: .9rem; color: var(--ink); display: block; margin-bottom: 7px; }
form input, form textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: var(--white); transition: border-color .2s ease, box-shadow .2s ease;
}
form input:focus, form textarea:focus { border-color: var(--brand-300); box-shadow: var(--ring); outline: none; }
form textarea { resize: vertical; min-height: 130px; }
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 38px); box-shadow: var(--shadow); }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.form-status { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; display: none; }
.form-status.ok { display: block; background: #e6f7ee; color: #1c7a48; border: 1px solid #b6e6cd; }
.form-status.err { display: block; background: #fdecec; color: #b22; border: 1px solid #f5c2c2; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #9fbdd4; padding-block: clamp(54px, 7vw, 80px) 30px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(28px, 4vw, 48px); }
.site-footer .flogo { height: 38px; margin-bottom: 18px; }
.site-footer p { color: #8aa6bd; font-size: .94rem; max-width: 320px; }
.site-footer h4 { color: #fff; font-family: var(--font-display); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul { display: grid; gap: 11px; }
.site-footer a { color: #9fbdd4; font-size: .94rem; }
.site-footer a:hover { color: var(--brand-300); }
.footer__bottom {
  margin-top: clamp(38px, 5vw, 56px); padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
  font-size: .85rem; color: #6f8aa1;
}
.social { display: flex; gap: 12px; }
.social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.social a:hover { background: var(--brand); border-color: var(--brand); }
.social svg { width: 18px; height: 18px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--grad-navy); color: #d7e6f2; padding-top: calc(var(--header-h) + 60px); padding-bottom: 60px; }
.page-hero h1 { color: #fff; }
.page-hero .lead { color: #b9d0e2; margin-top: 14px; }
.breadcrumb { font-size: .86rem; color: #8aa6bd; margin-bottom: 14px; }
.breadcrumb a { color: var(--brand-300); }

/* ---------- Resources ---------- */
.book { display: grid; grid-template-columns: 92px 1fr; gap: 20px; align-items: start; }
.book img { width: 92px; border-radius: 8px; box-shadow: var(--shadow); }
.book h3 { font-size: 1.05rem; }
.book p { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.book a.more { font-family: var(--font-display); font-size: .85rem; font-weight: 600; display: inline-flex; gap: 6px; margin-top: 10px; }

/* ---------- Prose (privacy) ---------- */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.5rem; margin-top: 40px; }
.prose h3 { margin-top: 26px; }
.prose p, .prose li { color: var(--text); margin-top: 12px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose li { margin-top: 8px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; }
  .about__media { order: -1; }
  .contact__grid { grid-template-columns: 1fr; }
  .stats-row, .capband { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px var(--gutter) 22px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .32s ease; visibility: hidden;
  }
  .nav.open { transform: translateY(0); visibility: visible; }
  .nav a.navlink { color: var(--ink); padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav a.navlink::after { display: none; }
  .nav .btn { margin-top: 12px; }
  .site-header.solid .nav, .nav { color: var(--ink); }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; width: 44px; height: 44px;
    align-items: center; justify-content: center; background: transparent; border: 0;
  }
  .nav-toggle span { width: 24px; height: 2px; background: #eaf4fb; border-radius: 2px; transition: transform .25s ease, opacity .2s ease, background .3s ease; }
  .site-header.solid .nav-toggle span { background: var(--ink); }
  .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-row, .capband { grid-template-columns: repeat(2, 1fr); gap: 26px 16px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .book { grid-template-columns: 72px 1fr; gap: 14px; }
  .book img { width: 72px; }
}
@media (max-width: 460px) {
  .footer__grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 22px 32px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .08s !important; }
}
