/*
  A Creations / Ajbaz shared components. Depends only on tokens.css.
  Class prefix-free on purpose (small site), but every component is self-contained so it can be lifted into the Ajbaz AI site.
  Components: base, container, skip-link, eyebrow, heading, btn, pill/status, card, nav, drawer, field/form, frame (browser/phone),
  marquee, reveal, accordion (details), chat widget (cw-*).
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }
.section { padding-block: var(--section-y); position: relative; }
.section--surface { background: var(--surface); border-block: 1px solid var(--border); }

.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 1000; background: var(--accent); color: var(--on-accent); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--s-4); }

/* ---------- Type helpers ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.section-head { display: grid; gap: var(--s-4); max-width: 760px; margin-bottom: var(--s-12); }
.section-head h2 { font-size: var(--fs-2xl); line-height: 1.08; }
.section-head p { color: var(--text-2); font-size: var(--fs-md); }
.lead { font-size: var(--fs-md); color: var(--text-2); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.hl { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--raised); --btn-fg: var(--text); --btn-line: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-line);
  font: 600 var(--fs-sm)/1 var(--font-body); letter-spacing: 0.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.btn:hover { --btn-line: var(--text-500); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-line: var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-hover); --btn-line: var(--accent-hover); box-shadow: var(--glow); }
.btn--ghost { --btn-bg: transparent; }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); }
.btn--lg { min-height: 56px; padding: 0 var(--s-8); font-size: var(--fs-base); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link-arrow { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--accent); font-weight: 600; text-decoration: none; }
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease-out); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--raised); white-space: nowrap; }
.status--live { background: var(--status-live-bg); color: var(--status-live-fg); border-color: transparent; }
.status--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--demo { background: var(--status-demo-bg); color: var(--status-demo-fg); border-color: var(--status-demo-line); }
.status--soon { background: var(--status-soon-bg); color: var(--status-soon-fg); }
.status--internal { background: var(--green-900); color: var(--lime-300); border-color: var(--green-800); }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm); background: transparent; }

/* ---------- Cards ---------- */
.card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-1); transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-out), background var(--dur-2) var(--ease-out); }
.card:hover { border-color: var(--border-strong); }
.card--lift:hover { transform: translateY(-3px); }
.card h3 { font-size: var(--fs-lg); }
.card p { color: var(--text-2); }
.icon-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.icon-tile svg { width: 22px; height: 22px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 10, 10, 0.72); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2); }
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(10, 10, 10, 0.88); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); height: 72px; }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand__name { display: grid; line-height: 1.1; }
.brand__name strong { font: 600 1.05rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.brand__name span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav__links { display: flex; align-items: center; gap: var(--s-1); list-style: none; }
.nav__links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; transition: color var(--dur-1), background var(--dur-1); }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); background: var(--raised); }
.nav__actions { display: flex; align-items: center; gap: var(--s-2); }
.nav__toggle { display: none; width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--raised); cursor: pointer; place-items: center; }
.nav__toggle svg { width: 20px; height: 20px; }
@media (max-width: 960px) {
  .nav__links, .nav__actions .btn--ghost { display: none; }
  .nav__toggle { display: grid; }
}
@media (max-width: 420px) { .nav__actions .btn--primary { display: none; } }

