/* =========================================================
   RAJESH KUMAR SINHA — PORTFOLIO
   Design language: "A Life Set in Type"
   A literary-magazine masthead treatment — ink, maroon and
   brass on a deep umber ground, with a book-spine motif
   running through the gallery.
   ========================================================= */

:root{
  --ink:        #1c1310;   /* base background — warm near-black */
  --ink-soft:   #271b16;   /* card / panel background */
  --ink-line:   #40302a;   /* hairline rules on dark */
  --maroon:     #6a1f31;   /* primary accent — from book covers */
  --maroon-dp:  #4a1522;   /* deeper maroon for hovers */
  --brass:      #c9a227;   /* headline highlight / gold */
  --brass-soft: #e7cf8a;   /* softer brass for small text on dark */
  --rust:       #b1552a;   /* secondary warm accent */
  --parchment:  #efe7d4;   /* primary text on dark ground */
  --parchment-dim: #c8bda6; /* secondary text on dark ground */

  --display: "Fraunces", "Georgia", serif;
  --body:    "Literata", "Georgia", serif;
  --mono:    "JetBrains Mono", "Courier New", monospace;

  --max: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

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

/* subtle paper-grain texture on the whole page */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a{ color: inherit; }

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

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------
   MASTHEAD / NAV
   --------------------------------------------------------- */
.masthead{
  border-bottom: 1px solid var(--ink-line);
  background: linear-gradient(180deg, rgba(0,0,0,0.18), transparent);
}

.masthead-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  border-bottom: 1px solid var(--ink-line);
}

.masthead-top span.dot{ color: var(--brass); margin: 0 8px; }

.nameplate{
  padding: 26px 0 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.nameplate h1{
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--parchment);
}

.nameplate .devanagari{
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 0.42em;
  color: var(--brass-soft);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.tagline{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  max-width: 320px;
  text-align: right;
  border-right: 2px solid var(--brass);
  padding-right: 14px;
}

nav.section-tabs{
  display: flex;
  gap: 2px;
  border-top: 1px solid var(--ink-line);
  overflow-x: auto;
}

nav.section-tabs a{
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  padding: 14px 20px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

nav.section-tabs a .hi{
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--brass-soft);
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

nav.section-tabs a:hover,
nav.section-tabs a.active{
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ---------------------------------------------------------
   GENERIC SECTION SCAFFOLDING
   --------------------------------------------------------- */
section{ padding: 64px 0; position: relative; z-index: 1; }
section + section{ border-top: 1px solid var(--ink-line); }

.eyebrow{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}
.eyebrow::before{
  content:"";
  width: 26px; height: 1px;
  background: var(--rust);
}

h2.section-title{
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin: 0 0 20px;
  color: var(--parchment);
}

h3{
  font-family: var(--display);
  font-weight: 600;
  color: var(--brass-soft);
}

p{ color: var(--parchment); }
p.lede{
  font-size: 1.15rem;
  color: var(--parchment);
  max-width: 68ch;
}
p.muted{ color: var(--parchment-dim); }

.rule{
  height: 1px;
  background: linear-gradient(90deg, var(--brass), transparent 70%);
  border: none;
  margin: 28px 0;
}

/* ---------------------------------------------------------
   HERO (home page)
   --------------------------------------------------------- */
.hero{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
  padding-top: 56px;
}

.hero-portrait{
  width: 340px;
  max-width: 340px;
  margin-left: auto;
  border: 1px solid var(--ink-line);
  padding: 12px;
  background: var(--ink-soft);
  position: relative;
}
.hero-portrait::after{
  content: "Rajesh Kumar Sinha, present day";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--parchment-dim);
  text-align: center;
  padding-top: 10px;
}
.hero-portrait img{ filter: sepia(12%) saturate(105%); }

.hero-copy .kicker{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 10px;
}

.hero-copy h2{
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.3;
  margin: 0 0 20px;
  color: var(--parchment);
}

.pull-stats{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 40px;
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
}
.pull-stats.pull-stats-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px){
  .pull-stats.pull-stats-4{ grid-template-columns: repeat(2, 1fr); }
}
.pull-stats div{
  padding: 20px 18px;
  border-right: 1px solid var(--ink-line);
}
.pull-stats div:last-child{ border-right: none; }
.pull-stats .num{
  font-family: var(--display);
  font-size: 2rem;
  color: var(--brass);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}
.pull-stats .label{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment-dim);
}

