/* ==========================================================================
   Paattezhuthu — The Malayalam Lyricists Ranking
   Static site. No build step, no dependencies.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* dark is the default look */
  --bg:        #0e0c11;
  --bg-2:      #14111a;
  --surface:   #191521;
  --surface-2: #201b2b;
  --line:      rgba(255, 240, 220, 0.10);
  --line-2:    rgba(255, 240, 220, 0.18);
  --text:      #f4ede4;
  --text-2:    #cdc3bd;
  --muted:     #9a8fa0;
  --gold:      #e7b667;
  --gold-2:    #f0d3a0;
  --gold-deep: #b07f34;
  --teal:      #63c7b4;
  --rose:      #e08897;
  --shadow:    0 18px 50px -22px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 1);

  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ml:    "Noto Sans Malayalam", "Manjari", "Rachana", sans-serif;

  --wrap: 1120px;
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #faf5ee;
  --bg-2:      #f3ebe0;
  --surface:   #ffffff;
  --surface-2: #f8f2e9;
  --line:      rgba(40, 22, 10, 0.12);
  --line-2:    rgba(40, 22, 10, 0.22);
  --text:      #1d1620;
  --text-2:    #453a48;
  --muted:     #6f6374;
  --gold:      #9a6a16;
  --gold-2:    #7d5410;
  --gold-deep: #cb9a4a;
  --teal:      #1a7a6a;
  --rose:      #b04f61;
  --shadow:    0 14px 40px -22px rgba(60, 40, 20, 0.45);
  --shadow-lg: 0 36px 80px -44px rgba(60, 40, 20, 0.5);

  color-scheme: light;
}

/* --- Reset -------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
p  { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
a  { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

[lang="ml"] { font-family: var(--ml); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: #14100c; padding: 10px 16px; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

/* Warm film grain over the whole page. */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.32; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { opacity: 0.18; mix-blend-mode: multiply; }

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark { color: var(--gold); width: 27px; height: 27px; display: block; flex: none; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-text b {
  font-family: var(--serif); font-size: 17px; font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-text i {
  font-family: var(--ml); font-style: normal; font-size: 10.5px;
  color: var(--muted); letter-spacing: 0.02em;
}

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--text-2);
  padding: 4px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.site-nav a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.theme-toggle {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: transparent; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.theme-icon { grid-area: 1 / 1; font-size: 15px; line-height: 1; color: var(--gold); transition: opacity .2s, transform .3s; }
.theme-icon.sun { opacity: 0; transform: rotate(-45deg) scale(.6); }
[data-theme="light"] .theme-icon.sun  { opacity: 1; transform: none; }
[data-theme="light"] .theme-icon.moon { opacity: 0; transform: rotate(45deg) scale(.6); }

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding: clamp(56px, 10vw, 108px) 0 clamp(44px, 7vw, 76px);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; z-index: -1;
  width: 780px; height: 780px; top: -420px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent) 0%, transparent 66%);
  pointer-events: none;
}

.kicker {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 20px;
}
.kicker::before {
  content: ""; display: inline-block; width: 26px; height: 1px;
  background: var(--gold); vertical-align: middle; margin-right: 12px; opacity: .7;
}

.hero-title {
  font-size: clamp(46px, 11vw, 104px);
  font-weight: 800; letter-spacing: -0.035em; line-height: 0.95;
  margin-bottom: 26px;
}
.hero-title em {
  font-style: italic; font-weight: 400;
  background: linear-gradient(96deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-sub {
  max-width: 60ch; font-size: clamp(16px, 2.1vw, 19px); color: var(--text-2);
  line-height: 1.68;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 36px 0 26px;
}
.stat {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 22px 12px; background: var(--surface);
  min-width: 138px;
}
.stat b {
  display: block; font-family: var(--serif); font-size: 30px; font-weight: 600;
  line-height: 1; color: var(--gold); letter-spacing: -0.02em;
}
.stat b .dash { opacity: .5; }
.stat span { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.hero-note {
  max-width: 56ch; font-size: 14px; color: var(--muted);
  border-left: 2px solid var(--line-2); padding-left: 16px; margin: 0;
}
.hero-note a { color: var(--gold); text-underline-offset: 3px; }

/* --- Section furniture -------------------------------------------------- */

section { padding-block: clamp(44px, 7vw, 82px); }
.podium-section { padding-top: clamp(20px, 4vw, 40px); }

.section-h {
  font-size: clamp(26px, 4.4vw, 40px); font-weight: 600;
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px;
}
.h-rule {
  width: 34px; height: 2px; flex: none; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.section-lede { max-width: 62ch; color: var(--muted); font-size: 15.5px; margin-bottom: 34px; }

/* --- Podium ------------------------------------------------------------- */

.podium {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}

.pod {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 55%);
  padding: 24px 21px 22px; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s;
}
.pod:hover { transform: translateY(-5px); border-color: var(--line-2); }
.pod::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -20%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 60%);
}
.pod-1 { border-color: color-mix(in srgb, var(--gold) 38%, var(--line)); box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--gold) 14%, transparent); }

