/* ============================================================
   koushikdeb.com — research & patent explainer pages
   ============================================================ */

:root {
  --bg: #070c18;
  --bg-2: #0b1226;
  --bg-3: #101a33;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #e8eefb;
  --muted: #94a3bd;
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.14);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.14);
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16.5px; line-height: 1.75;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
img, svg { max-width: 100%; height: auto; }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--teal); color: #04231e; }

/* ---------- top bar ---------- */
.pnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7, 12, 24, 0.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.pnav-logo { display: flex; align-items: center; gap: 10px; }
.pnav-logo .mark {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: #04231e; background: linear-gradient(135deg, var(--teal), #6ee7d8);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
}
.pnav-logo .word { font-family: var(--font-display); font-weight: 600; color: var(--text); font-size: 14.5px; }
.pnav-back {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600;
  color: var(--muted); border: 1px solid var(--card-border);
  padding: 8px 16px; border-radius: 999px; transition: all .25s;
}
.pnav-back:hover { color: var(--teal); border-color: var(--teal); }

/* ---------- hero ---------- */
.phero {
  position: relative; max-width: 900px; margin: 0 auto;
  padding: clamp(48px, 8vw, 84px) clamp(20px, 5vw, 40px) 20px;
  text-align: center;
}
.phero::before {
  content: ""; position: fixed; top: -180px; right: -160px; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(45,212,191,.16), transparent 65%);
  filter: blur(70px); pointer-events: none; z-index: -1;
}
.phero::after {
  content: ""; position: fixed; bottom: -180px; left: -160px; width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(251,191,36,.12), transparent 65%);
  filter: blur(70px); pointer-events: none; z-index: -1;
}
.ptype {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--teal);
  background: var(--teal-dim); border: 1px solid rgba(45,212,191,.3);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 22px;
  animation: fadeUp .7s .05s both;
}
.ptype.patent { color: var(--amber); background: var(--amber-dim); border-color: rgba(251,191,36,.3); }
.phero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 4.6vw, 42px); line-height: 1.22; letter-spacing: -0.6px;
  animation: fadeUp .7s .15s both;
}
.pauthors { color: var(--muted); margin-top: 16px; font-size: 15.5px; animation: fadeUp .7s .25s both; }
.pauthors em { color: var(--amber); font-style: normal; }
.pbadges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; animation: fadeUp .7s .35s both; }
.pbadges span {
  font-size: 13px; font-weight: 600; padding: 6px 15px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border); color: var(--muted);
}
.pbadges span.hot { color: var(--amber); border-color: rgba(251,191,36,.35); background: var(--amber-dim); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- animated scene ---------- */
.pscene {
  max-width: 860px; margin: clamp(30px, 5vw, 48px) auto 0;
  padding: 0 clamp(16px, 4vw, 32px);
  animation: fadeUp .8s .45s both;
}
.scene-frame {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--card-border); border-radius: 20px;
  padding: clamp(14px, 3vw, 30px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden;
}
.scene-frame svg { display: block; width: 100%; height: auto; }
.scene-caption {
  text-align: center; color: var(--muted); font-size: 13.5px;
  margin-top: 12px; font-style: italic;
}

/* ---------- body ---------- */
.pbody { max-width: 760px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 40px) 40px; }
.pbody h2 {
  font-family: var(--font-display); font-size: clamp(21px, 3vw, 27px);
  margin: 44px 0 16px; display: flex; align-items: center; gap: 12px;
}
.pbody h2:first-child { margin-top: 0; }
.pbody h2::before {
  content: ""; width: 26px; height: 3px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}
.pbody p { color: var(--muted); margin-bottom: 16px; }

/* steps */
.steps { list-style: none; counter-reset: step; margin: 22px 0 8px; }
.steps li {
  counter-increment: step; position: relative;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 18px 20px 18px 66px; margin-bottom: 12px;
  color: var(--muted); font-size: 15.5px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: #04231e; background: linear-gradient(135deg, var(--teal), #6ee7d8);
}
.steps li strong { display: block; margin-bottom: 2px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* callout */
.callout {
  background: linear-gradient(120deg, var(--teal-dim), var(--amber-dim));
  border: 1px solid rgba(45,212,191,.3); border-radius: 14px;
  padding: 20px 24px; margin: 22px 0; color: var(--text); font-size: 15.5px;
}

/* cta row */
.pcta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }
.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
  padding: 12px 24px; border-radius: 999px; display: inline-block;
  transition: transform .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
  background: linear-gradient(120deg, var(--teal), #4be0c8); color: #04231e;
  box-shadow: 0 8px 28px rgba(45, 212, 191, 0.3);
}
.btn-ghost { border: 1px solid var(--card-border); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* prev/next explore */
.pmore {
  max-width: 760px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px) 60px;
}
.pmore-box {
  display: flex; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--card-border); padding-top: 26px;
}
.pmore a { font-size: 14px; color: var(--muted); max-width: 46%; transition: color .25s; }
.pmore a:hover { color: var(--teal); }
.pmore .lbl { display: block; font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.pmore a.next { text-align: right; margin-left: auto; }

/* footer */
.pfoot {
  text-align: center; color: var(--muted); font-size: 13.5px;
  border-top: 1px solid var(--card-border); padding: 30px 20px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- breadcrumbs ---------- */
.crumbs {
  max-width: 900px; margin: 0 auto; padding: 16px clamp(20px, 5vw, 40px) 0;
  font-size: 13px; color: var(--muted);
}
.crumbs a { color: var(--muted); transition: color .2s; }
.crumbs a:hover { color: var(--teal); }
.crumbs .sep { margin: 0 8px; opacity: .5; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }

/* ---------- related links ---------- */
.related {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--card-border);
  font-size: 14px;
}
.related-lbl {
  font-family: var(--font-display); font-size: 11.5px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted);
}
.related a { color: var(--teal); }
.related a:hover { text-decoration: underline; }
/* in-text links underlined (WCAG 1.4.1) */
.pbody p a, .steps a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
