/* ============================================================
   aabhishek.in — "The Ledger, with a wink"
   Palette
   paper   #F7F3EA   ink     #23211C   gold  #A8720F
   rust    #8F3A1D   panel   #16181D   teal  #5DCAA5
   amber   #FAC775   coral   #F0997B   mint  #9FE1CB
   Type: Fraunces (display) · Instrument Sans (body) · IBM Plex Mono (data)
   ============================================================ */

:root {
  --paper: #F7F3EA;
  --paper-deep: #EFE9DB;
  --ink: #23211C;
  --ink-soft: #5C574C;
  --ink-faint: #8C8577;
  --gold: #A8720F;
  --rust: #8F3A1D;
  --panel: #16181D;
  --panel-line: #2A2D34;
  --teal: #5DCAA5;
  --amber: #FAC775;
  --coral: #F0997B;
  --mint: #9FE1CB;
  --rule: #DDD5C2;
  --max: 1040px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rust); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--max); margin: 0 auto;
}
.monogram {
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); background: var(--amber);
  padding: 1px 9px; border-radius: 7px;
  transform: rotate(-2deg); display: inline-block;
  transition: transform 0.2s ease;
}
.monogram:hover { transform: rotate(2deg); color: var(--ink); }
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a {
  font-size: 13px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.nav-links a:hover { color: var(--rust); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; position: relative; }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(44px, 7vw, 76px); line-height: 1.05;
  letter-spacing: -0.5px;
}
.hero .tagline {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(19px, 2.6vw, 26px); color: var(--ink-soft);
  margin-top: 18px; max-width: 620px;
}
.hero .intro {
  margin-top: 22px; max-width: 560px; color: var(--ink-soft); font-size: 17px;
}
.gold-rule { width: 56px; height: 3px; background: var(--gold); margin: 26px 0; }

.stamp {
  display: inline-block;
  border: 2px solid var(--rust); color: var(--rust);
  font-family: var(--mono); font-size: 12px; letter-spacing: 2.5px;
  padding: 6px 14px; border-radius: 4px;
  transform: rotate(-3deg);
  background: rgba(143, 58, 29, 0.04);
  user-select: none;
  margin-right: 8px;
}

.stickers { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.sticker {
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.2px;
  border: 2px solid var(--ink); border-radius: 22px;
  padding: 5px 15px; background: var(--paper);
  transition: transform 0.18s ease;
}
.sticker:nth-child(1) { background: var(--coral); transform: rotate(-2deg); }
.sticker:nth-child(2) { background: var(--mint); transform: rotate(1.5deg); }
.sticker:nth-child(3) { background: var(--amber); transform: rotate(-1deg); }
.sticker:hover { transform: rotate(0deg) scale(1.05); }

/* ---------- Sections ---------- */
section { padding: 76px 0; }
section + section { border-top: 1px solid var(--rule); }

.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.section-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4vw, 42px); line-height: 1.15; margin-bottom: 14px;
}
.section-note {
  font-family: var(--serif); font-style: italic;
  color: var(--ink-faint); font-size: 16px; margin-bottom: 40px;
}

/* ---------- Work / timeline ---------- */
.bio { max-width: 680px; color: var(--ink-soft); margin-bottom: 48px; }
.bio strong { color: var(--ink); font-weight: 600; }

.timeline { list-style: none; }
.timeline li {
  display: grid; grid-template-columns: 150px 1fr;
  gap: 24px; padding: 20px 0; border-top: 1px dashed var(--rule);
  align-items: baseline;
}
.timeline li:last-child { border-bottom: 1px dashed var(--rule); }
.t-years { font-family: var(--mono); font-size: 13.5px; color: var(--gold); letter-spacing: 0.5px; }
.t-role { font-weight: 600; font-size: 17px; }
.t-org { color: var(--ink-soft); }
.t-desc { color: var(--ink-soft); font-size: 15.5px; margin-top: 4px; }

.creds { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 36px; }
.cert-stamp {
  transform: none;
  margin-right: 0;
  align-self: center;
}
.cred {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px;
  border: 1.5px solid var(--ink-faint); color: var(--ink-soft);
  border-radius: 4px; padding: 4px 12px;
}

