/* =============================================================================
   PAGE: HOME
   01 Hero · 02 Work · 03 Experience · 04 Skills · 05 Doors · 06 Kind words
   Section layout + backgrounds live here; the pieces inside each section are
   components (css/components/*).
   ============================================================================= */

/* ==========================================================================
   01 · HERO: "It's my time" front page
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: calc(100svh - var(--header-h));
  padding: 12px 12% 28px;
  background: var(--c-mustard);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

/* Slow-roaming sunburst + flicker, like an old projector bulb */
.hero::before {
  inset: -75%;
  background: repeating-conic-gradient(from 8deg, var(--c-butter) 0 8deg, transparent 8.3deg 24deg);
  opacity: 0.55;
  animation: roam 34s ease-in-out infinite alternate, flicker 8s ease-in-out infinite;
}

.hero::after {
  inset: 0;
  background: radial-gradient(#6d4b19 0.8px, transparent 1px) 0 0 / 5px 5px;
  opacity: 0.2;
}

/* ---- Hero intro --------------------------------------------------------
   Plays once, as the preloader lifts (html.is-intro; straight away when
   there is no preloader). The paper is already there; its contents print
   onto it in order: masthead, headline words, highlighter, columns, memes.
   [data-intro] uses fill "backwards" so parallax `translate` is untouched. */
html.js:not(.is-intro) [data-intro] { opacity: 0; }
html.is-intro [data-intro] { animation: intro-rise 850ms var(--e-out) var(--intro-delay, 0ms) backwards; }
html.is-intro [data-intro="pop"] { animation: intro-pop 700ms var(--e-back) var(--intro-delay, 0ms) backwards; }

@keyframes intro-rise { from { opacity: 0; translate: 0 24px; } }
@keyframes intro-pop  { from { opacity: 0; scale: 0.7; rotate: -6deg; } }

/* Headline words wait for the preloader too */
html.js:not(.is-intro) .hero [data-reveal-text] .rw {
  opacity: 0;
  filter: blur(var(--rw-blur, 8px));
  translate: 0 0.32em;
  transition: none;
}

/* The red strike draws through "Rules!!" once the word has landed */
.js .hero h1 .strike::after {
  scale: 0 1;
  transform-origin: 0 50%;
  transition: scale 420ms var(--e-out) 950ms;
}

html.is-intro .hero h1.is-revealed .strike::after { scale: 1 1; }

/* The highlighter sweeps across the deck under its words */
.js .hero .deck .highlight {
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 700ms var(--e-out) 520ms;
}

html.is-intro .hero .deck.is-revealed .highlight { background-size: 100% 100%; }

@keyframes roam    { from { transform: translate(-2%, -1%) rotate(-9deg); } to { transform: translate(2%, 1%) rotate(10deg); } }
@keyframes flicker { 0%, 62%, 78%, 100% { opacity: 0.52; } 68%, 85% { opacity: 0.37; } 72%, 94% { opacity: 0.58; } }

/* ---- The paper -------------------------------------------------------- */
.paper {
  container-type: inline-size;
  width: min(100%, 1020px);
  padding: clamp(8px, 1.4vh, 16px) clamp(12px, 2vw, 28px);
  border: 2px solid var(--c-ink);
  box-shadow: 4px 4px #f4e8c9, 5px 5px var(--c-ink), 9px 9px var(--c-ink);
  background-color: var(--c-cream);
  background-image:
    linear-gradient(rgb(250 241 220 / 44%), rgb(250 241 220 / 44%)),
    url("../../assets/img/paper-texture.jpg");
  background-size: cover;
  background-position: center;
  background-blend-mode: normal, multiply;
}

.edition {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-top: 3px double;
  border-bottom: 1px solid;
  font: 700 0.8rem/1.35 var(--f-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.masthead { position: relative; }

.masthead__title {
  margin: 3px 0;
  text-align: center;
  font: 700 clamp(1.5rem, 5.5cqw, 3rem)/1.05 var(--f-nameplate);
}

/* NIFT seal: stamped into the empty corner beside the headline, with a
   paper tag tied under it. Sizes follow the paper (cqw), so it keeps its
   spot at every width. Spins a quarter turn on hover. */
.nift {
  position: absolute;
  top: calc(100% + 0.6cqw);
  right: 0.5cqw;
  z-index: 2;
  display: grid;
  justify-items: center;
  rotate: 7deg;
}

.nift__seal {
  width: clamp(46px, 9cqw, 92px);
  height: auto;
  padding: 3px;
  background: #fff;
  border: var(--b-thin) solid var(--c-ink);
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  transition: rotate var(--d-slow) var(--e-back);
}

.nift:hover .nift__seal { rotate: 90deg; }

.nift__text {
  display: grid;
  margin-top: -6px;
  padding: 3px 8px 2px;
  background: var(--c-butter);
  border: var(--b-thin) solid var(--c-ink);
  font: 700 clamp(0.55rem, 1.25cqw, 0.8rem)/1.1 var(--f-label);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  rotate: -9deg;
}

.nift__text small { font-size: 0.85em; font-weight: 600; color: var(--c-ink-soft); }

.hero h1 {
  padding: 0.07em 0 0.09em;
  border-block: 3px solid;
  text-align: center;
  font: 400 clamp(1.7rem, 12cqw, 6.8rem)/1 var(--f-display);
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.hero h1 .strike { position: relative; }

.hero h1 .strike::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 55%;
  height: 0.045em;
  background: var(--c-red);
  transform: rotate(-6deg);
}

.hero .deck {
  padding: 4px 0;
  border-bottom: 4px double;
  text-align: center;
  font: 700 clamp(1rem, 2.4cqw, 1.45rem)/1.25 var(--f-serif);
}

.hero .deck .highlight {
  padding: 0.05em 0.35em;
  background: linear-gradient(104deg, transparent 0 1%, var(--c-butter) 2% 97%, transparent 99%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-radius: 0.3em 0.9em 0.4em 0.8em;
}

.lead {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  padding-top: clamp(16px, 2vw, 28px);
  text-align: left;
  font-family: var(--f-body);
}
.column { font: 400 clamp(1.05rem, 1.35vw, 1.35rem)/1.5 var(--f-body); }
.column p + p { margin-top: 0.8em; }
.lead h2 { font: 700 clamp(1.25rem, 1.8vw, 1.65rem)/1.12 var(--f-body); letter-spacing: -0.04em; }
.lead p { max-width: 58ch; margin: 8px auto 0; line-height: 1.5; text-wrap: pretty; }
.portrait { width: 100%; min-width: 0; }

.portrait__stage {
  --tx: 0;
  --ty: 0;
  position: relative;
  aspect-ratio: 1.06;
  margin-bottom: 4px;
}

.portrait__frame {
  position: absolute;
  inset: 15% 0 0;
  overflow: hidden;
  background: var(--c-sky);
  border: 3px solid var(--c-ink);
  box-shadow: 5px 5px 0 var(--c-ink);
}

/* Speed lines, slowly turning, drifting against the pointer */
.portrait__frame::before {
  content: "";
  position: absolute;
  inset: -70%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgb(255 255 255 / 0.62) 0 6deg, transparent 6deg 16deg);
  translate: calc(var(--tx) * -14px) calc(var(--ty) * -10px);
  animation: rays-turn 80s linear infinite;
}

/* A sun behind the head, plus halftone dots piling up in the corner */
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, var(--c-butter) 0 31%, var(--c-ink) 31.4% 33.4%, transparent 33.8%),
    radial-gradient(rgb(22 19 15 / 0.3) 1.3px, transparent 1.6px) 0 0 / 8px 8px;
  -webkit-mask: linear-gradient(#000, #000), linear-gradient(135deg, transparent 52%, #000 100%);
  mask: linear-gradient(#000, #000), linear-gradient(135deg, transparent 52%, #000 100%);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  translate: calc(var(--tx) * -6px) calc(var(--ty) * -4px);
}

/* Only the top edge may overflow: the sleeves bleed off the sides and bottom */
.portrait__pop {
  position: absolute;
  inset: 0;
  clip-path: inset(-40% 0 0 0);
}

.portrait__drift { position: absolute; inset: 0; }

.portrait__layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1122 / 1478;
  translate: calc(var(--tx) * 7px) calc(var(--ty) * 5px);
  transition: translate 220ms var(--e-out);
}

.portrait__layer > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.portrait__cartoon {
  display: block;
  z-index: 1;
  pointer-events: none;
  clip-path: circle(0 at var(--reveal-x, 50%) var(--reveal-y, 35%));
  transition: clip-path 120ms ease-out;
}
.portrait__stage.is-hovering .portrait__cartoon {
  clip-path: circle(clamp(36px, 5vw, 65px) at var(--reveal-x) var(--reveal-y));
}
.portrait__stage.is-revealed .portrait__cartoon { clip-path: none; }
.portrait__swap { display: block; }
.portrait__hint-touch { display: none; }
@media (hover: none) {
  .portrait__hint-desktop { display: none; }
  .portrait__hint-touch { display: inline; }
  .portrait__scratch { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
  .portrait__stage.is-armed .portrait__photo { opacity: 0; }
  .portrait__stage.is-armed .portrait__cartoon { clip-path: none; }
  .portrait__scratch { z-index: 2; }
}

.portrait__nudge {
  --bob-rot: 3deg;
  position: absolute;
  left: -18%;
  bottom: -2%;
  z-index: 3;
  display: grid;
  justify-items: start;
  width: 24%;
  pointer-events: none;
  animation: bob 2.2s ease-in-out infinite;
  transition: opacity var(--d-mid);
}

.portrait__hint {
  position: relative;
  margin-top: -6px;
  padding: 4px 12px 2px;
  background: var(--c-mustard);
  border: 2px solid var(--c-ink);
  box-shadow: 3px 3px 0 var(--c-ink);
  font: 400 clamp(0.8rem, 1.25vw, 1.05rem)/1.1 var(--f-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  rotate: -7deg;
}

.portrait__stage.is-touched .portrait__nudge,
.portrait__stage.is-revealed .portrait__nudge { opacity: 0; }

.glass-dude { width: 82%; margin-left: 5%; }
.portrait__swap {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  min-height: 44px;
  padding: 6px 12px;
  background: var(--c-paper);
  border: 2px solid var(--c-ink);
  box-shadow: 2px 2px 0 var(--c-ink);
  font: 700 0.82rem/1.2 var(--f-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}

.portrait__swap:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--c-ink); }
.portrait__swap:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--c-ink); }

/* ---- CTA under the newspaper: one line + one pink button, on the surface ---- */
.versus {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 8px;
  text-align: center;
}

.versus__title { font: 400 clamp(1.1rem, 2.4vw, 1.5rem)/1.1 var(--f-display); text-transform: uppercase; }

/* ---- Meme characters at the bottom corners ---------------------------- */
.hero-memes figure {
  position: absolute;
  bottom: 0;
  width: min(15vw, 23vh, 210px);
}

.meme-hire  { left: 4px; }
.meme-paisa { right: 4px; }
.meme-hire img { width: 80%; }

.meme-hire figcaption {
  position: absolute;
  top: 9%;
  left: 70%;
  z-index: 1;
  width: clamp(120px, 14vw, 210px);
}

.meme-hire figcaption svg { width: 100%; height: auto; overflow: visible; }

.meme-hire figcaption text {
  font: 400 35px var(--f-display);
  fill: #fff3cb;
  stroke: #221912;
  stroke-width: 5px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}

.meme-paisa figcaption { margin-bottom: 12px; text-align: center; transform: rotate(5deg); }
.meme-paisa figcaption span { display: block; font: 700 clamp(0.75rem, 1.4vw, 1.2rem)/1.2 var(--f-serif); }
.meme-paisa figcaption strong { display: block; color: #9b2821; font: 400 clamp(0.8rem, 1.7vw, 1.65rem)/1.2 var(--f-display); }
.meme-paisa img { width: 90%; margin: auto; }

/* Tablet & phone: photo on top, copy underneath, memes on the bottom edge */
@media (max-width: 900px) {
  .hero { gap: 18px; padding: 12px 16px 0; }
  .paper { width: min(100%, 760px); }

  /* The two memes stand on the hero's bottom edge, still (no parallax) */
  .hero-memes {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-top: -6px;
  }

  .hero-memes figure { position: relative; width: 34%; max-width: 220px; translate: none; }
  .meme-hire figcaption { left: 62%; top: 4%; width: clamp(120px, 22vw, 170px); }
  .meme-paisa figcaption { margin-bottom: 4px; }
}

@media (max-width: 690px) {
  /* Phones: keep the flicker, drop the huge roaming layer */
  .hero::before { inset: -40%; animation: flicker 8s ease-in-out infinite; }
  .hero { padding: 8px 8px 0; }
  .paper { width: 100%; padding: 8px 14px 14px; }
  .edition { font-size: 0.75rem; letter-spacing: 0; }

  /* The headline fills the width here, so the NIFT seal becomes a small
     centred strip under the nameplate instead of a corner stamp */
  .nift {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2px 0 6px;
    rotate: none;
  }
  .nift__seal { width: 34px; padding: 2px; }
  .nift__text { display: block; margin: 0; font-size: 0.68rem; rotate: -2deg; }

  .lead { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .portrait { max-width: 360px; width: 82%; }
  .portrait__nudge { left: -19%; width: 25%; }
  .lead p { max-width: 38ch; }

  .hero-memes figure { width: 40%; max-width: 190px; }
  .meme-hire figcaption { width: 120px; }
  .meme-paisa figcaption span { font-size: 0.8rem; }
  .meme-paisa figcaption strong { font-size: 0.95rem; }
}

/* ==========================================================================
   02 · WORK: film reel
   ========================================================================== */


.work { background-color: var(--c-mint); }
.work.section { padding-block: clamp(36px, 4.5vw, 64px); }

/* Header stays centred; the spool hangs off to the left of it */
.work__top { position: relative; }

.work__tabs:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 8px);
  width: min(100%, 520px);
  margin: clamp(16px, 2vw, 26px) auto 8px;
}
.work__tabs button {
  min-height: 44px;
  padding: 6px 4px;
  border: 2px solid var(--c-ink);
  border-radius: 8px;
  background: var(--c-paper);
  color: var(--c-ink);
  font: 700 clamp(0.78rem, 2vw, 0.98rem)/1.2 var(--f-body);
  cursor: pointer;
}
.work__tabs button[aria-selected="true"] {
  background: var(--c-mustard);
  box-shadow: 2px 3px 0 var(--c-ink);
}
.work__tabs button:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 2px;
}

