@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('static/font/AtkinsonHyperlegible-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('static/font/AtkinsonHyperlegible-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('static/font/AtkinsonHyperlegible-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('static/font/AtkinsonHyperlegible-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

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

:root[data-theme="light"] {
    --bg: #FDFBF7;
    --fg: #111111;
    --fg-muted: #555555;
    --border: #111111;
    --border-light: #C9C2B8;
}

:root[data-theme="dark"] {
    --bg: #2F2E2C;
    --fg: #FFFFFF;
    --fg-muted: #AAAAAA;
    --border: #FFFFFF;
    --border-light: #625E58;
}

body {
    font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.65;
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    transition: background 0.3s ease, color 0.3s ease;
}

button, input, textarea, select {
    font-family: inherit;
}

a {
    color: var(--fg);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--fg);
}

h1 {
    font-size: 2.2rem;
    letter-spacing: .05em;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.4rem;
    padding-bottom: .4rem;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    border-bottom: 2px solid var(--border);
}

h3 {
    font-size: 1.1rem;
}

p {
    margin-bottom: .75rem;
}

.muted, small {
    color: var(--fg-muted);
    font-size: .9rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 3rem 0;
}

ul {
    list-style: outside;
    padding-left: 1.5rem;
}

li {
    margin-bottom: .5rem;
}

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

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

nav .nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav .nav-left img {
    width: 36px;
    height: 36px;
    border-radius: 0;
}

nav .nav-left span {
    font-weight: 600;
    letter-spacing: .08em;
}

nav .nav-links {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

nav .nav-links a {
    font-size: .9rem;
    letter-spacing: .02em;
    font-weight: 500;
    text-decoration: none;
}

nav .nav-links a:hover {
    text-decoration: underline;
}

#theme-toggle {
    color: var(--fg);
    border: 1px solid var(--border);
    padding: .35rem .75rem;
    font-size: .8rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    letter-spacing: .05em;
    border-radius: 4px;
    transition: background .2s, color .2s;
}

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

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    z-index: 20;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--fg);
    transition: transform .3s, opacity .3s;
}

.nav-toggle.open span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero Section */
.hero {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.hero-text {
    flex: 1;
}

.hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.hero-links {
    display: flex;
    margin-top: 1.25rem;
    gap: 1.25rem;
    font-size: .95rem;
}

/* Experience Section - Left Aligned Free-Floating Timeline */
.timeline-wrapper {
    position: relative;
    margin: 2rem 0 2.5rem;
    padding-left: 2rem;
}

.timeline-wrapper::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 5px;
    width: 2px;
    background: var(--border);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

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

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--fg);
    border-radius: 50%;
    z-index: 2;
}