/* ---------- Projects (terminal panel) ---------- */
.terminal {
  background: var(--panel); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(35, 33, 28, 0.35);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px; border-bottom: 1px solid var(--panel-line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #E24B4A; } .dot-y { background: #EF9F27; } .dot-g { background: var(--teal); }
.term-bar .term-title {
  font-family: var(--mono); font-size: 12.5px; color: #888780; margin-left: 10px;
}
.term-body { padding: 26px 30px 32px; font-family: var(--mono); }
.term-line { font-size: 14px; color: #B4B2A9; margin-bottom: 22px; }
.term-line .prompt { color: var(--teal); }
.term-line .cmd { color: #E8E6E1; }

.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proj {
  border: 1px solid var(--panel-line); border-radius: 10px;
  padding: 20px 22px; transition: border-color 0.2s ease, transform 0.2s ease;
}
.proj:hover { border-color: var(--teal); transform: translateY(-2px); }
.proj h3 { font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--amber); }
.proj h3 .proj-link { color: var(--amber); text-decoration: none; border-bottom: 1px dashed var(--amber); }
.proj h3 .proj-link:hover { color: var(--teal); border-bottom-color: var(--teal); }
.proj h3 .ext { color: var(--teal); font-size: 13px; }
.proj .proj-tag { font-size: 11.5px; color: var(--teal); letter-spacing: 1px; text-transform: uppercase; }
.proj p { font-family: var(--sans); font-size: 14.5px; color: #B4B2A9; margin-top: 8px; line-height: 1.6; }
.term-foot { font-size: 13px; color: #888780; margin-top: 24px; }
.term-foot .cursor { color: var(--teal); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Blog ---------- */
.post-list { list-style: none; }
.post-list li { border-top: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-link {
  display: grid; grid-template-columns: 130px 1fr auto;
  gap: 24px; align-items: baseline;
  padding: 26px 8px; text-decoration: none; color: inherit;
  transition: background 0.15s ease;
}
.post-link:hover { background: var(--paper-deep); color: inherit; }
.post-date { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }
.post-title { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.3; }
.post-blurb { font-size: 14.5px; color: var(--ink-soft); margin-top: 5px; }
.post-arrow { font-size: 20px; color: var(--gold); }

/* ---------- Gallery ---------- */
.filters { display: flex; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  border: 2px solid var(--ink); border-radius: 22px;
  padding: 6px 18px; background: var(--paper); color: var(--ink);
  cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.filter-btn:hover { transform: translateY(-1px); }
.filter-btn.active { background: var(--ink); color: var(--paper); }

.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.g-item {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--rule);
  background: var(--paper-deep); aspect-ratio: 4 / 3; position: relative;
}
.gallery-open {
  width: 100%; height: 100%; display: block; border: 0; background: transparent;
  cursor: zoom-in; overflow: hidden; font: inherit; color: inherit;
}
.g-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.28s ease, filter 0.28s ease;
}
.g-item:hover img, .g-item:focus-within img {
  transform: scale(1.06);
  filter: saturate(1.08);
}
.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 12.5px; padding: 8px 14px;
  background: rgba(35, 33, 28, 0.72); color: #F1EDE2;
  pointer-events: none;
}
.g-item.hidden { display: none; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center; gap: 10px; padding: 28px;
  background: rgba(22, 24, 29, 0.92);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox.open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.lightbox-figure {
  min-width: 0; max-height: calc(100vh - 88px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: scale(0.96); transition: transform 0.22s ease;
}
.lightbox.open .lightbox-figure { transform: scale(1); }
.lightbox-img {
  max-width: 100%; max-height: calc(100vh - 148px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
.lightbox-caption {
  color: #F7F3EA; font-family: var(--serif); font-size: 17px;
  text-align: center;
}
.lightbox-close, .lightbox-nav {
  border: 1px solid rgba(247, 243, 234, 0.38);
  background: rgba(247, 243, 234, 0.12); color: #F7F3EA;
  cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover {
  background: rgba(247, 243, 234, 0.2); transform: translateY(-1px);
}
.lightbox-close {
  position: absolute; top: 18px; right: 18px;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 30px; line-height: 1;
}
.lightbox-nav {
  width: 52px; height: 76px; justify-self: center;
  border-radius: 8px; font-size: 56px; line-height: 0.8;
}
.lightbox-prev { grid-column: 1; }
.lightbox-figure { grid-column: 2; }
.lightbox-next { grid-column: 3; }
body.lightbox-locked { overflow: hidden; }

/* ---------- Now ---------- */
.now-list { list-style: none; max-width: 680px; }
.now-list li {
  padding: 14px 0 14px 34px; position: relative;
  border-top: 1px dashed var(--rule); color: var(--ink-soft);
}
.now-list li:last-child { border-bottom: 1px dashed var(--rule); }
.now-list li::before {
  content: "\2192"; position: absolute; left: 4px; color: var(--gold); font-weight: 600;
}

/* ---------- Likes ---------- */
.likes { display: flex; flex-wrap: wrap; gap: 16px; }
.like {
  border: 2px solid var(--ink); border-radius: 16px;
  padding: 16px 22px; max-width: 300px; background: var(--paper);
  transition: transform 0.18s ease;
}
.like:nth-child(6n+1) { background: var(--coral); transform: rotate(-1.2deg); }
.like:nth-child(6n+2) { background: var(--mint); transform: rotate(0.8deg); }
.like:nth-child(6n+3) { background: var(--amber); transform: rotate(-0.6deg); }
.like:nth-child(6n+4) { background: var(--paper-deep); transform: rotate(1deg); }
.like:nth-child(6n+5) { background: var(--mint); transform: rotate(-0.8deg); }
.like:nth-child(6n+6) { background: var(--amber); transform: rotate(0.6deg); }
.like:hover { transform: rotate(0deg) scale(1.03); }
.like h3 { font-family: var(--sans); font-size: 16.5px; font-weight: 600; }
.like p {
  font-family: var(--serif); font-style: italic;
  font-size: 14.5px; color: #43402F; margin-top: 4px; line-height: 1.5;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--rule); background: var(--paper-deep);
  padding: 56px 0 40px; margin-top: 40px;
}
.foot-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-left h2 { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.foot-left p { color: var(--ink-soft); margin-top: 8px; max-width: 420px; }
.foot-links { list-style: none; font-size: 15.5px; }
.foot-links li { margin-bottom: 10px; }
.foot-links .label { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: 1.5px; margin-right: 10px; text-transform: uppercase; }
.footnote {
  margin-top: 44px; padding-top: 20px; border-top: 1px dashed var(--rule);
  font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-faint);
}
.footnote sup { color: var(--gold); font-style: normal; }

/* ---------- Blog post page ---------- */
.post-page { max-width: 720px; margin: 0 auto; padding: 72px 24px 96px; }
.post-page .eyebrow { margin-bottom: 10px; }
.post-page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 5vw, 46px); line-height: 1.15; }
.post-meta { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); margin: 16px 0 40px; }
.post-page h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 44px 0 14px; }
.post-page p { margin-bottom: 18px; color: #3D3A33; }
.post-page ul, .post-page ol { margin: 0 0 18px 24px; color: #3D3A33; }
.post-page li { margin-bottom: 8px; }
.post-page blockquote {
  border-left: 3px solid var(--gold); padding: 4px 0 4px 20px;
  font-family: var(--serif); font-style: italic; color: var(--ink-soft); margin: 24px 0;
}
.post-page code {
  font-family: var(--mono); font-size: 14px; background: var(--paper-deep);
  border: 1px solid var(--rule); border-radius: 4px; padding: 1px 6px;
}
.back-link { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; gap: 0; padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 24px; }
  .nav-toggle { display: block; }
  .timeline li, .post-link { grid-template-columns: 1fr; gap: 4px; }
  .post-arrow { display: none; }
  .proj-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .lightbox {
    grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto;
    padding: 20px; gap: 12px;
  }
  .lightbox-figure {
    grid-column: 1 / -1; grid-row: 1; max-height: calc(100vh - 122px);
  }
  .lightbox-img { max-height: calc(100vh - 180px); }
  .lightbox-nav {
    width: 100%; height: 46px; font-size: 38px; grid-row: 2;
  }
  .lightbox-prev { grid-column: 1; }
  .lightbox-next { grid-column: 2; }
  section { padding: 56px 0; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
