/*
 * shrishrajgupta.github.io — single stylesheet, both themes.
 * Gruvbox palette. Light is the base; dark applies via
 * prefers-color-scheme (system) or an explicit html[data-theme].
 */

@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic+Coding:wght@400;700&display=swap');

:root {
    --bg: #ffffff;
    --surface: #f9f5e7;
    --fg: #3c3836;
    --muted: #7c6f64;
    --heading: #a17218;
    --link: #427b58;
    --border: #d5c4a1;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #282828;
        --surface: #32302f;
        --fg: #ebdbb2;
        --muted: #a89984;
        --heading: #d79921;
        --link: #8ec07c;
        --border: rgba(235, 219, 178, 0.25);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #282828;
    --surface: #32302f;
    --fg: #ebdbb2;
    --muted: #a89984;
    --heading: #d79921;
    --link: #8ec07c;
    --border: rgba(235, 219, 178, 0.25);
    color-scheme: dark;
}

/* ---------- base ---------- */

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

/* SVG elements don't get the UA's [hidden] rule — cover all namespaces. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: 'Nanum Gothic Coding', 'Fira Code', 'JetBrains Mono', SFMono-Regular,
        Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fg);
    background-color: var(--bg);
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

h1,
h2,
h3 {
    color: var(--heading);
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1rem;
}

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

a:hover {
    text-decoration: underline;
}

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

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

svg.icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

section {
    margin-bottom: 3rem;
}

/* ---------- header ---------- */

.site-header {
    padding: 3rem 0 2rem;
}

.site-header .masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.summary {
    color: var(--muted);
    max-width: 65ch;
}

.resume-link {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
}

/* theme toggle */

#theme-toggle {
    font: inherit;
    color: var(--muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    white-space: nowrap;
}

#theme-toggle:hover {
    color: var(--fg);
}

/* ---------- two-column row ---------- */

.cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0 3rem;
}

/* ---------- experience ---------- */

.job {
    margin-bottom: 1.5rem;
}

.job header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.job .when {
    color: var(--muted);
    font-size: 0.9rem;
}

.job .role {
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.job ul {
    margin: 0;
    padding-left: 1.25rem;
}

.job li {
    margin-bottom: 0.35rem;
}

/* ---------- contact ---------- */

.contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

/* ---------- skills ---------- */

.skills {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.5rem;
    margin: 0;
}

.skills dt {
    color: var(--heading);
    font-weight: 700;
}

.skills dd {
    margin: 0;
}

/* ---------- cards (coding profile + projects) ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cards.narrow {
    grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
}

.card {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    padding: 1.25rem;
}

.card img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.card ul {
    margin: 0;
    padding-left: 1.25rem;
}

.card li {
    margin-bottom: 0.3rem;
}

.card .stack {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* ---------- footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 1.5rem 0 2rem;
    margin-top: 1rem;
}

.site-footer p {
    margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
    h1 {
        font-size: 1.9rem;
    }

    .site-header {
        padding-top: 2rem;
    }

    .cols {
        grid-template-columns: 1fr;
    }

    .skills {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .skills dd {
        margin-bottom: 0.75rem;
    }
}
