/* ============================================================
   SHADAB KHAN — PORTFOLIO STYLES
   Identity: dark editorial. Ink ground, paper type, mono data
   labels, one acid accent. Restrained 5-colour palette:
   ink / surface / paper / muted / accent.
   Mobile-first. Everything themed from the tokens below.
   ============================================================ */

:root {
  --ink: #0b0d12;          /* page ground */
  --surface: #12151d;      /* raised panels */
  --paper: #eef0f4;        /* primary type */
  --muted: #8b93a7;        /* secondary type */
  --accent: #c6f24e;       /* the one loud thing */
  --accent-ink: #0b0d12;   /* type on accent */
  --line: #232836;         /* hairlines */

  /* Placeholder chips: visible, editable, unmistakable */
  --ph: #ffc978;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --max: 1200px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }
.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 300;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 0.55rem 1rem; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none !important; flex-wrap: wrap; }
  .cursor-glow { display: none !important; }
}

/* ---------- Cursor glow (desktop only; JS positions it) ---------- */
.cursor-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 242, 78, 0.055) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  top: 0; left: 0; opacity: 0;
  transition: opacity 0.5s;
}
@media (hover: none), (pointer: coarse) { .cursor-glow { display: none; } }

/* ---------- Progress hairline ---------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: var(--accent);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-name { font-size: 0.9rem; letter-spacing: 0.14em; color: var(--paper); }

.nav-links { display: none; gap: 2rem; }
.nav-links a {
  font-size: 0.86rem; color: var(--muted); font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--paper); }
.nav-links a.active .nav-idx { color: var(--accent); }
.nav-idx { color: var(--muted); font-size: 0.68rem; margin-right: 0.3rem; }
.nav-contact { color: var(--accent) !important; }

.nav-burger {
  display: flex; flex-direction: column; gap: 7px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-burger span {
  width: 26px; height: 2px; background: var(--paper);
  transition: transform 0.3s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}

/* Full-screen mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
/* explicit display would defeat the hidden attribute — restore it */
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500; color: var(--paper);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 1rem;
}
.mobile-menu a .mono { color: var(--accent); font-size: 0.85rem; }
.mobile-menu-foot { color: var(--muted); margin-top: 2.5rem; }

/* ---------- Layout primitives ---------- */
main { position: relative; z-index: 1; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter) 0;
}

