/* 
  ====================================
  CSS RESET & BASE STYLES
  ====================================
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--page-bg-color);
    background-image: var(--page-bg-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-color 0.3s ease, background-image 0.3s ease, color 0.2s ease;
    color: var(--text-light);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    font-weight: var(--fw-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 20%, var(--ambient-tint), transparent 55%),
        radial-gradient(circle at 90% 80%, var(--ambient-tint), transparent 60%);
    filter: blur(var(--ambient-blur));
    transition: background 0.6s ease, filter 0.6s ease;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    margin-bottom: var(--space-md);
    color: var(--text-light);
}

h1 {
    font-size: var(--fs-5xl);
}

h2 {
    font-size: var(--fs-4xl);
}

h3 {
    font-size: var(--fs-3xl);
}

h4 {
    font-size: var(--fs-2xl);
}

h5 {
    font-size: var(--fs-xl);
}

h6 {
    font-size: var(--fs-lg);
}

/* Paragraphs */
p {
    margin-bottom: var(--space-md);
    line-height: var(--lh-normal);
    color: var(--text-light);
}

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

/* Links */
a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color var(--transition-base), text-decoration var(--transition-base);
}

a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

a:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

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

ul ul, ol ol, ul ol, ol ul {
    margin-bottom: 0;
    margin-top: var(--space-sm);
}

/* Code */
code {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-card);
    color: var(--accent-yellow);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

pre {
    background-color: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--primary-green);
}

pre code {
    background-color: transparent;
    padding: 0;
    color: var(--text-light);
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--primary-green);
    padding-left: var(--space-lg);
    margin: var(--space-md) 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
}

th, td {
    text-align: left;
    padding: var(--space-md);
    border-bottom: 1px solid var(--bg-card);
}

th {
    background-color: var(--bg-card);
    font-weight: var(--fw-semibold);
    color: var(--primary-green);
}

tr:hover {
    background-color: rgba(0, 168, 107, 0.05);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
}

/* Buttons (Default Styling) */
button, input[type="button"], input[type="submit"] {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

button:disabled, input[type="button"]:disabled, input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--bg-card);
    border-radius: var(--radius-lg);
    background-color: var(--bg-darker);
    color: var(--text-light);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

textarea {
    resize: vertical;
}

/* Selection */
::selection {
    background-color: var(--primary-green);
    color: var(--bg-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Utilities */
.container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

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

/* Global text color override */
body,
h1, h2, h3, h4, h5, h6,
p, span, li, a, strong, em, small,
label, input, textarea, select, button,
.meta-label, .meta-val, .section-num, .section-heading,
.nav-link, .top-brand, .hero-tagline, .anim-hint,
.skills-heading, .skill-name, .chip,
.footer-heading, .footer-tagline, .footer-bottom p,
.blog-meta, .reading-time, .post-meta, .back-btn {
    color: var(--text-light) !important;
}

/* Keep decorative gradient text readable in current theme */
.kage-line,
.logo-text,
.footer-logo,
.gradient-text,
.gradient-text-animated,
.section-heading .highlight,
article h1 {
    background: none !important;
    -webkit-text-fill-color: var(--text-light) !important;
    color: var(--text-light) !important;
    text-shadow: none !important;
    filter: none !important;
}
