/* ==========================================================
   johnramesh.com — stylesheet
   Palette:
     ink    #16232E   deep blue-black — text, dark fields
     paper  #FBF9F4   page background
     linen  #F0EBE0   recessed surfaces
     brass  #B0813F   accent, active states
     slate  #5A6B78   secondary text
   ========================================================== */

:root {
  --ink: #16232E;
  --paper: #FBF9F4;
  --linen: #F0EBE0;
  --brass: #B0813F;
  --brass-lite: #D9B778;
  --slate: #5A6B78;
  --line: #DDD5C6;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --r: 3px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 74px; gap: 24px;
}
.brand {
  font-family: var(--serif); font-size: 21px; font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--brass); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--slate); padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.on { color: var(--ink); border-bottom-color: var(--brass); }

.cart-btn {
  position: relative; background: var(--ink); color: var(--paper);
  border: 0; border-radius: var(--r); padding: 9px 16px;
  font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer;
}
.cart-btn:hover { background: #22323F; }
.cart-count {
  display: inline-block; min-width: 19px; margin-left: 6px; padding: 0 5px;
  background: var(--brass); border-radius: 10px;
  font-size: 12px; font-weight: 700; text-align: center;
}

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); padding: 72px 0 64px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 56px; align-items: center;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brass); margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 20px;
}
.hero p.lede { font-size: 18px; color: var(--slate); max-width: 46ch; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; border: 0; border-radius: var(--r);
  padding: 13px 24px; font-family: var(--sans); font-size: 15px;
  font-weight: 500; text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #22323F; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: #9A6F32; }
.btn:disabled, .btn.is-off {
  background: var(--linen); color: var(--slate); cursor: not-allowed; box-shadow: none;
}
.btn-block { display: block; width: 100%; }

.spines { display: flex; flex-direction: column; gap: 7px; }
.spine {
  height: 46px; border-radius: 2px; display: flex; align-items: center;
  padding: 0 16px; font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em;
  color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ---------- sections ---------- */
.sec { padding: 64px 0; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; border-bottom: 1px solid var(--line);
  padding-bottom: 14px; margin-bottom: 34px;
}
.sec-head h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  letter-spacing: -0.01em; margin: 0;
}
.sec-head .note { font-size: 14px; color: var(--slate); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip {
  background: transparent; border: 1px solid var(--line); border-radius: 100px;
  padding: 7px 15px; font-family: var(--sans); font-size: 13.5px;
  color: var(--slate); cursor: pointer;
}
.chip:hover { border-color: var(--slate); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- book grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 30px 26px;
}
.card { display: flex; flex-direction: column; text-decoration: none; }
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; padding: 20px 18px; color: #fff;
  box-shadow: 0 1px 2px rgba(22,35,46,.14), 0 8px 20px -10px rgba(22,35,46,.34);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover .cover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(22,35,46,.16), 0 16px 30px -12px rgba(22,35,46,.42);
}
.cover::before {
  content: ""; position: absolute; left: 9px; top: 0; bottom: 0;
  width: 3px; background: rgba(255,255,255,.30);
}
.cover-lang {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; opacity: .85; padding-left: 12px;
}
.cover-title {
  font-family: var(--serif); font-size: 21px; line-height: 1.24;
  font-weight: 600; padding-left: 12px;
}
.cover-title.s-tamil, .cover-title.s-telugu,
.cover-title.s-devanagari, .cover-title.s-malayalam {
  font-family: var(--sans); font-size: 17px; line-height: 1.45;
}
.cover-foot {
  padding-left: 12px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; opacity: .7;
}
.card-body { padding-top: 14px; }
.card-title {
  font-family: var(--serif); font-size: 16.5px; font-weight: 600;
  line-height: 1.35; margin: 0 0 4px;
}
.card-meta { font-size: 13px; color: var(--slate); }
.card-price { font-size: 13px; color: var(--ink); font-weight: 600; margin-top: 6px; }
.tag-soon {
  display: inline-block; margin-top: 6px; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brass);
}