.section-head {
  display: flex; align-items: baseline; gap: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-idx { color: var(--accent); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 500; letter-spacing: -0.02em;
}
.section-note { color: var(--muted); margin: -1.5rem 0 2.5rem; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Placeholder chips ---------- */
.ph {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--ph);
  border: 1px dashed color-mix(in srgb, var(--ph) 55%, transparent);
  border-radius: 3px;
  padding: 0.05em 0.4em;
  cursor: help;
  white-space: normal;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(8rem, 16vh, 11rem) var(--gutter) 0;
}
.hero-eyebrow { color: var(--accent); margin-bottom: 2rem; text-transform: uppercase; }

.hero-h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8.5vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.hero-line { display: block; }
.hero-h1 em { position: relative; }
/* hand-set underline on the money phrase */
.hero-h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em;
  height: 0.06em; background: var(--accent); opacity: 0.9;
  transform-origin: left; transform: scaleX(0);
  animation: rule-in 0.9s 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
@keyframes rule-in { to { transform: scaleX(1); } }

.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--paper); max-width: 560px; margin-bottom: 0.75rem; }
.hero-tags { color: var(--muted); margin-bottom: 2.5rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: clamp(3rem, 7vw, 4.5rem); }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--accent);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }
.btn-line { color: var(--paper); border-color: var(--line); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Stats: instrument readouts on a hairline grid */
.hero-stats {
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .hero-stats { grid-template-columns: repeat(3, 1fr); } }

.hstat {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .hstat { border-bottom: 0; border-right: 1px solid var(--line); padding: 1.75rem 2rem; }
  .hstat:first-child { padding-left: 0; }
  .hstat:last-child { border-right: 0; }
}
.hstat-num {
  display: block;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.hstat-arrow { color: var(--muted); font-size: 0.6em; margin: 0 0.15em; }
.hstat-unit { color: var(--muted); font-size: 0.42em; margin-left: 0.3em; letter-spacing: 0.1em; }
.hstat-label { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.hero-footnote { color: var(--muted); opacity: 0.75; margin-top: 1.25rem; }

/* ---------- Lifecycle loop (signature element) ---------- */
.loop-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 6.5rem) var(--gutter) 0;
}
.loop-scroll { overflow-x: auto; scrollbar-width: thin; }
.loop-svg { min-width: 760px; width: 100%; display: block; }

.loop-path { fill: none; stroke: var(--line); stroke-width: 2; }
.loop-flow {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-dasharray: 10 14;
  animation: flow 2.6s linear infinite;
  opacity: 0.5;
}
@keyframes flow { to { stroke-dashoffset: -48; } }
.loop-arrow { fill: var(--accent); }

/* travelling customer dots (SMIL motion) */
.loop-dot { fill: var(--accent); }
.loop-dot-2 { opacity: 0.55; }

/* node cores + expanding pulse rings, staggered in journey order */
.loop-core { fill: var(--ink); stroke: var(--accent); stroke-width: 2.5; }
.loop-ring {
  fill: none; stroke: var(--accent); stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: ring 3.3s var(--pd, 0s) ease-out infinite;
  opacity: 0;
}
@keyframes ring {
  0%   { transform: scale(1); opacity: 0.8; }
  55%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.loop-label {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em;
  fill: var(--paper); text-anchor: middle;
}
.loop-sub {
  font-family: var(--font-mono); font-size: 11px;
  fill: var(--muted); text-anchor: middle;
}
.loop-cap { font-style: italic; }

/* Reduced motion: freeze SMIL dots too */
@media (prefers-reduced-motion: reduce) {
  .loop-dot, .loop-dot-2 { display: none; }
  .loop-ring { display: none; }
}

/* ---------- About ---------- */
.about-body { max-width: 820px; }
.about-lede {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.about-second { color: var(--paper); font-size: 1.02rem; max-width: 760px; }
.about-note { margin-top: 1.5rem; }

/* ---------- Capabilities: tabbed console ---------- */
.cap-title { color: var(--muted); text-transform: uppercase; margin-bottom: 1rem; }

.tabs { border: 1px solid var(--line); background: var(--surface); }

.tab-list { display: flex; border-bottom: 1px solid var(--line); }
.tab-btn {
  flex: 1;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.9vw, 1.05rem);
  font-weight: 500;
  color: var(--muted);
  padding: 1.1rem 0.75rem;
  position: relative;
  transition: color 0.25s, background 0.25s;
}
.tab-btn + .tab-btn { border-left: 1px solid var(--line); }
.tab-btn:hover { color: var(--paper); }
.tab-btn .tab-num { color: var(--muted); margin-right: 0.4rem; font-size: 0.7rem; }
.tab-btn.active { color: var(--paper); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tab-btn.active .tab-num { color: var(--accent); }
/* sliding accent indicator under the active tab */
.tab-btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.tab-btn.active::after { transform: scaleX(1); }

.tab-panels { padding: clamp(1.5rem, 4vw, 2.5rem); }
.tab-panel[hidden] { display: none; }

.tab-lede {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  max-width: 640px;
  margin-bottom: 1.5rem;
}

.tab-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.tab-chips li {
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  color: var(--paper);
  background: var(--ink);
  transition: border-color 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(10px);
}
.tab-chips li:hover { border-color: var(--accent); transform: translateY(-2px); }
.chip-note { font-size: 0.68rem; color: var(--accent); margin-left: 0.35rem; }

/* chips cascade in whenever their panel becomes active */
.tab-panel.active .tab-chips li {
  animation: chip-in 0.45s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes chip-in { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .tab-chips li { opacity: 1; transform: none; }
}

.tab-proof {
  color: var(--accent);
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}

.cap-channels { margin-top: 2.75rem; }

/* Channels marquee */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  /* soft fade at the edges */
  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; width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-seq {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.2vw, 2rem);
  white-space: nowrap;
  color: var(--paper);
}
.marquee-seq i { color: var(--accent); font-style: normal; padding: 0 0.4em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Case studies ---------- */
.cases { border-top: 1px solid var(--line); }

.case { border-bottom: 1px solid var(--line); }

.case-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.4rem 0;
  background: none; border: 0; cursor: pointer;
  color: var(--paper); text-align: left;
  transition: color 0.2s;
}
.case-head:hover .case-title { color: var(--accent); }
.case-head-static { cursor: default; }

.case-idx { color: var(--muted); }
.case-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.case-kpi { color: var(--accent); white-space: nowrap; }
.case-kpi-soon { color: var(--muted); border: 1px dashed var(--line); padding: 0.25rem 0.7rem; }

/* plus / minus toggle drawn in CSS */
.case-toggle { position: relative; width: 16px; height: 16px; }
.case-toggle::before, .case-toggle::after {
  content: ""; position: absolute; background: var(--muted);
  transition: transform 0.3s, background 0.2s;
}
.case-toggle::before { top: 7px; left: 0; width: 16px; height: 2px; }
.case-toggle::after { top: 0; left: 7px; width: 2px; height: 16px; }
.case-head[aria-expanded="true"] .case-toggle::after { transform: rotate(90deg); }
.case-head[aria-expanded="true"] .case-toggle::before { background: var(--accent); }
.case-head[aria-expanded="true"] .case-toggle::after { background: var(--accent); }

@media (max-width: 719px) {
  .case-head { grid-template-columns: auto 1fr auto; }
  .case-kpi { display: none; } /* keep mobile rows quiet; KPI appears inside */
}

/* Smooth expand via the 0fr → 1fr grid-row trick (no JS height math) */
.case-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.case-body.open { grid-template-rows: 1fr; }
.case-inner { overflow: hidden; }

.case-row {
  display: grid; grid-template-columns: 1fr;
  gap: 0.3rem 2rem;
  padding: 0.9rem 0;
  border-top: 1px dashed var(--line);
}
.case-inner dl { padding-bottom: 1.75rem; }
.case-row dt { color: var(--accent); text-transform: uppercase; }
.case-row dd { color: var(--paper); font-size: 0.95rem; max-width: 760px; }
@media (min-width: 720px) {
  .case-row { grid-template-columns: 140px 1fr; }
}

.case-soon .case-title { color: var(--muted); }

/* ---------- Credentials ---------- */
.cred-list { list-style: none; border-top: 1px solid var(--line); margin-bottom: 3.5rem; }
.cred {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.cred-name { font-size: 0.98rem; }
.cred-meta { display: flex; align-items: baseline; gap: 1.25rem; }
.cred-status { color: var(--muted); text-transform: uppercase; }
.cred-done { color: var(--accent); }

/* "view certificate" button — injected by JS only when the image exists */
.cred-view {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: none;
  border: 1px solid var(--line);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.cred-view:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Certificate lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 250;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 5vw, 3rem);
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  max-width: min(880px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.lightbox img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--surface);
}
.lightbox figcaption { color: var(--muted); }
.lightbox-close {
  position: absolute; top: 1.25rem; right: var(--gutter);
  background: none; border: 1px solid var(--line);
  color: var(--paper); cursor: pointer;
  padding: 0.5rem 1rem;
  transition: border-color 0.2s, color 0.2s;
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Testimonials carousel ---------- */
.testi-block { margin-top: 1rem; }

.testi-carousel {
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.testi-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.testi-slide {
  flex: 0 0 100%;
  padding: clamp(1.75rem, 4.5vw, 3rem);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "avatar quote" "avatar meta";
  gap: 0.75rem 1.5rem;
  align-items: start;
}
@media (max-width: 600px) {
  .testi-slide { grid-template-columns: 1fr; grid-template-areas: "avatar" "quote" "meta"; }
}

.testi-avatar {
  grid-area: avatar;
  width: 64px; height: 64px;
}
.testi-avatar circle { fill: var(--ink); stroke: var(--accent); stroke-width: 2; }
.testi-avatar text {
  font-family: var(--font-mono); font-size: 20px;
  fill: var(--accent); text-anchor: middle;
}

.testi-slide blockquote {
  grid-area: quote;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.testi-slide figcaption {
  grid-area: meta;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem;
}
.testi-name { font-weight: 600; }
.testi-title { color: var(--muted); }
.testi-sample {
  color: var(--ph);
  border: 1px dashed color-mix(in srgb, var(--ph) 55%, transparent);
  padding: 0.05rem 0.5rem;
  font-size: 0.68rem;
  cursor: help;
}

.testi-dots {
  display: flex; gap: 0.6rem; justify-content: center;
  padding: 0 0 1.25rem;
}
.testi-dot {
  width: 26px; height: 4px;
  background: var(--line);
  border: 0; cursor: pointer;
  transition: background 0.3s;
}
.testi-dot.active { background: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(4rem, 9vw, 7rem); }
.contact-lede {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  font-weight: 500; letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 0.75rem;
}
.contact-sub { color: var(--muted); margin-bottom: 2.25rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.contact-loc { color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: center; justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2rem;
  color: var(--muted);
}
.footer a { transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
