/* ===========================================================================
   NalamOS — marketing site
   Built as a SIBLING of the Kedil Solutions parent site: same editorial base
   (near-black hero, warm off-white light sections, Fraunces display serif),
   extended with a restrained "AI-first" accent kit.

   Base tokens, type scale, buttons, section rhythm, header/footer and marquee
   are inherited from the parent design system (kedilsolutions.com), then
   extended below under "AI-FIRST ACCENT KIT".

   No build step, no deps.
   =========================================================================== */

:root {
  /* ---- Parent design system (inherited verbatim) ---- */
  --black:   #000000;
  --white:   #ffffff;
  --paper:   #f4f2ee;   /* warm off-white for light sections */
  --ink:     #0b0b0b;
  --muted-d: #8c8c8c;   /* muted text on dark */
  --muted-l: #6a6a66;   /* muted text on light */
  --line-d:  rgba(255,255,255,.16);
  --line-l:  rgba(0,0,0,.14);

  --maxw:   1240px;
  --gutter: clamp(20px, 5vw, 56px);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    Arial, Helvetica, "Helvetica Neue", sans-serif;

  /* ---- AI-first accent kit (new, shared with parent) ---- */
  --iris:  #7c5cff;                 /* electric indigo */
  --cyan:  #22d3ee;                 /* cyan */
  --lav:   #cfc6ff;                 /* light lavender — accent text on dark (AA safe) */
  --accent: linear-gradient(100deg, var(--iris) 0%, var(--cyan) 100%);
  --accent-soft: linear-gradient(100deg, rgba(124,92,255,.16), rgba(34,211,238,.16));
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
               Consolas, "Liberation Mono", monospace;

  /* Clinical blue — used only in the product-preview "Now Serving" mock */
  --clinic-blue-1: #1e5eff;
  --clinic-blue-2: #2b8bff;
  --clinic-blue:   linear-gradient(135deg, var(--clinic-blue-1), var(--clinic-blue-2));
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 0.98; letter-spacing: -0.02em; }

/* Global focus visibility (accessibility) */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* Skip link */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--white); color: var(--black);
  padding: 10px 16px; border-radius: 999px; font-weight: 700;
  font-size: .8rem; letter-spacing: .04em;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sec { padding-block: clamp(72px, 12vw, 160px); position: relative; }
.sec--light { background: var(--paper); color: var(--ink); }
.sec--dark  { background: var(--black); color: var(--white); }

.eyebrow {
  font-family: var(--font-body);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted-d); display: inline-flex; align-items: center; gap: 12px;
}
.sec--light .eyebrow { color: var(--muted-l); }
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .6; }

.lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--muted-d); max-width: 46ch; }
.sec--light .lead { color: var(--muted-l); }

/* ---------- Thin accent hairline (top of page) ---------- */
.top-hairline { height: 2px; width: 100%; background: var(--accent); position: relative; z-index: 70; }

/* ===========================================================================
   AI-FIRST ACCENT KIT — system chips (monospace), accent underlines, glow
   =========================================================================== */