.cta-row{ margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn{
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 24px;
  border: 1px solid var(--brass);
  color: var(--brass);
  transition: all 0.2s ease;
}
.btn:hover{ background: var(--brass); color: var(--ink); }
.btn.solid{ background: var(--maroon); border-color: var(--maroon); color: var(--parchment); }
.btn.solid:hover{ background: var(--maroon-dp); border-color: var(--maroon-dp); color: var(--parchment); }

/* ---------------------------------------------------------
   TIMELINE (about page)
   --------------------------------------------------------- */
.timeline{ margin-top: 10px; }
.t-row{
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-line);
}
.t-row:last-child{ border-bottom: none; }
.t-year{
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brass);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.t-body h4{
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0 0 6px;
  color: var(--parchment);
  font-weight: 600;
}
.t-body p{ margin: 0; color: var(--parchment-dim); }

/* ---------------------------------------------------------
   GALLERY — book-spine motif
   --------------------------------------------------------- */
.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.plate{
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  overflow: hidden;
}
.plate .frame{
  aspect-ratio: 4/5;
  overflow: hidden;
  background: #0f0b09;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plate .frame img{
  width: 100%; height: 100%;
  object-fit: cover;
}
.plate figcaption{
  padding: 14px 16px;
  border-top: 3px solid var(--maroon);
}
.plate figcaption .cap-title{
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--parchment);
  display: block;
  margin-bottom: 3px;
}
.plate figcaption .cap-meta{
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

/* ---------------------------------------------------------
   BOOKS — purchase listing rows
   --------------------------------------------------------- */
.book-row{
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--ink-line);
}
.book-row:last-child{ border-bottom: none; }

.book-cover{
  width: 130px;
  height: 170px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}
.book-cover img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.book-info .book-title{
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--parchment);
  margin: 0 0 6px;
}
.book-info .book-meta{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

.book-buy{
  justify-self: end;
}

.contact-note{
  margin-top: 34px;
  padding: 20px 24px;
  border-left: 2px solid var(--brass);
  background: var(--ink-soft);
  font-size: 0.98rem;
  color: var(--parchment-dim);
}
.contact-note a{ color: var(--brass); text-decoration: none; border-bottom: 1px solid var(--brass); }
.contact-note a:hover{ color: var(--brass-soft); }

@media (max-width: 640px){
  .book-row{
    grid-template-columns: 90px 1fr;
    grid-template-areas: "cover info" "buy buy";
  }
  .book-row .book-cover{ grid-area: cover; width: 90px; height: 120px; }
  .book-row .book-info{ grid-area: info; }
  .book-row .book-buy{ grid-area: buy; justify-self: start; margin-top: 14px; }
}
.contact-card{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink-line);
  background: var(--ink-soft);
  margin-top: 30px;
}
.contact-panel{ padding: 40px; }
.contact-panel + .contact-panel{ border-left: 1px solid var(--ink-line); }

.contact-item{
  display: block;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-line);
  text-decoration: none;
}
.contact-item:last-child{ border-bottom: none; }
.contact-item .k{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 6px;
}
.contact-item .v{
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--parchment);
  transition: color 0.2s ease;
}
.contact-item:hover .v{ color: var(--brass); }

.masthead-block{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--parchment-dim);
  line-height: 1.9;
}
.masthead-block strong{ color: var(--brass-soft); display:block; font-family: var(--display); font-size: 14px; margin-bottom: 8px; }

/* ---------------------------------------------------------
   FOOTER / COLOPHON
   --------------------------------------------------------- */
footer{
  border-top: 1px solid var(--ink-line);
  padding: 30px 0 50px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--parchment-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer .brass{ color: var(--brass); }

/* focus visibility */
a:focus-visible, .btn:focus-visible{
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 820px){
  .hero{ grid-template-columns: 1fr; }
  .hero-portrait{ width: 220px; max-width: 220px; margin-left: 0; }
  .nameplate{ flex-direction: column; align-items: flex-start; }
  .tagline{ text-align: left; border-right: none; border-left: 2px solid var(--brass); padding-left: 14px; padding-right: 0; }
  .contact-card{ grid-template-columns: 1fr; }
  .contact-panel + .contact-panel{ border-left: none; border-top: 1px solid var(--ink-line); }
  .pull-stats{ grid-template-columns: 1fr; }
  .pull-stats div{ border-right: none; border-bottom: 1px solid var(--ink-line); }
  .pull-stats div:last-child{ border-bottom: none; }
}

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