/* ============================================================
   RONIL BASU — COMIC ISSUE
   Paper-white comic book: halftone texture, hard offset sticker
   shadows, Bangers display over Archivo body, candy-stripe
   progress. No build step. No framework.

   Motion contract: everything animated lives inside
   @media (prefers-reduced-motion: no-preference) EXCEPT the
   scroll-linked progress fill (position report, not decoration).
   The static page is complete without JS — reveals only hide
   content under html.js + motion-ok.
   ============================================================ */

:root {
  --paper: #fbfaf5;
  --paper-2: #f2efe6;
  --ink: #15151c;
  --ink-soft: #4a4a58;
  --red: #e0202f;
  --red-deep: #b30e1e;
  --blue: #2342d6;
  --blue-deep: #16289b;
  --yellow: #ffc400;
  --line: rgba(21, 21, 28, 0.16);
  --shadow: 4px 4px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

/* ---- skip link ---------------------------------------------- */

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---- halftone texture --------------------------------------- */

.halftone {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1.6px);
  background-size: 14px 14px;
  opacity: 0.4;
}

.halftone-red {
  position: fixed;
  top: -160px;
  right: -160px;
  width: 560px;
  height: 560px;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(224, 32, 47, 0.5) 1.5px, transparent 2.2px);
  background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent 72%);
  mask-image: radial-gradient(closest-side, #000, transparent 72%);
}

/* ---- candy-stripe progress (scroll-linked: NOT motion-gated) - */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 7px;
  z-index: 100;
}

.progress i {
  display: block;
  height: 5px;
  width: 0;
  border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--red) 0 30px, var(--blue) 30px 60px);
}

/* ---- HUD corner labels --------------------------------------- */

.hud {
  position: fixed;
  z-index: 40;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  pointer-events: none;
}

.hud-tl {
  top: 110px;
  left: 14px;
  writing-mode: vertical-rl;
}

.hud-br {
  bottom: 14px;
  right: 16px;
}

/* ---- nav ------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.nav-logo {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-decoration: none;
  text-shadow:
    2px 2px 0 var(--yellow),
    4px 4px 0 var(--ink);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.nav-links a:hover {
  color: var(--red);
  border-bottom-color: var(--yellow);
}

.nav-cta {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 0.05em;
  padding: 5px 14px;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  white-space: nowrap;
}

/* ---- buttons -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Bangers', cursive;
  font-size: 21px;
  letter-spacing: 0.06em;
  padding: 10px 26px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.btn:hover {
  box-shadow: 7px 7px 0 var(--ink);
}

.btn:active {
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary {
  background: var(--red);
  color: var(--paper);
}

.btn-primary .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
}

.btn-mail {
  background: var(--yellow);
}

.btn-link {
  background: var(--blue);
  color: var(--paper);
}

/* ---- hero ------------------------------------------------------ */

.hero {
  min-height: calc(92vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px 48px;
}

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  min-height: 1.4em;
}

.h1-3d {
  margin: 0;
  line-height: 0.92;
}

.h1-3d .row {
  display: block;
}

.t3d {
  font-family: 'Bangers', cursive;
  font-weight: 400;
  font-size: clamp(52px, 9.5vw, 128px);
  letter-spacing: 0.02em;
  display: inline-block;
}

.t3d-ink {
  color: var(--ink);
  text-shadow:
    3px 3px 0 var(--paper),
    6px 6px 0 rgba(224, 32, 47, 0.45);
}

.t3d-red {
  color: var(--red);
  text-shadow:
    3px 3px 0 var(--paper),
    6px 6px 0 var(--ink);
}

.t3d-blue {
  color: var(--blue);
  text-shadow:
    3px 3px 0 var(--paper),
    6px 6px 0 var(--ink);
}

.hero-sub {
  font-size: 18px;
  max-width: 56ch;
  margin: 22px auto 28px;
  color: var(--ink-soft);
}

.hero-sub b {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.hero-meta {
  width: min(920px, 100%);
  margin-top: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wheel {
  width: 18px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  position: relative;
}

.wheel::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--ink);
}

/* ---- marquees -------------------------------------------------- */

.marquee {
  overflow: hidden;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--yellow);
}

.m-rev {
  background: var(--paper-2);
  border-top: 0;
}

.marquee-track {
  display: inline-flex;
  padding: 12px 0;
  white-space: nowrap;
  font-family: 'Bangers', cursive;
  font-size: 26px;
  letter-spacing: 0.06em;
}

/* ---- sections -------------------------------------------------- */

.sec {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 24px 24px;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--red);
  border: 2px solid var(--ink);
  margin-right: 12px;
  vertical-align: -1px;
}

h2 {
  font-family: 'Bangers', cursive;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0 0 30px;
}

.accent {
  color: var(--red);
  background: linear-gradient(0deg, var(--yellow) 0 26%, transparent 26%);
  padding: 0 6px;
}

.accent-b {
  color: var(--blue);
  background: linear-gradient(0deg, var(--yellow) 0 26%, transparent 26%);
  padding: 0 6px;
}

.about-copy {
  max-width: 70ch;
  font-size: 17px;
}

