/* ==========================================================================
   CM AHADI LIMITED — site stylesheet
   Self-contained: system fonts only, zero external resource references, CSP-safe.
   Palette: deep navy + warm amber, teal secondary (brand-matched).
   ========================================================================== */

/* ---------- Custom properties ---------- */
:root {
  --navy-950: #0a1424;
  --navy-900: #0d1b2e;
  --navy-850: #102036;
  --navy-800: #13253f;
  --navy-700: #1c3050;
  --navy-line: #23395a;

  --amber-400: #f2a83c;
  --amber-300: #f7bd66;
  --amber-800: #8a5a0c;

  --teal-400: #4ec5ce;
  --teal-300: #6fd3da;

  --paper: #f7f4ee;
  --paper-card: #ffffff;
  --paper-line: #e7e0d2;

  --ink: #182238;
  --ink-mid: #55627a;

  --text-hi: #e8eef7;
  --text-mid: #a9b7cd;
  --text-low: #8fa0ba;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --shadow-navy: 0 18px 44px rgba(2, 8, 20, 0.45);
  --shadow-paper: 0 14px 34px rgba(24, 34, 56, 0.10);

  --header-h: 72px;
  --container: 1120px;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-hi);
  background-color: var(--navy-900);
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: inherit;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

a {
  color: var(--amber-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--amber-400);
}

:focus-visible {
  outline: 3px solid var(--amber-400);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--amber-400);
  color: var(--navy-950);
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.08em 0.4em;
  white-space: nowrap;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--amber-400);
  color: var(--navy-950);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 2px;
}

/* ---------- Eyebrows & headings ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  flex: none;
}

.eyebrow-light {
  color: var(--amber-400);
}

.eyebrow-dark {
  color: var(--amber-800);
}

.section-title {
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.5rem);
  font-weight: 800;
}

.section-lead {
  font-size: clamp(1.02rem, 0.98rem + 0.35vw, 1.15rem);
  max-width: 62ch;
  margin-bottom: 0;
}

.section-lead-light {
  color: var(--text-mid);
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber-400);
  color: var(--navy-950);
}

.btn-primary:hover {
  background: var(--amber-300);
  color: var(--navy-950);
}

.btn-ghost-light {
  background: transparent;
  border-color: rgba(232, 238, 247, 0.38);
  color: var(--text-hi);
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(232, 238, 247, 0.6);
  color: #ffffff;
}

.text-link {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}

.text-link-dark {
  color: var(--amber-800);
}

.text-link-dark:hover {
  color: #a06a10;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 27, 46, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.brand-logo {
  height: 46px;
  width: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--text-mid);
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-toggle {
  display: none;
}

/* Mobile navigation: with JS, collapse behind the toggle;
   without JS, links simply stack and stay reachable. */
@media (max-width: 767px) {
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 0;
  }

  .nav-list li + li .nav-link {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  html.js .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 10px;
    background: transparent;
    border: 1.5px solid rgba(232, 238, 247, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
  }

  .nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text-hi);
  }

  html.js .site-nav {
    position: absolute;
    top: 100%;
    left: -1.25rem;
    right: -1.25rem;
    background: var(--navy-850);
    border-bottom: 1px solid var(--navy-line);
    box-shadow: var(--shadow-navy);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
  }

  html.js .site-header.nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-open .nav-toggle {
    border-color: var(--amber-400);
  }

  .nav-open .nav-toggle-bar:nth-child(3) {
    background: var(--amber-400);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js .site-nav {
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(640px 420px at 88% -10%, rgba(242, 168, 60, 0.13), transparent 65%),
    radial-gradient(760px 540px at -12% 108%, rgba(78, 197, 206, 0.11), transparent 62%),
    var(--navy-900);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(720px 480px at 70% 20%, rgba(0, 0, 0, 0.9), transparent 75%);
  mask-image: radial-gradient(720px 480px at 70% 20%, rgba(0, 0, 0, 0.9), transparent 75%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 4rem;
  }
}

.hero-title {
  font-size: clamp(2.1rem, 1.4rem + 3.6vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem);
  color: var(--text-mid);
  max-width: 56ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-low);
}

.hero-meta li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-meta li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-400);
  flex: none;
}

/* Brand badge */
.hero-brand {
  display: flex;
  justify-content: center;
}

.brand-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: min(280px, 78vw);
  padding: clamp(2rem, 6vw, 3rem) 2rem;
  background: linear-gradient(160deg, #fbf9f4, var(--paper));
  border-radius: 28px;
  box-shadow:
    0 30px 70px rgba(2, 8, 20, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.brand-badge::before,
.brand-badge::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  pointer-events: none;
}

.brand-badge::before {
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  border-color: rgba(78, 197, 206, 0.22);
}

.brand-badge::after {
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  border-color: rgba(242, 168, 60, 0.16);
}

.brand-badge img {
  height: clamp(96px, 22vw, 120px);
  width: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .brand-badge {
    animation: badge-float 7s ease-in-out infinite;
  }

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

/* ---------- Sections ---------- */
.section {
  padding: clamp(3.75rem, 9vw, 6.5rem) 0;
}

.section-paper {
  background: var(--paper);
  color: var(--ink);
}

.section-navy {
  background:
    radial-gradient(700px 420px at 108% 0%, rgba(78, 197, 206, 0.07), transparent 60%),
    var(--navy-850);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 900px) {
  .card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1080px) {
  .card-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.card-paper {
  background: var(--paper-card);
  border: 1px solid var(--paper-line);
  box-shadow: var(--shadow-paper);
  color: var(--ink);
}

.card-navy {
  background: linear-gradient(170deg, var(--navy-800), var(--navy-850));
  border: 1px solid var(--navy-line);
  box-shadow: 0 10px 26px rgba(2, 8, 20, 0.3);
}

.card-title {
  font-size: 1.08rem;
  font-weight: 750;
  margin: 0.9rem 0 0.4rem;
}

.card-text {
  font-size: 0.95rem;
  color: var(--ink-mid);
  margin-bottom: 0;
}

.card-navy .card-text {
  color: var(--text-mid);
}

.card-cta .text-link {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }

  .card-paper:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(24, 34, 56, 0.16);
    border-color: #d9cfb8;
  }

  .card-navy:hover {
    transform: translateY(-4px);
    border-color: #2f4a73;
    box-shadow: 0 18px 40px rgba(2, 8, 20, 0.45);
  }
}

/* Icon tiles */
.icon-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex: none;
}