.pod-rank {
  font-family: var(--serif); font-size: 62px; font-weight: 800; line-height: .8;
  letter-spacing: -0.05em; color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--gold) 60%, transparent);
  margin-bottom: 14px;
}
.pod-1 .pod-rank { color: var(--gold); -webkit-text-stroke: 0; }

.pod-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 2px; }
.pod-ml   { font-family: var(--ml); font-size: 14px; color: var(--gold); margin-bottom: 12px; }
.pod-years { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.pod-line { font-size: 14.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }
.pod-score {
  display: flex; align-items: baseline; gap: 7px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.pod-score b { font-family: var(--serif); font-size: 27px; font-weight: 600; color: var(--gold); line-height: 1; }
.pod-score span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* --- Controls ----------------------------------------------------------- */

.controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
  position: sticky; top: 62px; z-index: 30;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.search-control { position: relative; flex: 1 1 260px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
#search {
  width: 100%; padding: 10px 12px 10px 37px; font-size: 14.5px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text);
}
#search::placeholder { color: var(--muted); }
#search:focus { border-color: var(--gold); outline: none; }
#search::-webkit-search-cancel-button { filter: grayscale(1) opacity(.6); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text-2); transition: all .2s; white-space: nowrap;
}
.chip small { opacity: .6; font-size: 11px; margin-left: 5px; }
.chip:hover { border-color: var(--gold); color: var(--text); }
.chip.is-on {
  background: var(--gold); border-color: var(--gold);
  color: #150f08; font-weight: 600;
}
.chip.is-on small { opacity: .7; }

.sort-control { display: flex; align-items: center; gap: 9px; }
.sort-control label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#sort {
  padding: 9px 12px; font-size: 13.5px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line); cursor: pointer;
}

.result-count { font-size: 13px; color: var(--muted); margin: 14px 0 18px; }
.result-count b { color: var(--gold); font-weight: 600; }

/* --- Ranked list -------------------------------------------------------- */

.list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.entry {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  opacity: 0; transform: translateY(14px);
}
.entry.is-in { opacity: 1; transform: none; }
.entry:hover { border-color: var(--line-2); }
.entry.is-open { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); box-shadow: var(--shadow); }

.entry-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto auto;
  align-items: center; gap: 18px;
  width: 100%; text-align: left; padding: 18px 20px;
  background: transparent; border: 0; cursor: pointer;
}

.e-rank {
  font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; color: var(--muted);
  text-align: center; font-variant-numeric: tabular-nums;
  transition: color .25s;
}
.entry.is-open .e-rank, .entry:hover .e-rank { color: var(--gold); }
.e-rank.top { color: var(--gold); }

.e-id { min-width: 0; }
.e-name {
  font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.015em;
  line-height: 1.2; margin-bottom: 3px;
}
.e-name .e-ml { font-family: var(--ml); font-size: 13.5px; font-weight: 400; color: var(--gold); margin-left: 9px; white-space: nowrap; }
.e-tag { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.e-era {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor;
}
.era-golden { color: var(--gold); }
.era-classic { color: var(--teal); }
.era-modern { color: var(--rose); }

.e-right { display: flex; align-items: center; gap: 14px; }
.e-score {
  font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.e-score small { font-size: 11px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.e-caret {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-2); display: grid; place-items: center;
  color: var(--muted); transition: transform .3s, color .25s, border-color .25s;
}
.e-caret svg { width: 11px; height: 11px; }
.entry.is-open .e-caret { transform: rotate(180deg); color: var(--gold); border-color: var(--gold); }

/* expanding panel */
.e-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s cubic-bezier(.3,.8,.3,1); }
.entry.is-open .e-body { grid-template-rows: 1fr; }
.e-body-inner { overflow: hidden; }
.e-body-pad { padding: 4px 20px 22px 100px; border-top: 1px solid var(--line); margin-top: 0; }

.e-blurb { font-size: 15.5px; color: var(--text-2); line-height: 1.7; max-width: 68ch; padding-top: 18px; }
.e-blurb em { color: var(--text); font-style: italic; }

.e-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; margin-top: 22px; }