.timeline-content {
    /* Free-floating: no card border, no background */
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.timeline-date {
    background: var(--fg);
    color: var(--bg);
    padding: 4px 10px;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: .02em;
    white-space: nowrap;
}

.exp-title-row {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.exp-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 2px;
}

.exp-title-row h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.exp-title-row .company {
    color: var(--fg-muted);
    font-size: .88rem;
    margin-top: .15rem;
}

.exp-projects {
    margin-top: .75rem;
}

.exp-projects .exp-proj {
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.exp-projects .exp-proj:first-child {
    border-top: none;
    padding-top: 0;
}

.exp-projects .exp-proj-head {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .5rem;
}

.exp-projects .exp-proj p {
    font-size: .92rem;
    line-height: 1.6;
    margin-bottom: .75rem;
}

.highlights {
    list-style: none;
    padding: 0;
    font-size: .88rem;
    color: var(--fg-muted);
}

.highlights li::before {
    content: "• ";
}

/* Standalone Experience Items */
.standalone-exp-list {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.standalone-exp-list .exp-item {
    padding-left: 2rem;
    border-left: 2px solid var(--border-light);
    margin-bottom: 0;
}

.standalone-exp-list .exp-item .exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .75rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.standalone-exp-list .exp-item .date {
    font-size: .85rem;
    font-weight: 500;
    color: var(--fg-muted);
    white-space: nowrap;
}

/* Skills Section */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.skills-grid img {
    height: 28px;
    width: auto;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    background: var(--bg);
}

.project img {
    border: none;
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.project-header img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 1px;
}

.project-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.project-category {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--fg-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 2px;
}

.project-value-prop {
    font-size: .92rem;
    font-weight: 500;
    color: var(--fg);
    line-height: 1.55;
    margin: 0;
}

.screenshots-container {
    position: relative;
    width: 100%;
    display: block;
    margin: .25rem 0;
}

.screenshot-item:first-child {
    width: 100%;
    position: relative;
}

.screenshot-item:first-child img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.screenshot-item:nth-child(2) {
    position: absolute;
    right: 3%;
    bottom: 0;
    height: 90%;
    z-index: 2;
    display: flex;
    align-items: flex-end;
}

.screenshot-item:nth-child(2) img {
    height: 100%;
    width: auto;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(-4px 4px 10px rgba(0, 0, 0, 0.35));
}

.screenshot-label {
    display: none;
}

.project-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-top: .15rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .42rem .95rem;
    font-size: .82rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    letter-spacing: .02em;
    font-family: inherit;
    transition: background .2s, color .2s, border-color .2s;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    border: 1px solid var(--fg);
}

.btn-primary:hover {
    opacity: .88;
}

.btn-secondary {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.project-metrics {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    align-items: center;
}

.metric-tag {
    background: var(--border-light);
    color: var(--fg);
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 4px;
    letter-spacing: .02em;
}

.project-tech-stack {
    font-size: .8rem;
    color: var(--fg-muted);
    font-weight: 500;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid var(--border-light);
}

.tech-list {
    display: flex;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
    margin-bottom: .75rem;
}

.tech-list li {
    margin: 0;
}

.tech-list img {
    height: 20px;
    width: auto;
}

/* Contact & Footer */
.contact-info {
    font-size: 1rem;
    margin-top: 1rem;
}

.contact-info a {
    margin-right: 2rem;
}

footer {
    border-top: 1px solid var(--border-light);
    margin-top: 3rem;
    padding-top: 1.25rem;
    font-size: .85rem;
    text-align: center;
    color: var(--fg-muted);
}

/* Responsive Rules */
@media (max-width: 768px) {
    body {
        padding: 2rem 1.25rem;
    }

    .hero {
        gap: 1.75rem;
    }

    .hero-avatar {
        width: 110px;
        height: 110px;
    }

    h1 {
        font-size: 1.85rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project {
        padding: 1.25rem;
    }

    .contact-info {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    .contact-info a {
        margin-right: 0;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

    section {
        margin-bottom: 1rem;
    }

    .nav-toggle, nav .nav-links.open {
        display: flex;
    }

    nav {
        position: relative;
    }

    nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding-top: 1rem;
        order: 3;
    }

    nav .nav-links a, nav .nav-links button {
        padding: .6rem 0;
        font-size: .95rem;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border-light);
    }

    nav .nav-links a:last-of-type {
        border-bottom: none;
    }

    #theme-toggle {
        margin-top: .5rem;
        width: max-content;
    }

    .hero {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .hero-avatar {
        width: 110px;
        height: 110px;
    }

    .hero-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project {
        padding: 1.15rem;
    }

    .project-header h3 {
        font-size: 1.05rem;
    }

    .timeline-wrapper {
        padding-left: 1.5rem;
    }

    .timeline-dot {
        left: -1.5rem;
    }

    .standalone-exp-list .exp-item {
        padding-left: 1.25rem;
    }

    .exp-title-row .exp-logo {
        width: 40px;
        height: 40px;
    }

    .contact-info {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    .contact-info a {
        margin-right: 0;
    }

    hr {
        margin: 2rem 0;
    }
}
