/* Professional background — Dossier layout (light-first, soft dark) */

:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --top-h: 58px;
  --sheet-max: 720px;
  --sheet-radius: 16px;

  /* Light default — warm paper */
  --ink-900: #1c1917;
  --ink-700: #57534e;
  --ink-500: #78716c;
  --paper-0: #ece8e0;
  --paper-sheet: #faf8f4;
  --surface: #ffffff;
  --surface-muted: #f3f0ea;
  --brass-500: #b45309;
  --brass-600: #92400e;
  --teal-600: #0d9488;
  --accent-blue: #2563eb;
  --border: rgba(28, 25, 23, 0.1);
  --shadow: rgba(28, 25, 23, 0.06);
  --top-bg: rgba(250, 248, 244, 0.92);
  --top-border: rgba(28, 25, 23, 0.08);
}

:root[data-theme="dark"] {
  --ink-900: #e7e5e4;
  --ink-700: #a8a29e;
  --ink-500: #78716c;
  --paper-0: #292524;
  --paper-sheet: #1c1917;
  --surface: #292524;
  --surface-muted: #23201e;
  --brass-500: #fbbf24;
  --brass-600: #f59e0b;
  --teal-600: #2dd4bf;
  --accent-blue: #60a5fa;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.25);
  --top-bg: rgba(28, 25, 23, 0.94);
  --top-border: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.dossier {
  margin: 0;
  min-height: 100vh;
  background:
    /* faint column guides — layout / web-design cue */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(50% - 360px - 1px),
      color-mix(in srgb, var(--ink-900) 4%, transparent) calc(50% - 360px),
      color-mix(in srgb, var(--ink-900) 4%, transparent) calc(50% - 360px + 1px),
      transparent calc(50% - 360px + 1px),
      transparent calc(50% + 360px - 1px),
      color-mix(in srgb, var(--ink-900) 4%, transparent) calc(50% + 360px),
      color-mix(in srgb, var(--ink-900) 4%, transparent) calc(50% + 360px + 1px),
      transparent calc(50% + 360px + 1px)
    ),
    /* dot grid — blueprint / craft */
    radial-gradient(
      circle at center,
      color-mix(in srgb, var(--ink-900) 7%, transparent) 0.6px,
      transparent 0.6px
    ),
    /* warm paper grain via micro-noise dots */
    radial-gradient(
      circle at 20% 30%,
      color-mix(in srgb, var(--ink-900) 3%, transparent) 0.4px,
      transparent 0.4px
    ),
    /* teal glow — AI + tools */
    radial-gradient(
      ellipse 80% 50% at 50% -10%,
      color-mix(in srgb, var(--teal-600) 8%, transparent),
      transparent
    ),
    /* brass glow — human craft / warm desk */
    radial-gradient(
      ellipse 60% 40% at 100% 100%,
      color-mix(in srgb, var(--brass-500) 10%, transparent),
      transparent
    ),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--paper-sheet) 40%, var(--paper-0)) 0%,
      var(--paper-0) 45%,
      color-mix(in srgb, var(--brass-500) 4%, var(--paper-0)) 100%
    );
  background-size:
    100% 100%,
    24px 24px,
    3px 3px,
    100% 100%,
    100% 100%,
    100% 100%;
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] body.dossier {
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(50% - 360px - 1px),
      color-mix(in srgb, var(--ink-900) 5%, transparent) calc(50% - 360px),
      color-mix(in srgb, var(--ink-900) 5%, transparent) calc(50% - 360px + 1px),
      transparent calc(50% - 360px + 1px),
      transparent calc(50% + 360px - 1px),
      color-mix(in srgb, var(--ink-900) 5%, transparent) calc(50% + 360px),
      color-mix(in srgb, var(--ink-900) 5%, transparent) calc(50% + 360px + 1px),
      transparent calc(50% + 360px + 1px)
    ),
    radial-gradient(
      circle at center,
      color-mix(in srgb, var(--ink-900) 9%, transparent) 0.6px,
      transparent 0.6px
    ),
    radial-gradient(
      circle at 20% 30%,
      color-mix(in srgb, var(--ink-900) 4%, transparent) 0.4px,
      transparent 0.4px
    ),
    radial-gradient(
      ellipse 80% 50% at 50% -10%,
      color-mix(in srgb, var(--teal-600) 10%, transparent),
      transparent
    ),
    radial-gradient(
      ellipse 55% 35% at 100% 100%,
      color-mix(in srgb, var(--brass-500) 12%, transparent),
      transparent
    ),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--paper-sheet) 30%, var(--paper-0)) 0%,
      var(--paper-0) 50%,
      color-mix(in srgb, var(--brass-500) 5%, var(--paper-0)) 100%
    );
  background-size:
    100% 100%,
    24px 24px,
    3px 3px,
    100% 100%,
    100% 100%,
    100% 100%;
}

