/* =========================================================
   Ekanto.in — একান্ত
   Literary editorial theme · Bengali first
   ========================================================= */

:root {
  /* Light theme — warm paper, deep logo-red accent (high contrast for reading) */
  --bg: #fbf6ee;
  --bg-soft: #f4ebdd;
  --card: #fffdf9;
  --ink: #231a17;
  --muted: #65564f;
  --line: #e6d9c7;
  --accent: #a81f1f;
  --on-accent: #fff7ee;
  --accent-soft: #f7e1d9;
  --gold: #e8a317;
  --shadow: 0 14px 34px -18px rgba(90, 30, 20, .35);

  --bn: "Noto Serif Bengali", "Hind Siliguri", Georgia, serif;
  --ui: "Hind Siliguri", "Noto Serif Bengali", system-ui, sans-serif;
  --en: "Cormorant Garamond", "Playfair Display", Georgia, serif;

  --radius: 16px;
  --wrap: 1160px;
  --reader-size: 19px;
}

html[data-theme="dark"] {
  /* Dark theme — warm near-black, logo-gold accent */
  --bg: #15100f;
  --bg-soft: #1d1513;
  --card: #1f1715;
  --ink: #f3e9dc;
  --muted: #c0afa0;
  --line: #3a2b26;
  --accent: #f4b63a;
  --on-accent: #231208;
  --accent-soft: #2f2218;
  --gold: #f4b63a;
  --shadow: 0 14px 34px -18px rgba(0, 0, 0, .75);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg);
  padding: .5rem 1rem; border-radius: 8px; z-index: 200;
}
.skip:focus { top: 1rem; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--bn);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 .6em;
  letter-spacing: -.005em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.3; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.1em; }