.icon-tile-amber {
  background: #fbefdb;
  color: var(--amber-800);
  box-shadow: 0 0 0 1px #f0dcb4 inset;
}

.icon-tile-teal {
  background: rgba(78, 197, 206, 0.12);
  color: var(--teal-300);
  box-shadow: 0 0 0 1px rgba(78, 197, 206, 0.25) inset;
}

.icon {
  width: 24px;
  height: 24px;
}

/* ---------- Product (Paussible) ---------- */
.product-tagline {
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.4rem);
  font-weight: 650;
  color: var(--amber-800);
  margin: -0.4rem 0 0.9rem;
}

.section-paper .section-lead {
  color: var(--ink-mid);
}

/* ---------- About / pipeline ---------- */
.about-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4.5rem;
    align-items: center;
  }
}

.about-text {
  color: var(--ink-mid);
  max-width: 56ch;
}

.pipeline {
  list-style: none;
  position: relative;
  display: grid;
  gap: 1.9rem;
  margin: 0;
  padding: 0;
}

/* Mobile: vertical track on the left */
.pipeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber-400), #d8d0bf);
  border-radius: 2px;
}

.pipeline-step {
  position: relative;
  padding-left: 2.1rem;
}

.pipeline-dot {
  position: absolute;
  left: 0;
  top: 0.32rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-card);
  border: 3px solid var(--amber-400);
  box-shadow: 0 0 0 4px var(--paper);
}

.pipeline-step:last-child .pipeline-dot {
  background: var(--amber-400);
}

.pipeline-name {
  display: block;
  font-weight: 750;
  color: var(--ink);
}

.pipeline-note {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-mid);
}

@media (min-width: 760px) {
  .pipeline {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding-top: 6px;
  }

  .pipeline::before {
    left: 0;
    right: 0;
    top: 13px;
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-400), #d8d0bf);
  }

  .pipeline-step {
    padding-left: 0;
    padding-top: 2.1rem;
  }

  .pipeline-dot {
    top: 5px;
    left: 0;
    box-shadow: 0 0 0 4px var(--paper);
  }
}

/* ---------- Contact ---------- */
.contact-card {
  gap: 0.4rem;
}

.contact-card .btn {
  margin-top: 1.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  border-top: 1px solid #1c2c47;
  padding: clamp(2.75rem, 6vw, 4rem) 0 1.75rem;
}

.footer-grid {
  display: grid;
  gap: 2.25rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.5fr 0.75fr 0.9fr;
    gap: 3rem;
  }
}

.footer-logo {
  height: 44px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-tagline {
  color: var(--text-low);
  font-size: 0.95rem;
  max-width: 34ch;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-400);
  margin: 0 0 1rem;
}

.footer-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.footer-list a {
  color: var(--text-mid);
  text-decoration: none;
}

.footer-list a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  border-top: 1px solid #1c2c47;
  padding-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-low);
}

.footer-bottom p {
  margin: 0;
}

.footer-note {
  font-style: italic;
}

/* ---------- 404 ---------- */
.error-section {
  min-height: calc(100svh - var(--header-h) - 120px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 0;
  background:
    radial-gradient(560px 380px at 50% -10%, rgba(242, 168, 60, 0.1), transparent 65%),
    var(--navy-900);
}

.error-content {
  display: grid;
  justify-items: center;
  max-width: 620px;
}

.error-content .eyebrow {
  justify-content: center;
}

.error-pause {
  display: flex;
  gap: 14px;
  margin-bottom: 1.75rem;
}

.error-pause-bar {
  width: 18px;
  height: 64px;
  border-radius: 10px;
  background: var(--amber-400);
  box-shadow: 0 10px 26px rgba(242, 168, 60, 0.35);
}

.error-title {
  font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.error-text {
  color: var(--text-mid);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .error-pause-bar {
    animation: pause-breathe 3.2s ease-in-out infinite;
  }

  .error-pause-bar:nth-child(2) {
    animation-delay: 0.4s;
  }

  @keyframes pause-breathe {
    0%,
    100% {
      transform: scaleY(1);
    }
    50% {
      transform: scaleY(0.72);
    }
  }
}

.site-footer-slim {
  padding-bottom: 2rem;
}

/* ---------- Reveal on scroll (only when JS + motion allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js.anim .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  html.js.anim .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  html.js.anim .card-grid .reveal:nth-child(2) {
    transition-delay: 0.06s;
  }

  html.js.anim .card-grid .reveal:nth-child(3) {
    transition-delay: 0.12s;
  }

  html.js.anim .card-grid .reveal:nth-child(4) {
    transition-delay: 0.18s;
  }
}
