/* =========================================================
   Essays by Smita — Design System
   Minimalist intellectual theme
   Palette: cream / black / dark green / gold
   Fonts:  Playfair Display (headings) · Inter (body)
   ========================================================= */

:root {
  /* Light theme (default) */
  --bg:          #f7f3ea;   /* cream */
  --bg-soft:     #efe9da;
  --surface:     #fffdf8;
  --surface-2:   #f1ecdf;
  --border:      #e2d9c5;
  --text:        #1c1b18;   /* near-black */
  --text-soft:   #4a463d;
  --text-mute:   #847d6c;
  --accent:      #1f4d3a;   /* dark green */
  --accent-soft: #2c6a50;
  --gold:        #b08423;   /* gold highlight */
  --gold-soft:   #d8b352;
  --shadow:      0 1px 2px rgba(28,27,24,.05), 0 8px 24px rgba(28,27,24,.06);
  --shadow-lg:   0 12px 40px rgba(28,27,24,.12);
  --radius:      14px;
  --radius-sm:   9px;
  --maxw:        1120px;
  --readw:       720px;
  --reader-size: 1.18rem;
  --font-head:   "Playfair Display", Georgia, serif;
  --font-body:   "Inter", system-ui, -apple-system, sans-serif;
  --font-read:   "Merriweather", Georgia, serif;
}

[data-theme="dark"] {
  --bg:          #16140f;
  --bg-soft:     #1d1a13;
  --surface:     #211e16;
  --surface-2:   #28241a;
  --border:      #38332600;
  --border:      #3a3528;
  --text:        #f1ecdf;
  --text-soft:   #d6cfbd;
  --text-mute:   #9a917d;
  --accent:      #6fae8e;
  --accent-soft: #8cc4a6;
  --gold:        #e0bb5e;
  --gold-soft:   #f0d488;
  --shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:   0 14px 44px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; color: var(--text); margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }
p  { margin: 0 0 1rem; color: var(--text-soft); }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section   { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.muted { color: var(--text-mute); }
.center { text-align: center; }

/* ---------- Eyebrow / section headers ---------- */
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 .6rem;
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: .7rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-primary { color: #11130f; }
.btn-primary:hover { background: var(--accent-soft); color:#fff; transform: translateY(-1px); }
[data-theme="dark"] .btn-primary:hover { color:#11130f; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-gold { background: var(--gold); color: #1c1b18; }
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-1px); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--text); letter-spacing: -.01em; }
.brand span { color: var(--gold); }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-soft); font-weight: 500; font-size: .92rem;
  padding: .4rem .7rem; border-radius: 8px; transition: all .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--surface-2); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; transition: all .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px; transform: translateY(-120%); transition: transform .3s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .7rem .4rem; border-radius: 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: grid; }
}

/* ---------- Hero ---------- */
.hero { padding: 70px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .3em; }
.hero .lead { font-size: 1.2rem; color: var(--text-soft); max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.avatar {
  width: 230px; height: 230px; border-radius: 50%; margin: 0 auto;
  background: radial-gradient(circle at 30% 25%, var(--accent-soft), var(--accent));
  display: grid; place-items: center; color: #fff; font-family: var(--font-head);
  font-size: 5rem; font-weight: 700; box-shadow: var(--shadow-lg);
  border: 5px solid var(--surface); position: relative;
}
.avatar::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px dashed var(--gold-soft); opacity: .6;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .avatar { width: 170px; height: 170px; font-size: 3.6rem; order: -1; }
}

