/* =================================================================
   Design tokens — DARK is the default. Add class "light-mode" to
   <body> to switch a single page view to light.
   ================================================================= */

:root {
    --ink: #ece8de;
    --ink-soft: #a9b0be;
    --paper: #14181f;
    --paper-raised: #1b2029;
    --line: #2c3340;
    --accent: #5fb3ac;
    --accent-soft: #1c2b2a;
    --gold: #dba94a;

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius: 3px;
    --content-width: 920px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
}

body.light-mode {
    --ink: #1c2430;
    --ink-soft: #4a5568;
    --paper: #f6f4ef;
    --paper-raised: #ffffff;
    --line: #d8d2c4;
    --accent: #2e6f6a;
    --accent-soft: #e4efee;
    --gold: #c9932a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.15;
    margin: 0 0 0.4em;
    color: var(--ink);
}

p {
    margin: 0 0 1em;
    max-width: 65ch;
    color: var(--ink-soft);
}

a {
    color: var(--accent);
}

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

dl, dd, ul {
    margin: 0;
    padding: 0;
}

hr {
    display: none;
}

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

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}


/* =================================================================
   Header / nav
   ================================================================= */

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1.1rem var(--gutter);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
    text-decoration: none;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    position: relative;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--ink);
    transition: transform 0.35s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(18deg);
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .navbar {
        flex-wrap: wrap;
    }
    .nav-links {
        order: 3;
        width: 100%;
        gap: 1.1rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--line);
        margin-top: 0.75rem;
    }
}


/* =================================================================
   Hero / profile (homepage)
   ================================================================= */

.hero {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) var(--gutter);
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.eyebrow::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 2px;
    background: var(--gold);
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.hero h2 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.bio {
    font-size: 1.05rem;
}

.contact-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 1rem 1.5rem;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.contact-meta dt {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-bottom: 0.15rem;
}

.contact-meta dd {
    font-size: 0.95rem;
    color: var(--ink);
    overflow-wrap: break-word;
}

.hero-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-image {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.hero-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.hero-image:hover img {
    transform: scale(1.06);
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-image {
        order: -1;
        max-width: 220px;
    }
}


/* =================================================================
   Buttons
   ================================================================= */

.pill-link {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--ink);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pill-link:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.pill-link--solid {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pill-link--solid:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(95, 179, 172, 0.35);
}


/* =================================================================
   Section shell
   ================================================================= */

.section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
    border-top: 1px solid var(--line);
}

.section-title {
    position: relative;
    font-size: 1.5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

.empty-note {
    color: var(--ink-soft);
    font-style: italic;
}


/* =================================================================
   Skills — chips
   ================================================================= */

.chip-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    padding: 0.45rem 0.95rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chip:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}


/* =================================================================
   Projects — cards
   ================================================================= */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
}

.card {
    position: relative;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.card::before,
.card::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gold);
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.card::after {
    left: auto;
    top: auto;
    right: -1px;
    bottom: -1px;
    border-left: none;
    border-top: none;
}

.card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-media img {
    transform: scale(1.05);
}

.card-body {
    padding: 1.25rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-body h3 {
    font-size: 1.15rem;
}

.card-body p {
    font-size: 0.95rem;
}

.card-tech {
    font-size: 0.82rem;
    color: var(--gold);
    margin-top: -0.4rem;
}

.card-links {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    gap: 1.25rem;
    border-top: 1px solid var(--line);
}

.card-links a {
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--ink);
    transition: color 0.2s ease;
}

.card-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* =================================================================
   Experience / education — timeline
   ================================================================= */

.timeline {
    position: relative;
    padding-left: 1.75rem;
    border-left: 2px solid var(--line);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2.28rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.4);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}

.timeline-content h4 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}

.timeline-date {
    font-size: 0.82rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}


/* =================================================================
   Resume CTA (homepage block)
   ================================================================= */

.resume-cta {
    text-align: left;
}


/* =================================================================
   About page
   ================================================================= */

.about-hero {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(1.5rem, 4vw, 3rem);
}

.about-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    margin-bottom: 0.3rem;
}

.about-hero h2 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.about-copy {
    max-width: 66ch;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.about-copy p {
    font-size: 1.03rem;
    line-height: 1.75;
    color: var(--ink-soft);
    hyphens: auto;
}

.about-copy p:first-of-type {
    font-size: 1.1rem;
    color: var(--ink);
}

.about-copy p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.6rem;
    font-weight: 600;
    line-height: 0.75;
    float: left;
    padding: 0.08em 0.1em 0 0;
    color: var(--accent);
}

.about-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}


/* =================================================================
   Contact page
   ================================================================= */

.contact-hero {
    max-width: 620px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}

.contact-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    margin-bottom: 0.6rem;
}

.contact-lead {
    font-size: 1.02rem;
    margin-bottom: 2.25rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
}

.form-row .optional {
    font-weight: 400;
    color: var(--ink-soft);
}

.form-row input,
.form-row textarea {
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--ink);
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    width: 100%;
}

.form-row textarea {
    resize: vertical;
    min-height: 8rem;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.submit-btn {
    align-self: flex-start;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.75rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}


/* =================================================================
   Resume page
   ================================================================= */

.resume-hero {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resume-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    margin-bottom: 0.6rem;
}

.resume-lead {
    font-size: 1.02rem;
    margin-bottom: 1.75rem;
}

.resume-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.resume-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-raised);
    aspect-ratio: 8.5 / 11;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.resume-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@media (max-width: 640px) {
    .resume-preview {
        aspect-ratio: 3 / 4;
    }
}


/* =================================================================
   Footer
   ================================================================= */

.site-footer {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem var(--gutter) 3rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
}