/* Kalyana Thittam — Base Styles, Reset & Fluid Typography */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(ellipse 85% 45% at 50% 0%, var(--tint-kumkum), transparent 72%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-med), color var(--transition-fast);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
}

h2 {
  font-size: clamp(1.25rem, 1.9vw, 1.85rem);
}

h3 {
  font-size: clamp(1.0625rem, 1.4vw, 1.35rem);
}

h4 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

.prose-limit {
  max-width: 75ch;
}

.tamil-subtitle {
  display: block;
  font-family: var(--font-tamil);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}

.tamil-inline {
  font-family: var(--font-tamil);
  font-size: 0.85em;
  color: var(--text-secondary);
  font-weight: 400;
}

[data-bilingual="false"] .tamil-subtitle,
[data-bilingual="false"] .tamil-inline {
  display: none;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.text-muted {
  color: var(--text-secondary);
}

.text-subtle {
  color: var(--text-muted);
}

.text-gold {
  color: var(--accent-gold);
}

.text-leaf {
  color: var(--accent-leaf);
}

.text-kumkum {
  color: var(--accent-kumkum);
}

.text-turmeric {
  color: var(--accent-turmeric);
}

/* Focus Visibility */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Hidden print container on screen */
#print-root {
  display: none;
}

/* Fluid & Elegant Keyframe Animations */
@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerSlideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes drawerSlideLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes lampBreathe {
  0%, 100% {
    opacity: 0.92;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.06);
  }
}

.view-enter {
  animation: viewEnter 360ms var(--ease-fluid) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