.eyebrow {
  font-family: var(--en);
  font-size: 1.05rem;
  font-style: italic;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
  display: block;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 20px -16px rgba(0, 0, 0, .4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }

.logo { display: inline-flex; align-items: center; gap: .7rem; }
.logo-img { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 4px 12px -6px rgba(120, 20, 20, .6); }
.logo-bn { font-family: var(--bn); font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.logo-en {
  font-family: var(--en); font-size: 1rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  font-size: 1rem; color: var(--muted); position: relative; padding: .3rem 0;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--accent); transition: width .25s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }

.header-tools { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.6rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  font-size: 1rem; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.small { padding: .4rem 1.05rem; font-size: .92rem; }

.link-arrow { color: var(--accent); display: inline-flex; gap: .4rem; align-items: center; border-bottom: 1px solid transparent; }
.link-arrow:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin: 1.4rem 0 2.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.ring {
  position: absolute; border-radius: 50%; border: 1px solid var(--line);
  animation: breathe 9s ease-in-out infinite;
}
.ring.r1 { inset: 0; }
.ring.r2 { inset: 11%; animation-delay: -3s; }
.ring.r3 { inset: 22%; animation-delay: -6s; border-color: var(--accent); opacity: .55; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.hero-logo {
  position: relative; width: 62%; height: auto; border-radius: 30px;
  box-shadow: 0 34px 60px -26px rgba(120, 20, 20, .65);
}
html[data-theme="dark"] .hero-logo { box-shadow: 0 0 0 1px rgba(244, 182, 58, .25), 0 34px 70px -26px rgba(244, 182, 58, .3); }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section.soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2.6rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.page-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 2rem; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); margin-bottom: .4rem; }

/* ---------- Category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.tile {
  padding: 2rem 1.7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); display: flex; flex-direction: column; gap: .3rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent); }
.tile .en { font-family: var(--en); font-style: italic; font-size: 1.15rem; color: var(--accent); letter-spacing: .08em; }
.tile h3 { margin: 0; font-size: 1.55rem; }
.tile p { margin: .4rem 0 0; color: var(--muted); font-size: .98rem; line-height: 1.75; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.4rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; display: flex; flex-direction: column; gap: .5rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.tag {
  align-self: flex-start; font-size: .82rem; padding: .1rem .75rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.card h3 { margin: .5rem 0 .2rem; font-size: 1.45rem; }
.card .excerpt { color: var(--muted); font-family: var(--bn); font-size: 1rem; line-height: 1.95; flex: 1; margin: 0; }
.card .meta { font-size: .88rem; color: var(--muted); margin: .6rem 0 .3rem; }
.card .read-btn {
  align-self: flex-start; background: none; border: none; padding: 0;
  color: var(--accent); font-size: 1rem; border-bottom: 1px solid transparent;
}
.card .read-btn:hover { border-color: var(--accent); }
.card.wide { grid-column: 1 / -1; flex-direction: row; gap: 2rem; align-items: center; }

/* ---------- Filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin: 2rem 0 2.2rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .3rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: .95rem; transition: all .2s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search {
  min-width: min(100%, 260px); padding: .55rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit;
}
.search:focus { outline: none; border-color: var(--accent); }
.empty { display: none; text-align: center; color: var(--muted); padding: 3rem 0; }
.empty.show { display: block; }

/* ---------- Photo quote cards ---------- */
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.qcard {
  --c1: #e9d8c4; --c2: #c9a98a; --t: #2b2118;
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(145deg, var(--c1), var(--c2)); color: var(--t);
  display: flex; flex-direction: column; justify-content: center; padding: 2.4rem 2rem;
  text-align: center; box-shadow: var(--shadow); isolation: isolate;
}
.qcard::before {
  content: ""; position: absolute; inset: 14px; border: 1px solid currentColor; opacity: .25;
  border-radius: calc(var(--radius) - 6px); z-index: -1;
}
.qcard blockquote {
  margin: 0; font-family: var(--bn); font-weight: 600;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.85;
}
.qcard .brand {
  position: absolute; left: 0; right: 0; bottom: 1.35rem; font-family: var(--en);
  letter-spacing: .35em; font-size: .85rem; text-transform: uppercase; opacity: .65;
}
.qactions {
  position: absolute; top: .8rem; right: .8rem; display: flex; gap: .4rem;
  opacity: 0; transform: translateY(-4px); transition: all .25s;
}
.qcard:hover .qactions, .qcard:focus-within .qactions { opacity: 1; transform: none; }
.qactions button {
  background: rgba(255, 255, 255, .85); color: #26241f; border: none; padding: .25rem .8rem;
  border-radius: 999px; font-size: .85rem;
}
.qactions button:hover { background: #fff; }
@media (hover: none) { .qactions { opacity: 1; transform: none; } }
.q1 { --c1: #fbe3a3; --c2: #f0b73b; --t: #3a1a0c; }
.q2 { --c1: #c42a26; --c2: #8c1514; --t: #fff1dc; }
.q3 { --c1: #3a2620; --c2: #1a100d; --t: #f7d98a; }
.q4 { --c1: #f6e6d4; --c2: #e2c4a4; --t: #3a1b12; }
.q5 { --c1: #f3c9bd; --c2: #d98a79; --t: #3a120b; }
.q6 { --c1: #2b2b2e; --c2: #111113; --t: #f4ead9; }

/* ---------- Newsletter ---------- */
.newsletter {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid var(--line); border-radius: 24px;
  background: var(--card);
}
.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.2rem; }
.field label { font-size: .95rem; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline-form input { border-radius: 999px; }
textarea { min-height: 170px; resize: vertical; }
.contact-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 4rem); }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.info-list strong { display: block; font-family: var(--en); font-style: italic; letter-spacing: .1em; color: var(--accent); font-weight: 600; }
.social { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.portrait {
  aspect-ratio: 4 / 5; border-radius: 200px 200px 24px 24px;
  background: #b61c1c; overflow: hidden;
  border: 1px solid var(--line); display: grid; place-items: center;
}
.portrait img { width: 100%; height: auto; }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin-top: 2.5rem; }
.value { padding: 1.5rem; border-left: 2px solid var(--accent); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; }
.value h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.value p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- Reader (modal) ---------- */
dialog.reader {
  width: min(740px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line);
  border-radius: 20px; background: var(--card); color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55); overflow: hidden;
}
dialog.reader[open] { display: flex; flex-direction: column; animation: pop .3s ease; }
dialog.reader::backdrop { background: rgba(22, 19, 15, .6); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.reader-bar {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem .7rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--card);
  font-family: var(--en); letter-spacing: .25em; text-transform: uppercase; font-size: .85rem; color: var(--muted);
}
.reader-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); }
.reader-tools { display: flex; gap: .4rem; }
.reader-tools .icon-btn { width: 36px; height: 36px; font-family: var(--ui); font-size: .95rem; letter-spacing: 0; text-transform: none; }
.reader-scroll { overflow-y: auto; padding: clamp(1.6rem, 5vw, 3rem); }
.reader-title { font-size: clamp(1.8rem, 4vw, 2.5rem); text-align: center; margin-bottom: .3rem; }
.reader-meta { text-align: center; color: var(--muted); font-size: .95rem; margin-bottom: 2.2rem; }
.reader-body { font-family: var(--bn); font-size: var(--reader-size); line-height: 2.15; }
.reader-body p { margin: 0 0 1.3em; }
.reader-body.poem { text-align: center; }
.reader-body.poem p { margin-bottom: 2em; }
.reader-body.story p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: .9; padding: .08em .12em 0 0; color: var(--accent); font-weight: 700;
}
.reader-end { text-align: center; color: var(--accent); letter-spacing: .5em; margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 4rem 0 2rem; margin-top: 2rem; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
.footer-grid h4 { font-family: var(--en); font-style: italic; letter-spacing: .12em; color: var(--accent); font-size: 1.1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-grid a { color: var(--muted); transition: color .2s; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .92rem;
}

/* ---------- Utilities ---------- */
.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90; opacity: 0; pointer-events: none;
  transform: translateY(10px); transition: all .3s; background: var(--card);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.toast {
  position: fixed; left: 50%; bottom: 1.8rem; transform: translate(-50%, 20px); z-index: 300;
  background: var(--ink); color: var(--bg); padding: .65rem 1.4rem; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .3s; font-size: .95rem; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.center { text-align: center; }
.mt { margin-top: 2.2rem; }
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.error-page .big { font-family: var(--en); font-size: clamp(6rem, 18vw, 11rem); line-height: 1; color: var(--accent); opacity: .85; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .newsletter, .contact-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 380px; margin-inline: auto; width: 100%; }
  .about-grid .portrait { max-width: 300px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .card.wide { flex-direction: column; align-items: stretch; }

  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.5rem 1.5rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: all .25s;
    max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .nav a::after { display: none; }
  body.nav-open .nav { transform: none; opacity: 1; pointer-events: auto; }
}
@media (max-width: 520px) {
  .logo-en { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .qcard { padding: 2rem 1.4rem; }
}

@media print {
  .site-header, .site-footer, .to-top, .toolbar, .newsletter { display: none !important; }
  body { background: #fff; color: #000; }
}