/* ---------- Drawer (mobile menu) ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; display: none; }
.drawer.is-open { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity var(--dur-2); }
.drawer__panel { position: absolute; inset: 0 0 0 auto; width: min(360px, 88vw); background: var(--surface); border-left: 1px solid var(--border); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-6); transform: translateX(100%); transition: transform var(--dur-3) var(--ease-out); overflow-y: auto; }
.drawer.is-visible .drawer__scrim { opacity: 1; }
.drawer.is-visible .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__links { list-style: none; display: grid; gap: var(--s-1); }
.drawer__links a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 var(--s-4); border-radius: var(--r-md); text-decoration: none; font: 500 var(--fs-md)/1 var(--font-display); background: var(--card); border: 1px solid var(--border); }
.drawer__links a:hover { border-color: var(--accent-line); }

/* ---------- Form ---------- */
.field { display: grid; gap: var(--s-2); }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.field .req { color: var(--accent); }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 0 var(--s-4); background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--r-md); color: var(--text); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.textarea { padding: var(--s-3) var(--s-4); min-height: 120px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239AA296' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { display: grid; place-items: center; padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); background: var(--card); color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-sm); }
.prefix-input .input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.field__hint { font-size: var(--fs-xs); color: var(--muted); }
.field__error { font-size: var(--fs-xs); color: var(--danger); min-height: 1em; }
.form-status { font-size: var(--fs-sm); color: var(--text-2); min-height: 1.5em; }
.form-status.is-ok { color: var(--lime-300); }

/* ---------- Frames (screenshots) ---------- */
.frame { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--ink-800); border: 1px solid var(--border-strong); box-shadow: var(--shadow-3); }
.frame--browser::before { content: ""; display: block; height: 28px; background-color: var(--ink-850); border-bottom: 1px solid var(--border); background-image: radial-gradient(circle at 16px 14px, #3c413d 4px, transparent 4.5px), radial-gradient(circle at 30px 14px, #3c413d 4px, transparent 4.5px), radial-gradient(circle at 44px 14px, #3c413d 4px, transparent 4.5px); }
.frame img { width: 100%; }
.frame--phone { border-radius: 30px; padding: 8px; background: #111; border: 1px solid var(--border-strong); }
.frame--phone img { border-radius: 23px; }
.frame__label { position: absolute; left: var(--s-3); bottom: var(--s-3); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: var(--s-4); width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; flex-wrap: wrap; width: auto; } .marquee__track [aria-hidden="true"] { display: none; } .marquee { mask-image: none; -webkit-mask-image: none; } }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- Accordion ---------- */
.faq { display: grid; gap: var(--s-3); }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color var(--dur-2); }
.faq details[open] { border-color: var(--accent-line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6); cursor: pointer; list-style: none; font: 500 var(--fs-md)/1.35 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--font-body); color: var(--accent); transition: transform var(--dur-2) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 var(--s-6) var(--s-6); color: var(--text-2); }

/* ---------- Chat widget (front desk). Hidden unless config.chatUrl is set. ---------- */
.cw-button { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font: 600 15px/1 var(--font-body); cursor: pointer; box-shadow: 0 10px 30px -8px rgba(197, 255, 61, .45), 0 4px 14px rgba(0, 0, 0, .5); transition: background var(--dur-2); }
.cw-button:hover { background: var(--accent-hover); }
.cw-button svg { width: 20px; height: 20px; }
/* Desktop: 420 px wide, 80% of the screen's height (at least 560 px, never taller than the window), above the
   button. Phones (640 px and less): the whole screen. A header bar holds the close button, so nothing covers the chat. */
.cw-panel { position: fixed; right: 20px; bottom: 84px; z-index: 95; width: 420px; height: min(max(560px, 80vh), calc(100vh - 104px)); max-width: calc(100vw - 32px); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-3); display: none; flex-direction: column; }
.cw-panel.is-open { display: flex; }
.cw-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--border-strong); background: var(--surface); }
.cw-title { font: 600 15px/1.2 var(--font-body); color: var(--text); }
.cw-close { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: 50%; background: transparent; color: var(--text); font: 24px/1 var(--font-body); cursor: pointer; transition: background var(--dur-2); }
.cw-close:hover { background: var(--accent-soft); }
.cw-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cw-panel iframe { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--bg); }
@media (max-width: 640px) {
  .cw-panel { inset: 0; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .cw-head { padding: 8px 8px 8px 16px; }
  .cw-close { width: 44px; height: 44px; font-size: 28px; }
  .cw-button { right: 12px; bottom: 12px; }
  html.cw-open, html.cw-open body { overflow: hidden; }
  html.cw-open .cw-button { display: none; }
}