/* Hide old sidebar layout */
body.dossier .rail,
body.dossier .resume-ambient,
body.dossier .nav-toggle-input {
  display: none !important;
}

/* ===== Top bar ===== */
.dossier-top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--top-h);
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px)) 0.5rem max(1.25rem, env(safe-area-inset-left, 0px));
  background: var(--top-bg);
  border-bottom: 1px solid var(--top-border);
  backdrop-filter: blur(14px);
}

.dossier-top__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink-900);
  flex-shrink: 0;
}

.dossier-top__brand img {
  width: 32px;
  height: 32px;
}

.dossier-top__brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.dossier-nav {
  display: flex;
  flex: 1;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}

.dossier-nav::-webkit-scrollbar { display: none; }

.dossier-nav__link {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-700);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.dossier-nav__link:hover {
  color: var(--ink-900);
  background: var(--surface-muted);
}

.dossier-nav__link.is-active {
  color: var(--brass-600);
  background: color-mix(in srgb, var(--brass-500) 14%, transparent);
}

.dossier-top__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.dossier-top__portfolio {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-700);
  text-decoration: none;
}

.dossier-top__portfolio:hover {
  color: var(--brass-500);
}

.dossier-top .theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.dossier-top .theme-toggle__track {
  width: 32px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  position: relative;
}

.dossier-top .theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brass-500);
  transition: transform 0.25s var(--ease);
}

:root[data-theme="dark"] .dossier-top .theme-toggle__thumb {
  transform: translateX(15px);
}

/* ===== Main sheet ===== */
body.dossier main {
  margin: 0;
  padding: 1.25rem 1rem 2.5rem;
}

.dossier-sheet {
  max-width: var(--sheet-max);
  margin: 0 auto;
  background: var(--paper-sheet);
  border: 1px solid var(--border);
  border-radius: var(--sheet-radius);
  box-shadow: 0 20px 50px var(--shadow);
  padding: 1.75rem 1.5rem 2rem;
}

body.dossier .section {
  max-width: none;
  margin: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

body.dossier #intro.section {
  border-top: none;
  padding-top: 0;
}

body.dossier .section__head {
  margin-bottom: 1rem;
}

body.dossier .section__index {
  font-size: 0.62rem;
  margin-bottom: 0.25rem;
}