.work__top .spool {
  position: absolute;
  top: -6px;
  left: 0;
  width: clamp(64px, 6vw, 88px);
  margin: 0;
}


/* ==========================================================================
   03 · EXPERIENCE: now playing + receipt
   ========================================================================== */
.exp { background-color: var(--c-cream); }

.exp__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
}

.exp__now { padding-bottom: 260px; } /* the Control meme stands below the card */


/* ==========================================================================
   04 · SKILLS: report card on notebook paper
   ========================================================================== */
.skills {
  background-color: var(--c-sky);
  background-image:
    linear-gradient(90deg, transparent 38px, rgb(180 53 40 / 0.5) 38px 40px, transparent 40px),
    repeating-linear-gradient(transparent 0 35px, rgb(22 19 15 / 0.11) 35px 36px);
}

.skills__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: stretch; /* report card matches the pencil box height */
  gap: clamp(28px, 4vw, 56px);
}


/* ==========================================================================
   05 · DOORS: dark hallway, checker floor
   ========================================================================== */
.doors {
  background:
    radial-gradient(28% 55% at 18% 0, rgb(255 229 166 / 0.12), transparent 70%),
    radial-gradient(34% 60% at 50% 0, rgb(255 229 166 / 0.18), transparent 70%),
    radial-gradient(28% 55% at 82% 0, rgb(255 229 166 / 0.12), transparent 70%),
    var(--c-wall);
  color: var(--c-cream);
  padding-bottom: 0;
}