/* ---------- book detail ---------- */
.detail { padding: 52px 0 72px; }
.crumb { font-size: 13.5px; color: var(--slate); margin-bottom: 28px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--brass); }
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start; }
.detail h1 {
  font-family: var(--serif); font-size: clamp(27px, 3.4vw, 39px);
  line-height: 1.18; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 12px;
}
.detail h1.s-tamil, .detail h1.s-telugu,
.detail h1.s-devanagari, .detail h1.s-malayalam {
  font-family: var(--sans); font-size: clamp(23px, 2.9vw, 32px); line-height: 1.4;
}
.byline { font-size: 15px; color: var(--slate); margin: 0 0 24px; }
.detail .blurb { font-size: 17.5px; line-height: 1.72; max-width: 60ch; }
.specs {
  display: flex; gap: 34px; flex-wrap: wrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 0; margin: 28px 0;
}
.spec-k {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--slate); margin-bottom: 2px;
}
.spec-v { font-size: 15px; font-weight: 600; }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.buy-note { font-size: 13.5px; color: var(--slate); }

.trans-strip { margin-top: 44px; }
.trans-strip h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; }
.trans-strip p.sub { font-size: 14px; color: var(--slate); margin: 0 0 18px; }
.trans-list { display: flex; flex-wrap: wrap; gap: 9px; }
.trans-list a {
  text-decoration: none; border: 1px solid var(--line); border-radius: 100px;
  padding: 8px 16px; font-size: 13.5px; color: var(--slate);
}
.trans-list a:hover { border-color: var(--ink); color: var(--ink); }
.trans-list a.on {
  background: var(--linen); border-color: var(--linen);
  color: var(--ink); font-weight: 600;
}

/* ---------- about ---------- */
.about { background: var(--linen); border-top: 1px solid var(--line); }
.about-grid {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 56px; align-items: start; padding: 72px 0;
}
.portrait {
  aspect-ratio: 4/5; background: var(--ink); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-lite); font-family: var(--serif);
  font-size: 60px; font-weight: 600;
}
.about h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 0 18px; }
.about p { max-width: 58ch; margin: 0 0 16px; }

/* ---------- cart drawer ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(22,35,46,.45);
  opacity: 0; pointer-events: none; transition: opacity .24s ease; z-index: 60;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--paper); z-index: 70; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px -12px rgba(22,35,46,.4);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-family: var(--serif); font-size: 20px; margin: 0; }
.x {
  background: none; border: 0; font-size: 26px; line-height: 1;
  color: var(--slate); cursor: pointer; padding: 0 4px;
}
.x:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 20px 24px 26px; }
.line {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px;
  align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.line-thumb { height: 62px; border-radius: 2px; }
.line-t { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.3; }
.line-m { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty button {
  width: 24px; height: 24px; border: 1px solid var(--line); background: none;
  border-radius: 3px; cursor: pointer; color: var(--slate); font-size: 15px; line-height: 1;
}
.qty button:hover { border-color: var(--ink); color: var(--ink); }
.line-p { font-size: 14px; font-weight: 600; }
.totals { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.totals.grand { font-size: 17px; font-weight: 700; margin: 14px 0 18px; }
.empty { text-align: center; color: var(--slate); padding: 60px 20px; font-size: 15px; }

/* ---------- reader ---------- */
.reader-head {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 50;
}
.reader-head .rt {
  font-family: var(--serif); font-size: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px;
}
.reader-head a { color: var(--brass-lite); text-decoration: none; font-size: 14px; white-space: nowrap; }
.reader-head a:hover { color: #fff; }
.reader-frame { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; border: 0; width: 100%; }
.reader-miss {
  position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; gap: 14px;
}

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 44px 0; font-size: 13.5px; color: var(--slate); }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--brass); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---------- checkout ---------- */
.checkout { padding: 52px 0 80px; max-width: 640px; }
.checkout h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 8px; }
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 6px;
}
.field input, .field select {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: var(--sans);
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); background: #fff;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--brass); outline-offset: -1px; border-color: var(--brass);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary { background: var(--linen); border-radius: var(--r); padding: 22px 24px; margin: 30px 0; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .detail-grid, .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .detail-grid .cover-col { max-width: 260px; }
  .spines { flex-direction: row; flex-wrap: wrap; }
  .spine { flex: 1 1 46%; }
}
@media (max-width: 640px) {
  .site-head .wrap { height: 64px; gap: 12px; }
  .nav { gap: 16px; }
  .nav a.hide-sm { display: none; }
  .hero { padding: 48px 0 44px; }
  .sec { padding: 48px 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
  .cover { padding: 14px 12px; }
  .cover-title { font-size: 16px; }
  .cover-title.s-tamil, .cover-title.s-telugu,
  .cover-title.s-devanagari, .cover-title.s-malayalam { font-size: 13.5px; }
  .row2 { grid-template-columns: 1fr; }
  .specs { gap: 22px; }
}