/* ---------- Daily quote ---------- */
.quote-band { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 40px; text-align: center; position: relative; overflow: hidden; }
[data-theme="dark"] .quote-band { background: var(--surface-2); border: 1px solid var(--border); }
.quote-band::before { content: "\201C"; position: absolute; top: -30px; left: 24px; font-family: var(--font-head); font-size: 9rem; opacity: .15; }
.quote-band blockquote { font-family: var(--font-head); font-size: clamp(1.3rem,2.6vw,1.9rem); font-style: italic; margin: 0 auto; max-width: 60ch; line-height: 1.4; color:#fff; }
[data-theme="dark"] .quote-band blockquote { color: var(--text); }
.quote-band cite { display: block; margin-top: 14px; font-style: normal; font-family: var(--font-body); font-weight: 600; letter-spacing: .06em; color: var(--gold-soft); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  display: flex; flex-direction: column; height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card .tag-row { margin-bottom: 12px; }
.card h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card .excerpt { color: var(--text-soft); font-size: .95rem; flex: 1; }
.card .meta { display: flex; gap: 14px; align-items: center; margin-top: 16px; font-size: .82rem; color: var(--text-mute); flex-wrap: wrap; }
.card .meta span { display: inline-flex; align-items: center; gap: 5px; }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  padding: .28rem .7rem; border-radius: 999px; background: var(--surface-2);
  color: var(--accent); border: 1px solid var(--border); text-transform: uppercase;
}
.pill.gold { color: var(--gold); }

/* Featured essay */
.featured {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface);
}
.featured .img {
  min-height: 300px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  position: relative;
}
.featured .img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, rgba(255,255,255,.18), transparent 60%); }
.featured .body { padding: 42px; display: flex; flex-direction: column; justify-content: center; }
.featured h2 { font-size: clamp(1.6rem,2.8vw,2.3rem); margin: 10px 0 14px; }
.featured h2 a { color: var(--text); }
@media (max-width: 760px){ .featured { grid-template-columns: 1fr; } .featured .body{ padding: 28px; } }

/* Topics */
.topics { display: flex; flex-wrap: wrap; gap: 12px; }
.topic-chip {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-weight: 600; transition: all .2s; box-shadow: var(--shadow);
}
.topic-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.topic-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.topic-chip small { color: var(--text-mute); font-weight: 500; }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px; text-align: center;
}
.newsletter h2 { margin-bottom: .3em; }
.newsletter p { max-width: 52ch; margin: 0 auto 22px; }
.subscribe-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.subscribe-form input {
  flex: 1; min-width: 200px; padding: .8rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .95rem;
}
.subscribe-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-note { font-size: .8rem; color: var(--text-mute); margin-top: 12px; }

/* ---------- Search ---------- */
.search-wrap { position: relative; max-width: 520px; }
.search-input {
  width: 100%; padding: .85rem 1.1rem .85rem 2.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .98rem;
}
.search-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }
.search-results { margin-top: 18px; }

/* ---------- Page header ---------- */
.page-head { padding: 56px 0 18px; }
.page-head h1 { margin-bottom: .25em; }
.page-head p { font-size: 1.1rem; max-width: 58ch; }

