/* ============================================================
   Sham-e-Mehfil — Editorial design system
   ============================================================ */

:root {
  /* Color — warm ivory / charcoal / muted bronze */
  --ivory:      #F4EFE6;
  --paper:      #FBF9F4;
  --beige:      #E9E1D3;
  --beige-deep: #DED3C0;
  --ink:        #1C1A17;
  --ink-soft:   #46413A;
  --muted:      #8C8475;
  --faint:      #B6AE9F;
  --gold:       #A9844F;
  --gold-deep:  #8A6A38;
  --espresso:   #34281D;
  --line:       rgba(28,26,23,0.12);
  --line-soft:  rgba(28,26,23,0.07);

  /* Type */
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --shell:  1280px;
  --gut:    clamp(20px, 5vw, 64px);

  /* Easing */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.005em;
}

::selection { background: var(--gold); color: var(--paper); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Typography ---------- */
.serif { font-family: var(--serif); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.04; letter-spacing: -0.01em; }

.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 9vw, 8.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.h-xl { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; }
.h-lg { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.h-md { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.h-sm { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }

.lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.4;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.body-lg { font-size: 1.18rem; line-height: 1.62; color: var(--ink-soft); }
.muted { color: var(--muted); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow.ink { color: var(--ink-soft); }

.serif-it { font-style: italic; }

/* ---------- Layout ---------- */
.shell { max-width: var(--shell); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.shell-wide { max-width: 1500px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.shell-narrow { max-width: 760px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }

.section { padding: clamp(72px, 11vw, 160px) 0; }
.section-sm { padding: clamp(48px, 7vw, 96px) 0; }

.bg-paper { background: var(--paper); }
.bg-beige { background: var(--beige); }
.bg-ink { background: var(--espresso); color: var(--paper); }
.bg-ink .muted { color: rgba(251,249,244,0.6); }
.bg-ink .eyebrow { color: var(--gold); }

.rule { height: 1px; background: var(--line); border: none; }

/* ---------- Classical jali (lattice) pattern ---------- */
.jali {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23A9844F' stroke-width='1'%3E%3Ccircle cx='0' cy='0' r='28'/%3E%3Ccircle cx='56' cy='0' r='28'/%3E%3Ccircle cx='0' cy='56' r='28'/%3E%3Ccircle cx='56' cy='56' r='28'/%3E%3Ccircle cx='28' cy='28' r='28'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
}
.jali-dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23C9A766' stroke-width='1'%3E%3Ccircle cx='0' cy='0' r='28'/%3E%3Ccircle cx='56' cy='0' r='28'/%3E%3Ccircle cx='0' cy='56' r='28'/%3E%3Ccircle cx='56' cy='56' r='28'/%3E%3Ccircle cx='28' cy='28' r='28'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
}
.footer-jali { position: absolute; top: 0; left: 0; right: 0; height: 100%; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23C9A766' stroke-width='1'%3E%3Ccircle cx='0' cy='0' r='28'/%3E%3Ccircle cx='56' cy='0' r='28'/%3E%3Ccircle cx='0' cy='56' r='28'/%3E%3Ccircle cx='56' cy='56' r='28'/%3E%3Ccircle cx='28' cy='28' r='28'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px; pointer-events: none; }
.ph img { transition: transform 0.7s var(--ease), filter 0.5s var(--ease); }
.card:hover .ph img, article:hover .ph img, a:hover .ph img, [style*="cursor: pointer"]:hover > .ph img { transform: scale(1.04); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.95em 1.7em;
  border-radius: 100px;
  transition: all 0.4s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: transform 0.4s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--gold-deep); }

.btn-gold { background: var(--gold); color: var(--paper); }
.btn-gold:hover { background: var(--gold-deep); }

.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--gold); color: var(--paper); }

.btn-text {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding-bottom: 3px; border-bottom: 1px solid var(--line);
  transition: border-color 0.35s var(--ease), gap 0.35s var(--ease);
}
.btn-text:hover { border-color: var(--gold); gap: 0.85em; }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 25% 15%, rgba(169,132,79,0.16), transparent 55%),
    linear-gradient(150deg, var(--beige), var(--beige-deep));
  display: flex; align-items: flex-end;
}
.ph::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(28,26,23,0.025) 0 1px, transparent 1px 3px);
  opacity: 0.5; mix-blend-mode: multiply; pointer-events: none;
}
.ph-mark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 46px; height: 46px; opacity: 0.4;
}
.ph-label {
  position: relative; z-index: 2;
  margin: 16px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(52,40,29,0.55);
}
.ph-dark {
  background:
    radial-gradient(130% 130% at 70% 10%, rgba(169,132,79,0.28), transparent 60%),
    linear-gradient(160deg, #2a2017, #15100b);
}
.ph-dark .ph-label { color: rgba(244,239,230,0.5); }

/* ---------- Tags / pills ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.4em 0.85em; border: 1px solid var(--line); border-radius: 100px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }
.dot.live { background: #5C8A4A; box-shadow: 0 0 0 3px rgba(92,138,74,0.18); }
.dot.few  { background: #B5793A; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: 0 24px 50px -28px rgba(28,26,23,0.32); border-color: var(--line); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.5em; }
.field label { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.85em 1em; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,132,79,0.14);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(244,239,230,0.86); backdrop-filter: blur(14px); border-bottom-color: var(--line-soft); }
/* Transparent nav over the dark hero — light text */
.nav.on-dark .brand { color: var(--paper); }
.nav.on-dark .nav-link { color: rgba(244,239,230,0.82); }
.nav.on-dark .nav-link:hover, .nav.on-dark .nav-link.active { color: var(--paper); }
.nav.on-dark .menu-btn span { background: var(--paper); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.brand .amp { color: var(--gold); font-style: italic; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  font-size: 0.84rem; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-soft);
  position: relative; padding: 4px 0; transition: color 0.3s var(--ease);
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px; background: var(--gold);
  transition: width 0.35s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 1.4rem; }
.menu-btn { display: none; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; flex-direction: column; gap: 5px; padding: 8px; }
  .menu-btn span { width: 22px; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease), opacity 0.3s; }
  .menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .menu-btn.open span:nth-child(2) { opacity: 0; }
  .menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav-right .btn { display: none; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 99; background: var(--ivory);
  display: flex; flex-direction: column; justify-content: center; padding: var(--gut);
  transform: translateY(-100%); visibility: hidden;
  transition: transform 0.6s var(--ease), visibility 0.6s var(--ease);
}
.drawer.open { transform: none; visibility: visible; }
.drawer a { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; padding: 0.25em 0; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.drawer a .num { font-family: var(--sans); font-size: 0.7rem; color: var(--gold); letter-spacing: 0.1em; margin-right: 1em; vertical-align: super; }

/* ---------- Footer ---------- */
.footer { background: var(--espresso); color: var(--paper); padding: clamp(72px,9vw,120px) 0 40px; }
.footer .eyebrow { color: var(--gold); }
.footer a { color: rgba(251,249,244,0.62); font-size: 0.92rem; transition: color 0.3s var(--ease); line-height: 2.1; display: block; }
.footer a:hover { color: var(--paper); }
.footer-rule { height: 1px; background: rgba(251,249,244,0.14); margin: 56px 0 28px; }

/* ---------- Utility ---------- */
.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.flow > * + * { margin-top: 1.1em; }
.center { text-align: center; }
.maxw-prose { max-width: 60ch; }
.sticky-top { position: sticky; top: 100px; }

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 200; background: rgba(28,26,23,0.55);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; animation: fadeIn 0.4s var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
.modal {
  background: var(--ivory); border-radius: 6px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; position: relative;
  transform: translateY(16px) scale(0.98); animation: pop 0.5s var(--ease) forwards;
  box-shadow: 0 40px 100px -30px rgba(28,26,23,0.6);
}
@keyframes pop { to { transform: none; } }
.modal-x { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); transition: all 0.3s var(--ease); z-index: 3; }
.modal-x:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Marquee ---------- */
.marquee { display: inline-flex; animation: scroll 38s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }

/* ---------- Hero entrance ---------- */
.hero-fade { opacity: 0; transform: translateY(28px); animation: heroUp 1.1s var(--ease) forwards; }
.hero-fade[data-s="1"] { animation-delay: 0.12s; }
.hero-fade[data-s="2"] { animation-delay: 0.26s; }
.hero-fade[data-s="3"] { animation-delay: 0.4s; }
@keyframes heroUp { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-fade { opacity: 1; transform: none; animation: none; } }

/* ---------- Page transition ---------- */
.page-enter { animation: pageIn 0.6s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-enter { animation: none; } }

/* ---------- Image hover ---------- */
.poet-img { transition: filter 0.5s var(--ease), transform 0.6s var(--ease); }
*:hover > .poet-img, a:hover .poet-img, article:hover .poet-img { filter: brightness(1.04) saturate(1.05); }
details summary::-webkit-details-marker { display: none; }
details[open] summary span { transform: rotate(45deg); display: inline-block; transition: transform 0.3s var(--ease); }
details summary span { transition: transform 0.3s var(--ease); display: inline-block; }
.news-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,132,79,0.14); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 36px !important; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-inner { height: 64px; }
  /* collapse any inline 2-column layout to a single column on mobile */
  [style*="1fr 1fr"],
  [style*="1.1fr 1fr"], [style*="1fr 1.1fr"],
  [style*="1.2fr 1fr"], [style*="1fr 1.2fr"],
  [style*="1.4fr 1fr"], [style*="1.6fr 1fr"],
  [style*="160px 1fr"] { grid-template-columns: 1fr !important; }
  .sticky-top { position: static !important; }
}
@media (max-width: 620px) {
  .grid[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
}