body.dossier .section__title {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

body.dossier .section__kicker {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  color: var(--ink-500);
  font-style: italic;
}

body.dossier .svg-draw {
  display: none;
}

/* Hero */
body.dossier .hero--resume {
  position: relative;
  overflow: hidden;
}

body.dossier .hero__name {
  font-size: clamp(1.65rem, 1.4rem + 1vw, 2.1rem);
  text-wrap: balance;
  text-align: center;
  line-height: 1.2;
}

body.dossier .hero__eyebrow,
body.dossier .hero__role,
body.dossier .hero__lede {
  text-align: center;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

body.dossier .hero__name-chars .char {
  animation: none;
}

body.dossier .hero__role {
  font-size: 0.88rem;
  margin-top: 0.35rem;
}

body.dossier .signal {
  display: none;
}

body.dossier .hero__lede {
  font-size: 0.84rem;
  /* A readable measure: full-width centred lines are hard to track back to. */
  max-width: 58ch;
  margin-top: 0.75rem;
}

body.dossier .hero__actions {
  margin-top: 1rem;
  gap: 0.5rem;
  justify-content: center;
}

body.dossier .btn {
  font-size: 0.78rem;
  padding: 0.48rem 0.85rem;
}

body.dossier .btn--primary {
  background: var(--ink-900);
  color: var(--paper-sheet);
}

:root[data-theme="dark"] body.dossier .btn--primary {
  background: var(--brass-500);
  color: #1c1917;
}

body.dossier .btn--ghost {
  border-color: var(--border);
}

/* Timeline → compact cards */
body.dossier .timeline {
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

body.dossier .timeline::before,
body.dossier .timeline__marker {
  display: none;
}

body.dossier .timeline__item {
  padding: 0.85rem 1rem;
  padding-bottom: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--teal-600);
}

body.dossier .timeline__date {
  font-size: 0.68rem;
  margin-bottom: 0.2rem;
}

body.dossier .timeline__role {
  font-size: 0.92rem;
}

body.dossier .timeline__org {
  font-size: 0.78rem;
}

body.dossier .timeline__list {
  margin-top: 0.4rem;
  gap: 0.25rem;
}

body.dossier .timeline__list li {
  font-size: 0.78rem;
  padding-left: 0.85rem;
}

/* Venture */






body.dossier .stat__value { font-size: 1.1rem; }
body.dossier .stat__label { font-size: 0.62rem; }

/* Skills matrix */
.skill-matrix {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.skill-matrix__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.skill-matrix__row:last-child {
  border-bottom: none;
}

.skill-matrix__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0;
}

.skill-matrix__items {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-700);
  line-height: 1.45;
}

body.dossier .skill-groups {
  display: none;
}

/* Credentials */
body.dossier .credentials-grid {
  gap: 0.6rem;
}

body.dossier .credential-card {
  padding: 0.85rem;
  background: var(--surface);
  box-shadow: none;
}

body.dossier .credential-card__title { font-size: 0.85rem; }
body.dossier .credential-card__org,
body.dossier .credential-card__date,
body.dossier .credential-card__desc,
body.dossier .credential-card__list li {
  font-size: 0.74rem;
}

/* Projects & contact */
body.dossier .project-card {
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
  box-shadow: none;
}

body.dossier .project-card__title { font-size: 0.9rem; }
body.dossier .project-card__body { font-size: 0.78rem; }

body.dossier .achievements { margin-top: 1rem; }
body.dossier .achievements__title { font-size: 0.62rem; }
body.dossier .achievements__list { grid-template-columns: 1fr; gap: 0.35rem; }
body.dossier .achievements__list li { font-size: 0.76rem; }

body.dossier .contact-grid {
  gap: 0.55rem;
}

body.dossier .contact-card {
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  box-shadow: none;
}

body.dossier .contact-card__value { font-size: 0.82rem; }

/* Footer */
body.dossier .footer {
  margin: 0;
  padding: 1.25rem 1rem 2rem;
  max-width: var(--sheet-max);
  margin-inline: auto;
  font-size: 0.72rem;
  color: var(--ink-500);
}

/* Reveal — always visible fallback */
body.dossier .reveal,
body.dossier .js .reveal:not(.is-visible) {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .dossier-top__brand span {
    display: none;
  }

  .dossier-top__portfolio {
    display: none;
  }

  .dossier-sheet {
    padding: 1.25rem 1rem 1.5rem;
    border-radius: 12px;
  }

  .skill-matrix__row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  body.dossier .contact-grid {
    grid-template-columns: 1fr;
  }

  body.dossier .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.dossier .hero__actions .btn {
    justify-content: center;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dossier .hero__name-chars .char {
    animation: none !important;
  }
}

/* ===== Print / PDF — `npm run resume:pdf` regenerates assets/Kunal-Varshney-Resume.pdf from this page ===== */
@media print {
  @page { size: A4; margin: 10mm 12mm; }

  :root,
  :root[data-theme="dark"] {
    --ink-900: #1c1917;
    --ink-700: #44403c;
    --ink-500: #57534e;
    --paper-sheet: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f5f5f4;
    --brass-500: #b45309;
    --brass-600: #92400e;
    --teal-600: #0d9488;
    --border: rgba(28, 25, 23, 0.14);
  }

  html { scroll-behavior: auto; }

  body.dossier,
  :root[data-theme="dark"] body.dossier {
    background: #fff !important;
    color: var(--ink-900);
    font-size: 9pt;
  }

  /* Web-only chrome, and content the PDF already covers elsewhere */
  .skip-link,
  .dossier-top,
  body.dossier .hero__eyebrow,
  body.dossier .hero__actions,
  body.dossier .section__kicker,
  body.dossier .credential-card__desc,
  body.dossier .credential-card__list,
  body.dossier .copy-btn,
  body.dossier .footer {
    display: none !important;
  }

  body.dossier main { padding: 0; }

  .dossier-sheet {
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  body.dossier .section * { max-width: none !important; }
  body.dossier .section { padding: 0.45rem 0; }
  body.dossier .section__head { margin-bottom: 0.35rem; }
  body.dossier .section__head,
  body.dossier .section__title { break-after: avoid; page-break-after: avoid; }

  body.dossier .hero__name { font-size: 1.6rem; }
  body.dossier .hero__role { margin-top: 0.15rem; }
  body.dossier .hero__lede { margin-top: 0.35rem; font-size: 0.8rem; }

  body.dossier .timeline { gap: 0.3rem; }
  body.dossier .timeline__item { padding: 0.4rem 0.65rem; }
  body.dossier .timeline__list { margin-top: 0.2rem; gap: 0.1rem; }
  body.dossier .timeline__list li { font-size: 0.76rem; }

  body.dossier .skill-matrix { gap: 0.2rem; }
  body.dossier .skill-matrix__row { padding: 0.3rem 0; }

  body.dossier .credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }
  body.dossier .credential-card { padding: 0.4rem 0.55rem; }

  body.dossier .project-card { margin-bottom: 0.3rem; padding: 0.4rem 0.65rem; }
  body.dossier .achievements { margin-top: 0.5rem; }
  body.dossier .achievements__list { gap: 0.15rem; }

  body.dossier .contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }
  body.dossier .contact-card { padding: 0.4rem 0.55rem; }

  body.dossier .timeline__item,
  body.dossier .skill-matrix__row,
  body.dossier .credential-card,
  body.dossier .project-card,
  body.dossier .contact-card,
  body.dossier .achievements__list li {
    break-inside: avoid;
    box-shadow: none;
  }

  body.dossier a { color: inherit; text-decoration: none; }

  * {
    animation: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


/* One-sheet profile poster: a framed print across the sheet under the intro.
   The sheet is only ~720px wide, so a side column would starve both. */
.hero__poster {
  margin: 3rem auto 0;
  width: 100%;
  max-width: 560px;
  padding: 20px 20px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 26px 54px rgba(28, 25, 23, 0.16);
}

.hero__poster img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.hero__poster figcaption {
  margin: 0;
  padding: 0.95rem 0 1.15rem;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

@media print {
  .hero__poster { display: none; }
}

body.dossier .hero__lede a {
  color: var(--teal-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tech + period line under an auto-managed project card (career-tracker writes these). */
body.dossier .project-card__meta {
  margin: 0.4rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}

body.dossier .achievements__note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-500);
}

@media print {
  /* `position: relative` puts the hero in the positioned paint layer, so it is
     written to the PDF after every static section. Naive ATS parsers read the
     content stream in order and saw "Experience" before the name. Nothing in
     the printed hero is absolutely positioned, so static is safe here. */
  body.dossier .hero--resume { position: static; }
}

/* Poster motion: one entrance when it scrolls in, then still. A lift on hover.
   Deliberately no scroll-linked drift - a picture that moves while you read is noise. */
body.dossier .hero__poster {
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

body.dossier .hero__poster.is-ready {
  opacity: 0;
  transform: translateY(18px) rotate(-1.2deg);
}

body.dossier .hero__poster.is-in {
  animation: poster-settle 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes poster-settle {
  from { opacity: 0; transform: translateY(18px) rotate(-1.2deg); }
  to   { opacity: 1; transform: none; }
}

body.dossier .hero__poster:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 64px rgba(28, 25, 23, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  body.dossier .hero__poster,
  body.dossier .hero__poster.is-ready,
  body.dossier .hero__poster.is-in {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