/* System chips: small uppercase, letter-spaced mono with a pulsing dot */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: .66rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--lav);
  padding: 6px 12px 6px 11px;
  border: 1px solid rgba(124,92,255,.42);
  border-radius: 999px;
  background: rgba(124,92,255,.07);
  white-space: nowrap;
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34,211,238,.55);
  animation: dotPulse 2.4s ease-in-out infinite;
  flex: 0 0 auto;
}
.sec--light .chip { color: #4a3bb0; border-color: rgba(124,92,255,.5); background: rgba(124,92,255,.08); }

.chip-row { display: inline-flex; flex-wrap: wrap; gap: 10px; }

/* Accent underline for text links (hover) */
.a-underline {
  background-image: var(--accent);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size .28s ease;
  padding-bottom: 2px;
}
.a-underline:hover, .a-underline:focus-visible { background-size: 100% 2px; }

/* Accent button variant */
.btn--accent {
  position: relative;
  background: var(--accent); color: #0a0a12; border-color: transparent;
  box-shadow: 0 8px 30px -12px rgba(124,92,255,.7);
}
.btn--accent:hover { filter: brightness(1.07); }

/* ---------- Buttons (parent) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-body); font-weight: 700;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  padding: 15px 28px; border-radius: 999px; border: 1px solid;
  cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease, filter .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--solid-w { background: var(--white); color: var(--black); border-color: var(--white); }
.btn--solid-w:hover { background: transparent; color: var(--white); }
.btn--line-w { background: transparent; color: var(--white); border-color: var(--line-d); }
.btn--line-w:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.btn--solid-b { background: var(--black); color: var(--white); border-color: var(--black); }
.btn--solid-b:hover { background: transparent; color: var(--black); }
.btn--line-b { background: transparent; color: var(--ink); border-color: var(--line-l); }
.btn--line-b:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* ---------- Header (sticky) ---------- */
.site-header {
  position: sticky; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(6,6,8,.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-d);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; }
.brand .mark { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; }
.brand .wm { font-family: var(--font-display); font-weight: 600; font-size: clamp(1rem, 2.4vw, 1.22rem); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--white); opacity: .72; transition: opacity .15s ease; }
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a[aria-current="page"] { opacity: 1; }
.nav-right { display: inline-flex; align-items: center; gap: 18px; }
.nav-parent {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-d); display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s ease;
}
.nav-parent:hover, .nav-parent:focus-visible { color: var(--lav); }
.nav-parent .k { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); flex: 0 0 auto; }
.nav-cta { display: inline-flex; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--black); min-height: calc(100svh - 76px); display: flex; align-items: center; padding-block: clamp(56px, 9vw, 104px); }
.hero__glow {
  position: absolute; top: 42%; right: -4%; width: min(760px, 84vw); aspect-ratio: 1;
  transform: translateY(-50%);
  background: radial-gradient(circle at 50% 50%, rgba(124,92,255,.30), rgba(34,211,238,.12) 42%, transparent 66%);
  filter: blur(8px);
  pointer-events: none; z-index: 0;
  animation: glowPulse 9s ease-in-out infinite;
}
.hero .constellation {
  position: absolute; top: 50%; right: -3%; transform: translateY(-50%);
  width: min(720px, 82vw); height: auto; opacity: .92; pointer-events: none; z-index: 1;
}
.hero .container { position: relative; z-index: 2; width: 100%; }
.hero h1 { font-size: clamp(2.9rem, 10vw, 8.2rem); font-weight: 600; letter-spacing: -.03em; text-transform: lowercase; max-width: 15ch; }
.hero h1 em { font-style: italic; }
.hero h1 .grad { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { margin-top: 26px; max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--muted-d); }
.hero .sub strong { color: #d9d9d9; font-weight: 700; }
.hero .chip-row { margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; align-items: center; }
.hero-note { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted-d); margin-top: 20px; }

