/* ==========================================================================
   Boss Writer — Bhaskar Yadav
   Design concept: "Ledger & Ink" — a science notebook meets a comic
   artist's drafting table. Cool graph-paper background, hairline navy
   ink borders, one hot marker-orange accent used like an editor's pen,
   and comic-panel cards (the page's one signature move) for anything
   that represents a made thing: an article, an artifact, a link out.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* color */
  --paper: #EEF1F4;        /* cool graph-paper background */
  --paper-alt: #E4E9EC;    /* slightly deeper paper for section rhythm */
  --panel: #FFFFFF;        /* card / panel surface */
  --ink: #16233D;          /* primary text + hairline borders */
  --ink-muted: #5B6478;    /* secondary text */
  --ink-faint: #97A0B2;    /* tertiary / placeholder text */
  --marker: #FF5A36;       /* signature accent — editor's marker */
  --marker-dark: #DC431F;
  --signal: #0F9B8E;       /* secondary accent — code / links */
  --plum: #6B4FA0;         /* tertiary accent — stories */
  --line: #C7CDD6;         /* hairline dividers on paper */

  /* type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* layout */
  --content-width: 1120px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --radius: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  :root { --motion-ok: 1; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

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

/* ---------- eyebrow / mono labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--marker-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.4em;
  height: 2px;
  background: var(--marker);
  display: inline-block;
}

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 241, 244, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--ink);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.brand span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}
.nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--marker);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 260px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1rem var(--space-3); border-bottom: none; }
  .nav-links a[aria-current="page"] { background: var(--panel); box-shadow: inset 3px 0 0 var(--marker); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.85em 1.4em;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--marker); border-color: var(--marker); transform: translateY(-2px); }
.btn.btn-ghost { background: transparent; color: var(--ink); }
.btn.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn.btn-marker { background: var(--marker-dark); border-color: var(--marker-dark); color: #fff; }
.btn.btn-marker:hover { background: var(--marker); border-color: var(--marker); }

/* ---------- hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
  position: relative;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  max-width: 16ch;
  margin: 0.5em 0 0.6em;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 56ch;
  margin-bottom: var(--space-3);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--ink);
  padding: 0.5em 0.9em;
  border-radius: var(--radius);
}
.status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(15,155,142,0.15);
}
.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

/* ---------- section headers ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-top: 0.4em;
}
.section-head .see-all {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--ink-faint);
}
.section-head .see-all:hover { color: var(--marker-dark); border-color: var(--marker); }

section { padding: var(--space-5) 0; }
section.alt { background: var(--paper-alt); }
section.on-ink { background: var(--ink); color: var(--paper); }
section.on-ink .eyebrow { color: var(--marker); }
section.on-ink .eyebrow::before { background: var(--marker); }

/* ---------- signature: panel cards ---------- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
}
.panel {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.panel { cursor: pointer; }
.panel:hover {
  transform: translate(-2px, -4px) rotate(-0.4deg);
  box-shadow: 6px 6px 0 var(--ink);
}
.panel-tab {
  position: absolute;
  top: -12px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--marker-dark);
  color: #fff;
  padding: 0.3em 0.7em;
  border-radius: 2px;
  transform: rotate(-2deg);
}
.panel-tab.tab-code { background: var(--signal); }
.panel-tab.tab-doc { background: var(--ink); }
.panel-tab.tab-story { background: var(--plum); }
.panel-tab.tab-demo { background: var(--ink-muted); }
.panel.is-template { border-style: dashed; }
.panel.is-template:hover { transform: none; box-shadow: none; cursor: default; }
.panel .panel-meta .go.muted { color: var(--ink-faint); }
.panel h3 {
  font-size: 1.15rem;
  margin-top: 0.3em;
}
.panel p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}
.panel .panel-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6em;
  border-top: 1px dashed var(--line);
}
.panel .panel-meta .go { color: var(--marker-dark); }

/* tiles (used for "what you'll find here") */
.tile {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover { transform: translate(-2px, -4px) rotate(0.4deg); box-shadow: 6px 6px 0 var(--ink); }
.tile .num { font-family: var(--font-mono); color: var(--marker-dark); font-size: 0.8rem; }
.tile h3 { font-size: 1.25rem; margin: 0.5em 0 0.35em; }
.tile p { color: var(--ink-muted); font-size: 0.92rem; margin: 0; }

/* ---------- filter pills (artifacts page) ---------- */
.filters {
  display: flex;
  gap: 0.6em;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.filter-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.5em 1.1em;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-pill:hover { border-color: var(--marker); }
.filter-pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- empty / instructional state ---------- */
.instruct {
  border: 2px dashed var(--ink-faint);
  border-radius: var(--radius);
  padding: var(--space-4);
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.instruct h3 { color: var(--ink); font-size: 1.1rem; margin-bottom: 0.4em; }
.instruct code {
  font-family: var(--font-mono);
  background: var(--paper-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ---------- handles / socials ---------- */
.handles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.handle-card {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.handle-card:hover { box-shadow: 4px 4px 0 var(--marker); transform: translate(-2px,-2px); }
.handle-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.handle-icon svg { width: 20px; height: 20px; stroke: var(--paper); fill: none; }
.handle-card h3 { font-size: 1rem; margin: 0 0 0.15em; }
.handle-card p { font-size: 0.85rem; color: var(--ink-muted); margin: 0; }
.handle-card .handle-name { font-family: var(--font-mono); font-size: 0.78rem; color: var(--marker-dark); }

/* on-ink variant for handle cards used in dark sections */
section.on-ink .handle-card { background: rgba(238,241,244,0.05); border-color: rgba(238,241,244,0.35); color: var(--paper); }
section.on-ink .handle-card:hover { box-shadow: 4px 4px 0 var(--marker); }
section.on-ink .handle-card p { color: rgba(238,241,244,0.65); }
section.on-ink .handle-icon { background: var(--marker); }

/* ---------- tags (about page topics) ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.6em; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.45em 1em;
  color: var(--ink);
}

/* ---------- about layout ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-5);
  align-items: start;
}
.avatar-badge {
  width: 180px;
  height: 180px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  transform: rotate(-2deg);
  box-shadow: 8px 8px 0 var(--marker);
}
.prose p { margin-bottom: 1.1em; max-width: 68ch; color: var(--ink); }
.prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding: 0.05em 0.08em 0 0;
  font-weight: 700;
  color: var(--marker-dark);
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .avatar-badge { margin: 0 auto; }
}

/* ---------- contact ---------- */
.contact-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
.email-block {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  border-bottom: 3px solid var(--marker);
  padding-bottom: 0.2em;
  text-decoration: none;
  color: var(--ink);
}
.email-block:hover { color: var(--marker-dark); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--ink);
  padding: var(--space-4) 0 var(--space-3);
  background: var(--paper-alt);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.footer-links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.footer-links a { text-decoration: none; color: var(--ink-muted); }
.footer-links a:hover { color: var(--marker-dark); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ---------- reveal-on-scroll ---------- */
[data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
  [data-reveal].is-visible { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .hero { padding: var(--space-5) 0 var(--space-4); }
  section { padding: var(--space-4) 0; }
}
