/* =========================================================
   Nathan Umusig — Portfolio
   Editorial / restrained / print-friendly
   ========================================================= */

:root {
    /* Paper & ink — light mode */
    --bg:         #fbfaf6;
    --surface:    #ffffff;
    --ink:        #18171a;
    --ink-soft:   #3a3a3f;
    --muted:      #76747a;
    --rule:       #e3e0d7;
    --rule-soft:  #eeeae0;
    --accent:     #5a3b1e;   /* burnt walnut, used sparingly */
    --accent-hover: #c9a227; /* gold for hover */
    --highlight:  #f0ebde;

    /* Type */
    --f-serif:  "IBM Plex Serif", ui-serif, Georgia, serif;
    --f-sans:   "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --f-mono:   "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Layout */
    --col:      960px;
    --gutter:   6rem;
    --gutter-tablet: 3rem;
    --gutter-mobile: 1.5rem;
    --label:    180px;
}

[data-theme="dark"] {
    --bg:         #111113;
    --surface:    #17171a;
    --ink:        #eceae4;
    --ink-soft:   #c6c3bd;
    --muted:      #807d77;
    --rule:       #2a2a2e;
    --rule-soft:  #202024;
    --accent:     #d4a574;
    --accent-hover: #f0c970; /* gold for hover */
    --highlight:  #1d1d20;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 16px;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-feature-settings: "kern", "liga", "calt";
}

/* Subtle paper grain in light mode only */
body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(circle at 20% 15%, rgba(0,0,0,0.012) 0, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(0,0,0,0.015) 0, transparent 50%);
}
[data-theme="dark"] body::before { display: none; }

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: var(--ink); }

p { margin: 0 0 1rem 0; color: var(--ink-soft); }

/* ---------- Container ---------- */
.container {
    max-width: calc(var(--col) + var(--label) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 5rem var(--gutter) 4rem;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--muted);
    padding: 0.4rem 0.8rem;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    z-index: 100;
}
.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}
.theme-toggle::before {
    content: "$ ";
    opacity: 0.5;
}

/* ---------- Masthead / Hero ---------- */
.masthead {
    padding: 3rem;
    margin-bottom: 3rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 8px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
}
.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3a9b50;
    box-shadow: 0 0 0 3px rgba(58, 155, 80, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(58, 155, 80, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(58, 155, 80, 0.05); }
}

h1 {
    font-family: var(--f-serif);
    font-weight: 500;
    font-size: clamp(2.4rem, 5.5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem 0;
    color: var(--ink);
}

.role {
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--muted);
    margin: 0 0 2rem 0;
    font-weight: 400;
}

.contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.82rem;
}
.contact a {
    color: var(--ink-soft);
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.contact a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}
.contact .sep { color: var(--muted); opacity: 0.5; }

/* Copy button */
.copy-btn {
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--muted);
    font-family: var(--f-mono);
    font-size: 0.68rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
}
.copy-btn:hover {
    color: var(--ink);
    border-color: var(--ink);
}
.copy-btn.copied {
    color: #3a9b50;
    border-color: #3a9b50;
}

/* ---------- Sections ---------- */
.section {
    display: grid;
    grid-template-columns: var(--label) 1fr;
    gap: 2.5rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--rule-soft);
}
.section:last-of-type { border-bottom: none; }

.section-label {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 0.3rem;
    position: sticky;
    top: 2rem;
    align-self: start;
    height: fit-content;
}

.section-body > :first-child { margin-top: 0; }
.section-body > :last-child  { margin-bottom: 0; }

.lede {
    font-family: var(--f-serif);
    font-size: 1.18rem;
    line-height: 1.55;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.005em;
}

/* ---------- Entries (Card Style) ---------- */
.entry {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: 6px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.entry:hover {
    border-color: var(--rule);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.entry:last-child { margin-bottom: 0; }
.entry.compact {
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.entry-header h3 {
    font-family: var(--f-sans);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 0.15rem 0;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.entry-sub {
    font-family: var(--f-sans);
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}
.entry.compact .entry-header { margin-bottom: 0; }

.meta {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 0.2rem;
    letter-spacing: 0.02em;
}

/* ---------- Bullets ---------- */
.bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.bullets li {
    position: relative;
    padding-left: 1.3rem;
    margin-bottom: 0.45rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}
.bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 0.6rem;
    height: 1px;
    background: var(--muted);
}

/* ---------- Link-out ---------- */
.link-out {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--f-mono);
    font-size: 0.82rem;
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 1px;
}
.link-out:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
.link-out span { transition: transform 0.2s ease; display: inline-block; }
.link-out:hover span { transform: translateX(3px); }

/* ---------- Skills (Tag/Chip Style) ---------- */
.skills {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.skill-category {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.skill-category-label {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.skill-tag {
    display: inline-block;
    background: var(--highlight);
    color: var(--ink-soft);
    font-size: 0.88rem;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    border: 1px solid var(--rule-soft);
    transition: all 0.15s ease;
}
.skill-tag:hover {
    border-color: var(--rule);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .skill-tag:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* ---------- Certifications ---------- */
.certs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.certs li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: 6px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.certs li:hover {
    border-color: var(--rule);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .certs li:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.cert-name {
    font-weight: 500;
    color: var(--ink);
    font-size: 0.95rem;
}
.cert-issuer {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--muted);
}
.footer p { margin: 0 0 0.3rem 0; color: var(--muted); }
.footer-meta { opacity: 0.75; }

/* ---------- Scroll reveal ---------- */
.section, .masthead {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.visible, .masthead.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .section, .masthead {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .eyebrow-dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root { --label: 140px; }
    .container { padding: 4rem var(--gutter-tablet) 3rem; }
    .masthead { padding: 2.5rem; }
    .section { gap: 1.75rem; }
}

@media (max-width: 720px) {
    .container { padding: 3.5rem var(--gutter-mobile) 3rem; }
    .theme-toggle { top: 1rem; right: 1rem; }

    .masthead { padding: 1.75rem; }

    .section {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 2rem 0;
    }
    .section-label {
        position: static;
        padding-top: 0;
    }

    .entry {
        padding: 1.25rem;
    }
    .entry.compact {
        padding: 1rem;
    }

    .entry-header { flex-direction: column; gap: 0.25rem; }
    .meta { padding-top: 0; }

    .contact { font-size: 0.78rem; }

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

/* ---------- Print ---------- */
@media print {
    :root {
        --bg: #ffffff;
        --ink: #000000;
        --ink-soft: #222222;
        --muted: #444444;
        --rule: #cccccc;
        --rule-soft: #dddddd;
    }
    body { font-size: 10.5pt; }
    .theme-toggle, .eyebrow, .footer-meta { display: none; }
    .container { max-width: 100%; padding: 0.5in; }
    .section { page-break-inside: avoid; padding: 1rem 0; }
    .section-label { position: static; }
    a { border-bottom: none !important; color: #000 !important; }
    .masthead, .section { opacity: 1; transform: none; }
}