/* ---------- Library toolbar ---------- */
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 26px 0; }
.toolbar .search-wrap { flex: 1; min-width: 240px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] .chip.active { color: #11130f; }
.select, .view-toggle button {
  padding: .5rem .8rem; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .85rem; cursor: pointer;
  font-family: var(--font-body);
}
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.view-toggle button { border: none; border-radius: 0; }
.view-toggle button.active { background: var(--accent); color: #fff; }
[data-theme="dark"] .view-toggle button.active { color:#11130f; }

/* list view */
.list-view .card { flex-direction: row; align-items: center; gap: 20px; }
.list-view .card .excerpt { display: none; }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Reading experience ---------- */
.reader { max-width: var(--readw); margin: 0 auto; padding: 40px 24px 90px; }
.reader .essay-head { margin-bottom: 34px; }
.reader h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.reader .essay-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-mute); font-size: .9rem; margin-top: 14px; align-items: center; }
.reader .essay-body { font-family: var(--font-read); font-size: var(--reader-size); line-height: 1.85; color: var(--text); }
.reader .essay-body p { color: var(--text); margin-bottom: 1.4em; }
.reader .essay-body h2 { font-family: var(--font-head); margin-top: 1.8em; }
.reader .essay-body h3 { margin-top: 1.5em; }
.reader .essay-body blockquote {
  border-left: 3px solid var(--gold); margin: 1.6em 0; padding: .4em 1.3em;
  font-style: italic; color: var(--text-soft); position: relative;
}
.reader .essay-body blockquote .share-quote {
  display: inline-block; margin-top: 8px; font-size: .78rem; font-style: normal;
  color: var(--accent); cursor: pointer; font-family: var(--font-body); font-weight: 600;
}
.reader .essay-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.font-serif .essay-body { font-family: var(--font-read); }
.font-sans  .essay-body { font-family: var(--font-body); }
.font-playfair .essay-body { font-family: var(--font-head); }
.font-baskerville .essay-body { font-family: "Libre Baskerville", Georgia, serif; }
.font-garamond .essay-body { font-family: "EB Garamond", Georgia, serif; }
.font-crimson .essay-body { font-family: "Crimson Text", Georgia, serif; }

/* progress bar */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: var(--gold); z-index: 60; transition: width .1s linear; }

/* reading toolbar (floating) */
.reader-tools {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  display: flex; flex-direction: column; gap: 10px;
}
.reader-tools .icon-btn { background: var(--surface); box-shadow: var(--shadow-lg); }
.reader-panel {
  position: fixed; right: 22px; bottom: 80px; z-index: 56; width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px; display: none;
}
.reader-panel.open { display: block; }
.reader-panel label { font-size: .78rem; font-weight: 600; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; display:block; margin: 12px 0 6px; }
.reader-panel .row { display: flex; gap: 6px; flex-wrap: wrap; }
.reader-panel .mini { padding: .35rem .6rem; font-size: .8rem; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.reader-panel .mini.active { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] .reader-panel .mini.active { color:#11130f; }

/* TOC */
.toc {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin: 26px 0 34px;
}
.toc h4 { font-family: var(--font-body); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--text-mute); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--text-soft); }
.toc a:hover { color: var(--accent); }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
@media (max-width: 760px){ .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.stat .num { font-family: var(--font-head); font-size: 2.4rem; color: var(--accent); line-height: 1; }
.stat .lbl { color: var(--text-mute); font-size: .9rem; margin-top: 8px; }

/* ---------- Timeline (about) ---------- */
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 26px; }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item::before { content:""; position: absolute; left: -33px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }
.timeline-item .yr { font-family: var(--font-head); color: var(--accent); font-weight: 700; }

/* ---------- Garden / notes ---------- */
.note {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--gold);
}
.note .status { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); font-weight: 700; }

/* book notes */
.book-card { display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: start; }
.book-cover { width: 86px; height: 124px; border-radius: 6px; background: linear-gradient(135deg,var(--accent),var(--accent-soft)); display:grid; place-items:center; color:#fff; font-family: var(--font-head); font-size:1.5rem; box-shadow: var(--shadow); }
.rating { color: var(--gold); letter-spacing: 2px; }

/* quotes wall */
.quote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); break-inside: avoid; margin-bottom: 20px;
}
.quote-card p { font-family: var(--font-head); font-style: italic; font-size: 1.15rem; color: var(--text); }
.quote-card cite { font-style: normal; color: var(--gold); font-weight: 600; font-size: .85rem; }
.masonry { column-count: 3; column-gap: 20px; }
@media (max-width: 860px){ .masonry { column-count: 2; } }
@media (max-width: 560px){ .masonry { column-count: 1; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 54px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-bottom: 14px; }
.footer-grid a { display: block; color: var(--text-soft); padding: 4px 0; font-size: .92rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display:flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--text-mute); font-size: .85rem; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.fade-in { animation: fade .6s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: .8rem 1.3rem; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .3s; z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
::selection { background: var(--gold-soft); color: #1c1b18; }