/* ---- stats ------------------------------------------------------ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 44px;
}

.stat {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 20px 14px 16px;
  text-align: center;
}

.num {
  font-family: 'Bangers', cursive;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--ink);
}

.lbl {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- project cards ---------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
}

.badge {
  align-self: flex-start;
  font-family: 'Bangers', cursive;
  font-size: 16px;
  letter-spacing: 0.08em;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 3px 10px;
  transform: rotate(-3deg);
}

.stamp {
  position: absolute;
  top: -12px;
  right: 10px;
  z-index: 2;
  max-width: 62%;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 5px 9px;
  transform: rotate(2deg);
}

.card h3 {
  font-family: 'Bangers', cursive;
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 4px 0 0;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--yellow);
}

.card h3 a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

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

.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 3px 9px;
}

.chip-cert {
  background: var(--yellow);
}

.live {
  margin-top: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ---- experience steps -------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 24px;
}

.step {
  display: flex;
  gap: 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
}

.no {
  font-family: 'Bangers', cursive;
  font-size: 54px;
  line-height: 1;
  color: var(--blue);
  text-shadow: 2px 2px 0 var(--ink);
}

.step-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
}

.when {
  display: block;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.step-body p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.step-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

.step-bullets li {
  margin-top: 6px;
}

.step-bullets li::marker {
  color: var(--red);
}

/* ---- skills -------------------------------------------------------- */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.skill-group h3 {
  font-family: 'Bangers', cursive;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
  padding-bottom: 2px;
}

/* ---- contact -------------------------------------------------------- */

#contact {
  text-align: center;
  padding-top: 140px;
  padding-bottom: 140px;
}

#contact h2 {
  font-size: clamp(52px, 8vw, 112px);
}

#contact .eyebrow::before {
  margin-right: 10px;
}

.contact-sub {
  max-width: 52ch;
  margin: 0 auto;
  font-size: 19px;
  color: var(--ink-soft);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 36px;
}

.contact-actions .btn {
  font-size: 27px;
  padding: 16px 44px;
}

/* ---- footer ---------------------------------------------------------- */

.footer {
  border-top: 3px solid var(--ink);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  padding: 26px 20px 56px;
}

/* ============================================================
   MOTION — everything below runs only when the user allows it
   ============================================================ */

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

  /* halftone blob drift */
  .halftone-red {
    animation: dotDrift 14s ease-in-out infinite alternate;
  }

  @keyframes dotDrift {
    to {
      transform: translate(-36px, 44px);
    }
  }

  /* marquees */
  .m-fwd .marquee-track {
    animation: mq 22s linear infinite;
  }

  .m-rev .marquee-track {
    animation: mq 17s linear infinite reverse;
  }

  @keyframes mq {
    to {
      transform: translateX(-50%);
    }
  }

  /* hero polish */
  .h1-3d .row {
    will-change: transform;
  }

  .btn-primary .dot {
    animation: pulse 1.4s ease-in-out infinite;
  }

  @keyframes pulse {
    50% {
      transform: scale(1.5);
      opacity: 0.6;
    }
  }

  .wheel::before {
    animation: wheelDrop 1.6s ease-in infinite;
  }

  @keyframes wheelDrop {
    70% {
      transform: translateY(12px);
      opacity: 0;
    }
    100% {
      transform: translateY(0);
      opacity: 0;
    }
  }

  /* smooth magnetic follow (JS drives the transform) */
  .magnetic {
    transition: transform 150ms ease-out;
  }

  /* card hover lift */
  .card {
    transition:
      transform 150ms ease,
      box-shadow 150ms ease;
  }

  .card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--ink);
  }

  /* scroll reveals — content only hides when JS is alive AND motion is allowed */
  html.js .reveal {
    opacity: 0;
  }

  html.js .reveal.in {
    animation: popIn 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes popIn {
    from {
      opacity: 0;
      transform: translateY(18px) rotate(0.4deg);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  /* stagger: cards and steps pop in sequence */
  html.js .card.reveal.in:nth-child(2) {
    animation-delay: 70ms;
  }
  html.js .card.reveal.in:nth-child(3) {
    animation-delay: 140ms;
  }
  html.js .card.reveal.in:nth-child(4) {
    animation-delay: 210ms;
  }
  html.js .card.reveal.in:nth-child(5) {
    animation-delay: 280ms;
  }
  html.js .card.reveal.in:nth-child(6) {
    animation-delay: 350ms;
  }
  html.js .card.reveal.in:nth-child(7) {
    animation-delay: 420ms;
  }
  html.js .step.reveal.in:nth-child(2) {
    animation-delay: 90ms;
  }
  html.js .step.reveal.in:nth-child(3) {
    animation-delay: 180ms;
  }
  html.js .step.reveal.in:nth-child(4) {
    animation-delay: 270ms;
  }
  html.js .skill-group.reveal.in:nth-child(2) {
    animation-delay: 90ms;
  }
  html.js .skill-group.reveal.in:nth-child(3) {
    animation-delay: 180ms;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  .hud,
  .nav-links {
    display: none;
  }

  .nav {
    padding: 12px 18px;
  }

  .hero-meta {
    flex-direction: column;
    gap: 18px;
  }

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

  .marquee-track {
    font-size: 20px;
  }

  .sec {
    padding: 72px 20px 20px;
  }

  #contact {
    padding-top: 110px;
    padding-bottom: 110px;
  }
}

@media (max-width: 480px) {
  .btn {
    font-size: 19px;
    padding: 9px 20px;
  }

  .contact-actions .btn {
    font-size: 22px;
    padding: 12px 28px;
  }

  .step {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .halftone,
  .halftone-red,
  .progress,
  .hud,
  .nav,
  .marquee,
  .hero-actions,
  .contact-actions,
  .scroll-hint {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .sec {
    padding: 24px 0;
  }

  html.js .reveal {
    opacity: 1;
  }
}