.doors .sec-head__title { color: var(--c-cream); }
.doors .sec-head__sub { color: #e8dbbd; }
.doors .door { color: var(--c-ink); }

.doors__stage {
  --mat-h: 34px;
  --floor-run: clamp(110px, 12vw, 170px);  /* floor visible in front of the mats */
  --row-pad-b: 0px;
  position: relative;
  padding-bottom: var(--floor-run);
}

.doors__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;   /* every frame stands on the same floor line */
  gap: clamp(20px, 3vw, 44px);
}

/* The floor starts exactly at the foot of the frames, so the mats rest on
   it. A checker plane tipped toward you, then a wall shadow and a pool of
   light on top so the join reads as a corner, not a hard edge. */
.doors__floor {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: -1;
  width: 100vw;
  height: calc(var(--floor-run) + var(--mat-h) + var(--row-pad-b));
  translate: -50% 0;
  overflow: hidden;
  perspective: 520px;
  perspective-origin: 50% 0;
  box-shadow: 0 -3px 0 #120f0b;   /* skirting line */
}

.doors__floor::before,
.doors__floor::after {
  content: "";
  position: absolute;
}

.doors__floor::before {
  left: -40%;
  right: -40%;
  top: 0;
  height: 440px;
  background: conic-gradient(var(--c-salmon) 25%, var(--c-butter) 0 50%, var(--c-salmon) 0 75%, var(--c-butter) 0) 50% 0 / 84px 84px;
  transform-origin: 50% 0;
  transform: rotateX(70deg);
}

