/**
 * Base Reset & Global Element Styles — indranil-theme
 *
 * Modern CSS reset and sensible defaults for all HTML elements. Depends on
 * variables.css for design tokens (colors, typography, spacing). This file
 * should be enqueued immediately after variables.css in the stylesheet order.
 *
 * Sections:
 *   1. Box Model Reset
 *   2. Document
 *   3. Typography (Headings & Paragraphs)
 *   4. Links
 *   5. Images
 *   6. Lists
 *   7. Blockquotes
 *   8. Code
 *   9. Horizontal Rule
 *  10. Selection
 *  11. Focus
 *  12. Screen Reader Utility
 */


/* ----------------------------------------
 * 1. Box Model Reset
 * ---------------------------------------- */

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


/* ----------------------------------------
 * 2. Document
 * ---------------------------------------- */

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

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-regular);
	line-height: var(--leading-relaxed);
	color: var(--color-black);
	background-color: var(--color-gray-50);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}


/* ----------------------------------------
 * 3. Typography (Headings & Paragraphs)
 * ---------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	font-weight: var(--weight-bold);
	color: var(--color-black);
	margin-top: 0;
	margin-bottom: var(--space-lg);
}

h1 {
	font-size: var(--text-5xl);
	line-height: var(--leading-tighter);
	letter-spacing: -0.03em;
}

h2 {
	font-size: var(--text-4xl);
	line-height: var(--leading-tight);
	letter-spacing: -0.02em;
}

h3 {
	font-size: var(--text-3xl);
	line-height: var(--leading-normal);
	font-weight: var(--weight-semibold);
	letter-spacing: -0.01em;
}

h4 {
	font-size: var(--text-2xl);
	line-height: var(--leading-normal);
	font-weight: var(--weight-semibold);
}

h5 {
	font-size: var(--text-xl);
	line-height: 1.4;
	font-weight: var(--weight-semibold);
	letter-spacing: 0.01em;
}

h6 {
	font-size: var(--text-lg);
	line-height: 1.4;
	font-weight: var(--weight-semibold);
}

p {
	margin-top: 0;
	margin-bottom: 1.5em;
}


/* ----------------------------------------
 * 4. Links
 * ---------------------------------------- */

a {
	color: var(--color-gray-700);
	text-decoration: underline;
	text-decoration-color: var(--color-yellow);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
	color: var(--color-black);
	text-decoration-color: var(--color-yellow-hover);
}

a:focus-visible {
	outline: 2px solid var(--color-yellow);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}


/* ----------------------------------------
 * 5. Images
 * ---------------------------------------- */

img {
	max-width: 100%;
	height: auto;
	display: block;
}


/* ----------------------------------------
 * 6. Lists
 * ---------------------------------------- */

ul,
ol {
	margin-top: 0;
	margin-bottom: 1.5em;
	padding-left: var(--space-lg);
}

li {
	margin-bottom: var(--space-xs);
}


/* ----------------------------------------
 * 7. Blockquotes
 * ---------------------------------------- */

blockquote {
	margin: var(--space-lg) 0;
	padding: var(--space-md) var(--space-lg);
	border-left: 4px solid var(--color-yellow);
	background: var(--color-gray-50);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

blockquote p:last-child {
	margin-bottom: 0;
}


/* ----------------------------------------
 * 8. Code
 * ---------------------------------------- */

code {
	font-family: var(--font-mono);
	font-size: 0.875em;
	background: var(--color-gray-50);
	padding: 2px 6px;
	border-radius: var(--radius-sm);
}

pre {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	background: var(--color-gray-50);
	padding: var(--space-md);
	border-radius: var(--radius-md);
	overflow-x: auto;
	margin: var(--space-lg) 0;
}

pre code {
	background: none;
	padding: 0;
}


/* ----------------------------------------
 * 9. Horizontal Rule
 * ---------------------------------------- */

hr {
	border: none;
	border-top: 1px solid var(--color-gray-200);
	margin: var(--space-2xl) 0;
}


/* ----------------------------------------
 * 10. Selection
 * ---------------------------------------- */

::selection {
	background: var(--color-yellow);
	color: var(--color-black);
}


/* ----------------------------------------
 * 11. Focus
 * ---------------------------------------- */

:focus-visible {
	outline: 2px solid var(--color-yellow);
	outline-offset: 2px;
}


/* ----------------------------------------
 * 12. Screen Reader Utility
 * ---------------------------------------- */

.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;
}


/* ----------------------------------------
 * 13. Scroll Reveal Animations
 * ---------------------------------------- */

/*
 * Progressive enhancement: .will-animate is added by main.js only
 * to below-the-fold elements. Without JS, nothing is hidden.
 * Respects prefers-reduced-motion at both JS and CSS levels.
 */

.will-animate {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.will-animate.is-visible {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.will-animate {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