.e-block h4 {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 11px;
}
.e-block + .e-block { margin-top: 22px; }

.songs { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.songs li {
  font-size: 14px; padding-left: 15px; position: relative; color: var(--text-2); line-height: 1.5;
}
.songs li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: .65;
}
.songs b { color: var(--text); font-weight: 600; }
.songs span { color: var(--muted); font-size: 13px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
}
.tag.award { border-color: color-mix(in srgb, var(--gold) 34%, transparent); color: var(--gold); }

/* score bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 78px 1fr 30px; align-items: center; gap: 11px; }
.bar-row .lbl { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bar-track { height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.bar-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width .7s cubic-bezier(.2,.8,.2,1);
}
.bar-row .val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }

.empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 15px; }

/* --- Method ------------------------------------------------------------- */

.method-section { background: var(--bg-2); border-block: 1px solid var(--line); }

.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.crit {
  border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px;
  background: var(--surface); position: relative; overflow: hidden;
}
.crit-weight {
  font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--gold);
  line-height: 1; letter-spacing: -0.03em; margin-bottom: 10px;
}
.crit h3 { font-family: var(--sans); font-size: 14.5px; font-weight: 600; margin-bottom: 7px; letter-spacing: 0; }
.crit p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }

.method-notes { margin-top: 40px; max-width: 76ch; }
.method-notes h3 { font-size: 19px; margin-bottom: 16px; }
.method-notes h3 em { font-style: italic; color: var(--gold); }
.method-notes ul { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.method-notes li {
  font-size: 14.5px; color: var(--muted); line-height: 1.65;
  padding-left: 18px; border-left: 2px solid var(--line-2);
}
.method-notes b { color: var(--text-2); font-weight: 600; }

/* --- Mentions ----------------------------------------------------------- */

.mentions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.mention {
  border: 1px solid var(--line); border-radius: var(--r); padding: 19px 18px;
  background: var(--surface);
}
.mention b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.mention .m-ml { font-family: var(--ml); font-size: 12.5px; color: var(--gold); display: block; margin-bottom: 9px; }
.mention p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }

/* --- CTA + footer ------------------------------------------------------- */

.cta-section { padding-bottom: clamp(60px, 9vw, 96px); }
.cta {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  padding: clamp(30px, 5vw, 48px); text-align: center;
  box-shadow: var(--shadow);
}
.cta h2 { font-size: clamp(24px, 3.6vw, 34px); margin-bottom: 14px; }
.cta p { max-width: 56ch; margin-inline: auto; color: var(--muted); font-size: 15.5px; margin-bottom: 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 42px; }
.footer-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.footer-brand b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.footer-brand span { font-family: var(--ml); font-size: 12.5px; color: var(--gold); }
.footer-note { font-size: 12.5px; color: var(--muted); line-height: 1.65; max-width: 78ch; }
.footer-meta { font-size: 12px; color: var(--muted); margin: 0; opacity: .75; }

.noscript {
  padding: 24px; margin: 24px auto; max-width: 620px; text-align: center;
  border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text-2);
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1040px) {
  .podium { grid-template-columns: repeat(2, 1fr); }
  .pod-name { font-size: 24px; }
}

@media (max-width: 900px) {
  .e-cols { grid-template-columns: 1fr; gap: 24px; }
  .e-body-pad { padding-left: 20px; }
}

@media (max-width: 760px) {
  .podium { grid-template-columns: 1fr; }
  .pod-name { font-size: 23px; }
  .site-nav { display: none; }
  .controls { position: static; }
  .entry-head { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 15px 15px; }
  .e-rank { font-size: 25px; }
  .e-era { display: none; }
  .e-name { font-size: 17.5px; }
  .e-name .e-ml { display: block; margin-left: 0; margin-top: 2px; }
  .e-score { font-size: 19px; }
  .e-caret { display: none; }
  .hero-stats .stat { flex: 1 1 44%; min-width: 0; padding: 12px 16px 10px; }
  .stat b { font-size: 24px; }
  .bar-row { grid-template-columns: 66px 1fr 28px; }
}

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

@media print {
  .site-header, .controls, .theme-toggle, .grain, .cta-section { display: none !important; }
  .e-body { grid-template-rows: 1fr !important; }
  body { background: #fff; color: #000; }
}