/* Constellation drift + node pulse */
.constellation .c-net { animation: drift 18s ease-in-out infinite; transform-origin: 60% 50%; }
.constellation .c-line { stroke: url(#cmsLine); stroke-width: 1.1; opacity: .5; }
.constellation .c-node { fill: url(#cmsNode); }
.constellation .c-node.is-spark { animation: nodePulse 4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.constellation .c-node.s2 { animation-delay: 1.1s; }
.constellation .c-node.s3 { animation-delay: 2.2s; }
.constellation .c-node.s4 { animation-delay: 3s; }

/* ---------- Marquee / trust band ---------- */
.marquee { border-block: 1px solid var(--line-d); overflow: hidden; padding-block: 20px; background: var(--black); }
.marquee__track { display: inline-flex; gap: 44px; white-space: nowrap; animation: slide 32s linear infinite; will-change: transform; }
.marquee span { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.3rem); font-style: italic; color: var(--white); opacity: .9; }
.marquee span::after { content: "◆"; margin-left: 44px; font-size: .5em; vertical-align: middle; color: var(--iris); font-style: normal; opacity: .8; }

/* ---------- Section head ---------- */
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); }
.sec-head .lead { justify-self: end; }
@media (max-width: 780px){ .sec-head { grid-template-columns: 1fr; } .sec-head .lead { justify-self: start; } }

/* ---------- Features grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); }
@media (max-width: 900px){ .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .feature-grid { grid-template-columns: 1fr; } }
.feature {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: clamp(24px, 2.6vw, 34px);
  border: 1px solid var(--line-l); border-radius: 6px;
  background: #fbfaf8;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -26px rgba(0,0,0,.4); border-color: rgba(124,92,255,.4); }
.feature .f-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: var(--iris); background: var(--accent-soft); border: 1px solid rgba(124,92,255,.28);
}
.feature .f-ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); letter-spacing: -.01em; }
.feature p { font-family: var(--font-body); color: var(--muted-l); font-size: .97rem; }
.feature .chip { margin-top: 2px; align-self: flex-start; }

/* ---------- Product preview (CSS mock, dark section) ---------- */
.preview { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 60px); align-items: center; }
@media (max-width: 900px){ .preview { grid-template-columns: 1fr; } }
.preview .p-copy h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
.preview .p-copy p { color: var(--muted-d); margin-top: 18px; max-width: 44ch; }
.preview .p-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.preview .p-list li { display: flex; gap: 12px; align-items: flex-start; font-size: .98rem; color: #d7d7d7; }
.preview .p-list li svg { flex: 0 0 auto; margin-top: 3px; color: var(--cyan); }

/* Mock app panel */
.mock {
  position: relative; border-radius: 18px; padding: 16px;
  background: #0f0f14; border: 1px solid var(--line-d);
  box-shadow: 0 30px 80px -40px rgba(124,92,255,.5);
}
.mock::before {
  content: ""; position: absolute; inset: -1px; border-radius: 18px; padding: 1px;
  background: linear-gradient(140deg, rgba(124,92,255,.6), rgba(34,211,238,.35), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 4px 6px 12px; }
.mock-bar .d { width: 10px; height: 10px; border-radius: 50%; background: #2a2a33; }
.mock-bar .t { margin-left: auto; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-d); }

/* "Now Serving" banner — clinical blue */
.now-serving {
  border-radius: 12px; padding: 16px 18px; color: #fff;
  background: var(--clinic-blue);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 12px 30px -16px rgba(30,94,255,.8);
}
.now-serving .ns-label { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.now-serving .ns-token { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1; margin-top: 4px; }
.now-serving .ns-room { text-align: right; }
.now-serving .ns-room .r { font-family: var(--font-display); font-size: 1.5rem; }
.now-serving .ns-room .s { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }

/* Queue list */
.queue { margin-top: 12px; display: grid; gap: 8px; }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #15151c; border: 1px solid var(--line-d); }
.queue-row .q-tok { font-family: var(--font-mono); font-size: .74rem; color: var(--lav); width: 46px; }
.queue-row .q-name { font-size: .9rem; color: #e6e6e6; }
.queue-row .q-status { margin-left: auto; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d); }
.queue-row.is-next { border-color: rgba(34,211,238,.4); }
.queue-row.is-next .q-status { color: var(--cyan); }

/* Quick-action grid */
.quick { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick .qa { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: #15151c; border: 1px solid var(--line-d); font-size: .82rem; color: #dcdcdc; }
.quick .qa svg { color: var(--iris); flex: 0 0 auto; }

/* AI draft note mock */
.ai-note { margin-top: 12px; border-radius: 10px; padding: 12px 14px; background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.3); }
.ai-note .an-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ai-note .an-title { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--lav); }
.ai-note .an-line { height: 7px; border-radius: 4px; background: linear-gradient(90deg, rgba(207,198,255,.5), rgba(207,198,255,.12)); margin-top: 7px; }
.ai-note .an-line.w1 { width: 92%; } .ai-note .an-line.w2 { width: 78%; } .ai-note .an-line.w3 { width: 60%; }

/* ---------- Services / How it works (editorial list, from parent) ---------- */
.svc { border-top: 1px solid var(--line-l); }
.sec--dark .svc { border-color: var(--line-d); }
.svc-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 24px; align-items: baseline; padding: clamp(24px, 3.4vw, 40px) 0; border-bottom: 1px solid var(--line-l); transition: padding-left .3s ease, background .3s ease; }
.sec--dark .svc-item { border-color: var(--line-d); }
.svc-item:hover { padding-left: 16px; }
.svc-num { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; letter-spacing: .1em; color: var(--iris); }
.svc-title { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 3rem); font-weight: 600; letter-spacing: -.02em; }
.svc-desc { font-family: var(--font-body); max-width: 38ch; color: var(--muted-l); font-size: .98rem; }
.sec--dark .svc-desc { color: var(--muted-d); }
@media (max-width: 720px){ .svc-item { grid-template-columns: 40px 1fr; } .svc-desc { grid-column: 2; margin-top: 6px; } }

/* ---------- Big statement / CTA ---------- */
.statement { text-align: center; }
.statement .chip-row { justify-content: center; display: flex; margin-bottom: 26px; }
.statement h2 { font-size: clamp(2.6rem, 9vw, 7rem); text-transform: lowercase; letter-spacing: -.03em; }
.statement h2 em { font-style: italic; }
.statement h2 .grad { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statement .hero-cta { justify-content: center; margin-top: 40px; }
.statement p { margin: 20px auto 0; max-width: 50ch; color: var(--muted-d); }
.sec--light .statement p { color: var(--muted-l); }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding-block: clamp(64px, 9vw, 116px) 40px; border-top: 1px solid var(--line-d); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 52px; border-bottom: 1px solid var(--line-d); }
.footer-big { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.02em; text-transform: lowercase; line-height: 1; }
.footer-big .grad { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-parent { margin-top: 16px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-d); display: inline-flex; align-items: center; gap: 8px; }
.footer-parent .k { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.footer-col h4 { font-family: var(--font-body); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-d); margin-bottom: 16px; }
.footer-col a { display: block; padding: 6px 0; opacity: .8; }
.footer-col a:hover, .footer-col a:focus-visible { opacity: 1; }
.footer-bottom { margin-top: 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-body); font-size: .78rem; letter-spacing: .06em; color: var(--muted-d); }
@media (max-width: 780px){ .footer-top { grid-template-columns: 1fr 1fr; } .footer-big { grid-column: 1 / -1; } }

/* ---------- Rotating badge ---------- */
.badge-spin { position: fixed; right: clamp(16px, 3vw, 34px); bottom: clamp(16px, 3vw, 34px); width: 112px; height: 112px; z-index: 40; display: grid; place-items: center; }
.badge-spin .ring { position: absolute; inset: 0; animation: spin 18s linear infinite; }
.badge-spin .ring text { font-family: var(--font-mono); font-size: 7.6px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; fill: var(--lav); }
.badge-spin .disc { grid-area: 1 / 1; place-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); }
.badge-spin .ico { grid-area: 1 / 1; place-self: center; position: relative; z-index: 1; color: #0a0a12; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px){ .badge-spin { display: none; } }

/* ---------- 404 ---------- */
.notfound { min-height: 68vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-family: var(--font-display); font-size: clamp(5rem, 20vw, 12rem); line-height: .9; }
.notfound .code .grad { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===========================================================================
   Animations
   =========================================================================== */
@keyframes slide     { to { transform: translateX(-50%); } }
@keyframes glowPulse { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes drift     { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-10px,-14px) scale(1.015); } }
@keyframes nodePulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); } }
@keyframes dotPulse  { 0% { box-shadow: 0 0 0 0 rgba(34,211,238,.5); } 70% { box-shadow: 0 0 0 6px rgba(34,211,238,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .hero__glow { right: -30%; opacity: .7; }
  .hero .constellation { right: -28%; opacity: .38; }
  /* Collapse secondary nav so the full product wordmark always fits */
  .nav-links, .nav-parent { display: none; }
}
@media (max-width: 560px){
  /* Header stays uncluttered: hero carries the primary CTA on small screens */
  .nav-cta { display: none; }
}

/* ---------- Reduced motion: freeze all drift/pulse/spin ---------- */
@media (prefers-reduced-motion: reduce){
  html { scroll-behavior: auto; }
  .hero__glow,
  .constellation .c-net,
  .constellation .c-node.is-spark,
  .badge-spin .ring,
  .marquee__track,
  .chip .dot,
  .btn,
  .feature { animation: none !important; transition: none !important; }
}
