/* ==========================================================================
   Agrima Solutions — shared design system
   Plain CSS, no preprocessor/bundler (house convention: no build step).
   ========================================================================== */

/* Self-hosted fonts (Inter + Manrope, latin subset, variable-weight woff2)
   — replaces the fonts.googleapis.com stylesheet to avoid a render-blocking
   third-party request on first load. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2');
}

:root {
  /* Brand (sampled from assets/agrima-logo*.png) */
  --amber: #f2a83c;
  --amber-light: #ffc669;
  --amber-dark: #c97f1c;
  --teal: #4fd1c5;

  /* Surface */
  --bg: #0a0d12;
  --bg-alt: #0e1218;
  --surface: #141a23;
  --surface-2: #1b2330;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #f4f6f9;
  --text-dim: #a7b0c0;
  --text-faint: #7b8597;

  /* Type */
  --font-head: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing / shape */
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;
  --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; color: var(--text-dim); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--amber);
  display: inline-block;
}

.section {
  padding: 96px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head.center {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-light), var(--amber) 60%, var(--amber-dark));
  color: #17110a;
  box-shadow: 0 10px 30px -8px rgba(242, 168, 60, 0.55);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px rgba(242, 168, 60, 0.7);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
  transform: translateY(-2px);
}

.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 13, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 0;
  border-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 30px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.nav-cta { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(8, 10, 14, 0.98);
  padding: 110px 32px 40px;
  flex-direction: column;
  gap: 8px;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 170px 0 120px;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 82% 8%, rgba(242, 168, 60, 0.16), transparent 60%),
    radial-gradient(45% 40% at 8% 90%, rgba(79, 209, 197, 0.10), transparent 60%),
    var(--bg);
}

.hex-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  mask-image: radial-gradient(70% 70% at 65% 30%, black, transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-copy .lede {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-page {
  padding: 150px 0 80px;
}

.hero-page .lede {
  max-width: 56ch;
  font-size: 1.1rem;
}

/* ---------- Trust bar ---------- */
.trust-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}

.trust-bar,
.trust-bar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: center;
  align-items: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.trust-item svg { flex-shrink: 0; color: var(--amber); }

.trust-item.cedia-badge {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
}

.trust-item .cedia-logo {
  height: 22px;
  width: auto;
  display: block;
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 28px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 168, 60, 0.12);
  color: var(--amber);
  margin-bottom: 20px;
}

.card h3 { margin-bottom: 10px; }

.card p { margin-bottom: 0; font-size: 0.95rem; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--amber);
}

.card-link svg { transition: transform 0.25s var(--ease); }
.card:hover .card-link svg { transform: translateX(4px); }

/* Service card variant with index number */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card .num {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 800;
  color: var(--border-strong);
  line-height: 1;
}

/* ---------- Steps / process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 0 24px 0 0;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 24px;
  left: calc(100% - 12px);
  width: calc(100% - 24px);
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
  display: none;
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 20px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-head);
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 800;
  color: var(--amber);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  padding: 64px;
  background: linear-gradient(135deg, #1c1408, #0e0b06);
  border: 1px solid rgba(242, 168, 60, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 80% at 90% 10%, rgba(242, 168, 60, 0.25), transparent 70%);
}

.cta-banner > * { position: relative; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 72px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.footer-grid img { height: 28px; width: auto; margin-bottom: 16px; }

.footer-grid h3 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: var(--text-dim); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--amber); }

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}
.social-row a:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Contact form ---------- */
.form-grid {
  display: grid;
  gap: 18px;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--amber);
}

.field textarea { resize: vertical; min-height: 130px; }

.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.contact-info-row {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.contact-info-row:last-child { border-bottom: none; }

.contact-info-row svg { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.contact-info-row .label { font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }

.notice-pending {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-style: italic;
}

/* ---------- Brand logo grid ---------- */
.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.partner-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}

.partner-badge img {
  max-height: 100%;
  max-width: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.partner-badge:hover {
  border-color: var(--amber);
  color: var(--text);
  background: rgba(242, 168, 60, 0.06);
  transform: translateY(-2px);
}

/* ---------- Scroll reveal ----------
   Progressive enhancement: content is fully visible by default so it
   never depends on JS for SEO/accessibility. The "js" class is added to
   <html> by a tiny inline script in <head> only when JS actually runs —
   only then do .reveal elements hide themselves pending animation. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible .reveal-child {
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* ---------- Misc ---------- */
.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 168, 60, 0.5), transparent);
  margin: 0 auto 56px;
  max-width: 200px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-dim);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(79, 209, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 197, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.float { animation: float 6s ease-in-out infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 380px; margin: 0 auto; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 140px 0 80px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cta-banner { padding: 40px 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
  .trust-bar .container { justify-content: center; }
  .trust-item { flex-basis: 100%; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .float, .pulse-dot, .btn, .card {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Interactive room demos — scene switcher (home-automation) and circadian
   lighting (architectural-lighting). Pure SVG + vanilla JS, no dependency.
   ========================================================================== */
.demo-shell {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.demo-stage {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #05070a;
  aspect-ratio: 8 / 5;
}

.demo-stage svg { display: block; width: 100%; height: 100%; }
.demo-stage svg [data-fx] { transition: opacity 0.7s ease, fill 0.7s ease, stop-color 0.7s ease; }

.demo-controls h3 { margin-bottom: 6px; }
.demo-controls > p { font-size: 0.92rem; margin-bottom: 22px; }

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.scene-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
  text-align: left;
}

.scene-btn:hover { transform: translateY(-2px); color: var(--text); }

.scene-btn.active {
  border-color: var(--amber);
  color: var(--text);
  background: rgba(242, 168, 60, 0.1);
}

.scene-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.scene-btn.active .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.time-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.time-readout .big {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.time-readout .tag {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.time-slider-row { margin-bottom: 18px; }

.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b3a63, #f2a83c 25%, #ffe27a 50%, #f2825c 75%, #1a2036);
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--amber);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--amber);
  cursor: pointer;
}

.time-marks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.demo-play-row { display: flex; gap: 10px; align-items: center; }

.demo-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-faint);
}

@media (max-width: 980px) {
  .demo-shell { grid-template-columns: 1fr; }
}