.doors__floor::after {
  inset: 0;
  background:
    radial-gradient(48% 110% at 50% 0, rgb(255 205 160 / 0.32), transparent 70%),
    linear-gradient(rgb(18 15 11 / 0.92), rgb(18 15 11 / 0.5) 28%, rgb(18 15 11 / 0.12) 70%, rgb(18 15 11 / 0.3));
}

/* Phones: swipe between doors instead of stacking three tall ones.
   doors.js starts the row centred on the featured door. */
.doors__nav { display: none; }

@media (max-width: 760px) {
  /* Taller floor: the swipe controls sit just under the mats, Binod below */
  .doors__stage { --row-pad-b: 14px; --floor-run: 210px; }

  .doors__row {
    display: flex;
    gap: 18px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 34px var(--gutter) var(--row-pad-b);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .doors__row::-webkit-scrollbar { display: none; }
  .door { flex: none; width: 74vw; max-width: 290px; scroll-snap-align: center; }

  /* ← ● ● ● → : a dark pill on the floor, so it reads on the checkers */
  .doors__nav {
    position: absolute;
    top: calc(100% - var(--floor-run) + 16px);
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px;
    background: var(--c-ink);
    border-radius: 99px;
    box-shadow: 0 4px 0 rgb(0 0 0 / 0.35);
    translate: -50% 0;
  }

  .doors__arrow {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--c-ink);
    background: var(--c-mustard);
    border: var(--b-thin) solid var(--c-cream);
    border-radius: 50%;
    transition: opacity var(--d-fast), scale var(--d-fast) var(--e-back);
  }

  .doors__arrow:active { scale: 0.9; }
  .doors__arrow:disabled { opacity: 0.3; }

  .doors__dots { display: flex; gap: 6px; }

  .doors__dots i {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgb(250 241 220 / 0.4);
    transition: width var(--d-mid) var(--e-out), background-color var(--d-mid);
  }

  .doors__dots i.is-on { width: 22px; background: var(--c-mustard); }

  /* Until they touch it, the next arrow nudges: "there's more this way" */
  .doors__nav:not(.is-used) .doors__arrow--next:not(:disabled) { animation: nudge-x 1.4s ease-in-out 4 1s; }
}

@keyframes nudge-x { 50% { translate: 5px 0; } }

/* ==========================================================================
   06 · KIND WORDS: letters to the editor
   ========================================================================== */
.words { background-color: var(--c-lilac); }

.letters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}

.letters .letter:nth-child(2) { margin-top: clamp(0px, 3vw, 36px); }

.words__more { margin-top: clamp(28px, 4vw, 44px); text-align: center; }


/* ==========================================================================
   Shared responsive rules for the long sections
   ========================================================================== */
@media (max-width: 1100px) {
  .work__top .spool { display: none; }
}

@media (max-width: 900px) {
  .exp__grid,
  .skills__grid,
  .letters { grid-template-columns: 1fr; }

  .exp__now { padding-bottom: 0; }
  .pass { margin-inline: auto; }
  .doors__stage { --floor-run: 180px; }   /* room for Binod in front of the doors */
  .letters .letter:nth-child(2) { margin-top: 0; }
}

@media (max-width: 760px) {
  .work__top .spool { display: none; }
}

.portrait__swap:focus-visible { display: block; position: absolute; width: auto; height: auto; clip: auto; clip-path: none; overflow: visible; }
