/* 1. GOOGLE FONTS — loaded via <link> + preconnect in HTML, not @import */

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
}

:root {
    /* Layout shell */
    --content-max: 1180px;
    --content-padding-inline: clamp(16px, 4vw, 40px);
    --header-height: 72px;
    /* Blueprint grid — silver minors + warm gold majors on matte black */
    --grid-size: 40px;
    --grid-line: rgba(175, 186, 202, 0.048);
    --grid-line-major: rgba(210, 184, 152, 0.088);
    --grid-major: 200px;
    --grid-opacity: 0.82;
    /* Softer gold ↔ silver drift behind grid (pravāha / flow) */
    --grid-atmosphere: linear-gradient(
        168deg,
        rgba(207, 159, 114, 0.042) 0%,
        rgba(185, 195, 210, 0.026) 20%,
        transparent 40%,
        transparent 60%,
        rgba(175, 186, 202, 0.028) 80%,
        rgba(200, 168, 132, 0.036) 100%
    );
    /* Radial mask: strong at top-center (spotlight), soft falloff to edges */
    --grid-vignette-mask: radial-gradient(
        ellipse 118% 92% at 50% -8%,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(255, 255, 255, 0.42) 42%,
        rgba(255, 255, 255, 0.12) 68%,
        rgba(255, 255, 255, 0) 100%
    );

    /* Matte black shell — deep charcoal, not flat black */
    --bg: #09090b;
    --bg-card: #101012;
    --bg-elevated: #161618;
    /* Top-centered “spotlight” (gold + silver, very soft) */
    --bg-spotlight-gold: radial-gradient(ellipse 90% 58% at 50% -12%, rgba(207, 165, 120, 0.11) 0%, transparent 58%);
    --bg-spotlight-silver: radial-gradient(ellipse 75% 48% at 50% 2%, rgba(188, 198, 212, 0.06) 0%, transparent 52%);

    --radius-card: 14px;
    --radius-card-sm: 10px;
    /* Premium halos — pill + cards (low opacity, large blur) */
    --glow-pill:
        0 0 0 1px rgba(200, 208, 218, 0.07),
        0 0 40px -10px rgba(207, 159, 114, 0.22),
        0 0 72px -18px rgba(175, 186, 202, 0.12);
    --glow-card-idle:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 56px -28px rgba(207, 159, 114, 0.06),
        0 0 48px -24px rgba(165, 178, 195, 0.04);
    --glow-card-hover:
        0 0 72px -22px rgba(207, 159, 114, 0.18),
        0 0 56px -20px rgba(175, 188, 205, 0.1);

    /* Gold — primary accent */
    --gold-bright: #e8b896;
    --gold-mid: #cf9f72;
    --gold-dim: #7d6448;

    /* Silver — chrome, structure, secondary highlights */
    --silver-bright: #d4dae3;
    --silver-mid: #8f98a6;
    --silver-dim: #5a616c;

    /* Text */
    --text-primary: #ebe8e4;
    --text-muted: #636b76;
    --text-2: #8a9199;

    /* Legacy aliases — keep existing code working */
    --text-1: var(--text-primary);
    --text-3: var(--text-muted);
    --accent: var(--gold-mid);
    --accent-dim: rgba(207, 159, 114, 0.09);
    --accent-glow: rgba(207, 159, 114, 0.2);
    /* Silver-tinted borders on dark */
    --border: rgba(200, 208, 218, 0.09);
    --border-strong: rgba(200, 208, 218, 0.14);
    --border-muted: rgba(200, 208, 218, 0.055);
    --border-hover: rgba(207, 159, 114, 0.42);

    /* Metallic accents (progress bar, optional chrome) */
    --gradient-gold: linear-gradient(125deg, #f2dcc8 0%, #cf9f72 45%, #e8c4a8 100%);
    --gradient-silver: linear-gradient(145deg, #e8ecf2 0%, #8f98a6 50%, #c5ccd6 100%);
    --gradient-scroll-progress: linear-gradient(90deg, #6e7784 0%, #a89278 38%, #cf9f72 62%, #e8c4a8 100%);
    --chrome-divider: linear-gradient(180deg, rgba(148, 158, 172, 0) 0%, rgba(148, 158, 172, 0.5) 50%, rgba(148, 158, 172, 0) 100%);
    --noise-tile: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.032'/%3E%3C/svg%3E");

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Monaspace Argon', monospace;
    --serif: var(--font-body);
    --sans: var(--font-body);
}

[data-theme="light"] {
    --grid-size: 40px;
    --grid-line: rgba(15, 23, 42, 0.055);
    --grid-line-major: rgba(15, 23, 42, 0.09);
    --grid-major: 200px;
    --grid-opacity: 0.9;
    --bg: #FAF9F7;
    --bg-card: #FFFFFF;
    --gold-bright: #b8732e;
    --gold-mid: #b8864e;
    --gold-dim: #8a6f52;
    --text-primary: #1A1816;
    --text-muted: #8A847E;
    --text-1: var(--text-primary);
    --text-2: #5C5650;
    --text-3: var(--text-muted);
    --accent: var(--gold-mid);
    --accent-dim: rgba(184, 134, 78, 0.08);
    --accent-glow: rgba(184, 134, 78, 0.12);
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.14);
    --border-muted: rgba(15, 23, 42, 0.06);
    --border-hover: rgba(184, 134, 78, 0.32);
    --gradient-scroll-progress: linear-gradient(90deg, var(--gold-mid), var(--accent-glow));
    --chrome-divider: var(--border-strong);
    --glow-pill: 0 1px 2px rgba(15, 23, 42, 0.06);
    --glow-card-idle: none;
    --glow-card-hover: 0 12px 40px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] body {
    background-color: var(--bg);
    background-image: none;
}

*,
*::before,
*::after {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Supermemory-style type: OpenType alternates + balanced wrap (not Devanagari / mono) */
.name,
h1,
h2,
h3,
h4,
h5,
h6,
.case-study__title,
.section__label,
p,
body {
    font-feature-settings: "cv09" 1, "cv03" 1, "cv04" 1, "cv11" 1;
    text-wrap: balance;
}

.mantra-devanagari,
.tagline-devanagari {
    font-feature-settings: normal;
    text-wrap: pretty;
    margin-top: 0;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg);
    background-image:
        var(--bg-spotlight-gold),
        var(--bg-spotlight-silver),
        var(--noise-tile);
    background-repeat: no-repeat, no-repeat, repeat;
    background-size: 100% 480px, 100% 420px, 256px 256px;
    background-position: top center, top center, 0 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-optical-sizing: auto;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body p {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.65;
    color: var(--text-primary);
}

.font-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-feature-settings: "cv09" 1, "cv03" 1, "cv04" 1, "cv11" 1;
    text-wrap: balance;
}

.font-heading {
    font-family: var(--font-display);
    font-feature-settings: "cv09" 1, "cv03" 1, "cv04" 1, "cv11" 1;
    text-wrap: balance;
}

/* Headings → Space Grotesk (h2 is section labels → DM Sans below) */
.name,
h1,
h3,
h4,
h5,
h6,
.case-study__title,
.project-title,
.project-card__title,
.contact__email {
    font-family: var(--font-display);
    color: var(--text-primary);
}

.contact__email {
    color: var(--gold-bright);
    font-size: clamp(2.8rem, 6vw, 58px);
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 110%;
}

/* Body → DM Sans */
body,
p,
li,
h2,
.case-study__body,
.case-study__text,
.nav-link,
.section__label {
    font-family: var(--font-body);
}

/* Type scale — display */
.name,
h1 {
    font-size: clamp(2.8rem, 6vw, 58px);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 110%;
}

.name {
    color: var(--gold-bright);
}

h2:not(.section__label),
.case-study__title {
    font-size: clamp(1.8rem, 3.5vw, 36px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 110%;
}

h3,
h4,
h5,
h6 {
    font-size: clamp(1.2rem, 2vw, 24px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 115%;
}

.nav-link {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

h2.section__label,
.section__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.2;
}

.title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.4;
    color: var(--text-muted);
}

.status {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.tagline-devanagari {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: var(--text-primary);
}

.tagline-transliteration {
    font-size: 12px;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.06em;
    color: var(--gold-mid);
    opacity: 0.75;
}

.journal-entry__title,
.exp-card__role,
.edu-card__degree {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 24px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 115%;
}

/* Mono — tags, labels, code, roman transliteration */
.tag,
.tech-tag,
code,
pre,
.tech-stack,
.case-study__label,
.dates,
.metadata,
.stat-label,
.mantra-roman {
    font-family: var(--font-mono);
    font-feature-settings: normal;
    text-wrap: unset;
}

.tag,
.tech-tag,
.dates,
.metadata,
.stat-label {
    font-weight: 300;
}

.case-study__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

code,
pre {
    font-weight: 400;
}

.mantra-devanagari,
.tagline-devanagari {
    font-family: 'Noto Serif Devanagari', serif;
}

a {
    color: var(--gold-mid);
    text-decoration: none;
    transition: color 0.25s ease, opacity 0.25s ease;
}

a:hover {
    text-decoration: underline;
    text-decoration-color: var(--gold-dim);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

button,
.theme-toggle,
.nav-link,
.social-link,
.card,
.project-card.hero,
.project-card.standard,
.tech-tag,
.project-link,
.playground-btn,
.diagram-toggle,
.contact__email,
input,
textarea {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease,
        box-shadow 0.35s ease, opacity 0.35s ease, transform 0.35s ease, fill 0.35s ease, stroke 0.35s ease;
}

::selection {
    background: var(--gold-mid);
    color: var(--bg);
}

.wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

.section {
    margin-bottom: clamp(7rem, 11vw, 11rem);
}

/* Horizontal rules between sections (blueprint / bento-style dividers) */
main .section:not(:first-child) {
    border-top: 1px solid var(--border-strong);
    padding-top: clamp(3rem, 7vw, 5rem);
}

.card {
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-card-sm);
}

*:focus-visible {
    outline: 2px solid var(--gold-mid);
    outline-offset: 3px;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal.from-left {
    transform: translateX(-16px);
}

.reveal.scale-in {
    transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

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

.tagline {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    line-height: 1.6;
    max-width: 42rem;
    font-feature-settings: "calt" 1;
}
