/* Analyticeeswarar v0.1 — one stylesheet, system fonts only, no external dependencies. */

:root {
  --paper: #fbf8f2;
  --ink: #2b2420;
  --muted: #6e625a;
  --maroon: #6b2a1a;
  --saffron: #c26a1b;
  --line: #e4dccf;
  --max: 42rem;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Nirmala UI", "Latha", "Noto Serif Tamil", serif;
  line-height: 1.65;
}

[lang="ta"] {
  font-family: "Nirmala UI", "Latha", "Noto Sans Tamil", "Noto Serif Tamil", sans-serif;
}

header.site {
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
}

header.site .name {
  display: block;
  color: var(--maroon);
  text-decoration: none;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

header.site .name span { display: block; font-size: 0.85rem; color: var(--muted); }

nav { margin-top: 0.5rem; font-size: 0.9rem; }
nav a { color: var(--ink); margin-right: 1rem; text-decoration: none; border-bottom: 1px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--saffron); }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1, h2, h3 { color: var(--maroon); font-weight: normal; line-height: 1.3; }
h1 { font-size: 1.8rem; margin-top: 0; }
h2 { font-size: 1.3rem; margin-top: 2.2rem; }
h3 { font-size: 1.05rem; margin-top: 1.6rem; }

a { color: var(--maroon); }

.lead { font-size: 1.1rem; }

.notice {
  border-left: 3px solid var(--saffron);
  padding: 0.5rem 1rem;
  background: #f6efe3;
  margin: 1.5rem 0;
}

.lingam { display: block; margin: 2rem auto; width: 11rem; height: auto; }

.verse {
  text-align: center;
  margin: 2rem 0;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.breaks {
  border: 1px dashed var(--muted);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.breaks strong { color: var(--muted); }

.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 1rem 0; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 0.4rem 0.5rem; vertical-align: top; }
th { color: var(--muted); font-weight: normal; }

code { font-size: 0.88em; background: #f1ebe0; padding: 0 0.25em; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 1rem 1.25rem 2rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

@media print {
  nav, footer.site { display: none; }
  body { background: white; }
}

header.site .tagline {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

.hash {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--muted);
}
.hash.big { font-size: 0.95rem; color: var(--maroon); }

.moment {
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0.5rem;
  margin: 1.5rem 0;
}

.moment-small {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0;
}

button {
  font: inherit;
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--maroon);
  border: 1px solid var(--maroon);
  padding: 0.35rem 0.8rem;
  margin: 0.25rem;
  cursor: pointer;
}
button:hover { background: #f6efe3; }

#archive td:nth-child(2), #archive td:first-child { white-space: nowrap; }

.lingam-render {
  display: block;
  width: min(100%, 26rem);
  height: auto;
  margin: 2rem auto 0.6rem;
  border-radius: 6px;
}

model-viewer {
  display: block;
  width: 100%;
  height: 28rem;
  margin: 2rem 0 0.6rem;
  background: #060504;
  border-radius: 6px;
  --poster-color: #060504;
}

.caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 auto 1.5rem;
  max-width: 30rem;
}

/* Pooja */
canvas.lingam-render { aspect-ratio: 1 / 1; background: #1a1410; touch-action: pan-y; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none; }
.offerings { display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; margin: 0.6rem auto 0.3rem; max-width: 34rem; }
.offerings[hidden] { display: none; }
.offerings button { margin: 0; }
.offerings button[aria-pressed="true"] { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.offerings { flex-direction: column; align-items: center; }
.offerings .pour-name { margin: 0 0 0.35rem; font-weight: 600; text-align: center; }
.offerings .pour-row { display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; }
.offerings button[hidden] { display: none; }
.offerings button:disabled { opacity: 0.45; }
.offerings #pour { border-style: dashed; }
.faces { display: block; width: min(100%, 15rem); margin: 0.5rem auto 1rem; }
.face { fill: #1a1512; stroke: #6b5a3c; stroke-width: 0.8; transition: fill 0.8s ease; }
.face.now { fill: #6b4a1a; }
.face.lit { fill: #c79a45; }
.face-label { font: 9px Consolas, "Courier New", monospace; fill: #b8a888; text-anchor: middle; pointer-events: none; }
.faces-centre { font: 13px Georgia, serif; fill: var(--muted); text-anchor: middle; }
.step { text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0.5rem; margin: 1rem 0; }
.step-en { font-size: 1.1rem; margin: 0.4rem 0; }
.step-ta { color: var(--muted); margin: 0.2rem 0 0.8rem; }
.chant { margin: 0.5rem 0 1rem; }
#chant-n { font-size: 1.2rem; color: var(--maroon); margin: 0 0.3rem; }
.face-label.on { fill: #3a2810; }

/* Turning the Lingam */
.turn { text-align: center; margin: 0 0 1.5rem; }
.turn button { min-width: 3rem; }
#face-label { display: inline-block; min-width: 16rem; }
.stone-key { font-family: Consolas, "Courier New", monospace; font-size: 1rem; line-height: 1.9; }
.key-part { padding: 0.1rem 0.35rem; margin: 0 0.15rem; color: var(--muted); cursor: pointer; border-radius: 3px; }
.key-part.current { color: #fff; background: var(--maroon); }
