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

:root {
    --font-body: 'Quicksand', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-head: 'Righteous', 'Quicksand', 'Segoe UI', sans-serif;

    --primary: #c2543c;
    --primary-dark: #a5422e;
    --primary-rgb: 194, 84, 60;
    --primary-soft: #f4e2d4;
    --ink: #3b2a20;
    --ink-soft: #6b5446;
    --muted: #7a5e4b;
    --accent-text: #a5422e;
    --border-strong: #9d7d5c;
    --btn-fg: #ffffff;
    --error: #b3261e;
    --focus-ring: #a5422e;
    --bg: #faf6ec;
    --bg-soft: #f1e9d8;
    --header-bg: rgba(250, 246, 236, 0.85);
    --border: #e3d6c0;
    --shadow-md: 0 8px 30px rgba(59, 42, 32, 0.10);
    --shadow-lg: 0 20px 45px rgba(59, 42, 32, 0.14);
    --radius: 16px;
    --radius-sm: 10px;
}

[data-theme="dark"] {
    --primary: #e08a4a;
    --primary-dark: #e69a5e;
    --primary-rgb: 224, 138, 74;
    --primary-soft: #4a3523;
    --ink: #f0e6d4;
    --ink-soft: #c9b79f;
    --muted: #b39a80;
    --accent-text: #e69a5e;
    --border-strong: #b39272;
    --btn-fg: #241a12;
    --error: #ff8a80;
    --focus-ring: #e69a5e;
    --bg: #2b1f16;
    --bg-soft: #23190f;
    --header-bg: rgba(43, 31, 22, 0.85);
    --border: #453524;
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.25;
    color: var(--ink);
}

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

a {
    text-decoration: none;
    color: inherit;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn-primary:focus-visible,
.nav-cta:focus-visible {
    outline-color: var(--btn-fg);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Navbar ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--ink);
}

.logo span {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink-soft);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-text);
    background: var(--primary-soft);
}

.nav-link.active {
    color: var(--accent-text);
    background: var(--primary-soft);
}

.nav-cta {
    margin-left: 8px;
    background: var(--primary);
    color: var(--btn-fg) !important;
    padding: 12px 20px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.nav-cta:hover {
    background: var(--primary-dark);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

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

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
    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 ---------- */
.hero {
    padding: 96px 0 84px;
    background:
        radial-gradient(600px 300px at 85% 0%, var(--primary-soft) 0%, transparent 70%),
        transparent;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: center;
}

.hero h1 {
    font-size: 46px;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-role {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

.hero-desc {
    color: var(--ink-soft);
    font-size: 16px;
    max-width: 540px;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 12px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--btn-fg);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.hero-avatar {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-lg);
}

.hero-avatar .frame {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-meta {
    margin-top: 40px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.hero-meta .item strong {
    display: block;
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 400;
    color: var(--primary);
}

.hero-meta .item span {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Section ---------- */
.section {
    padding: 84px 0;
}

.section-soft {
    background: var(--bg-soft);
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
}

.section-head {
    max-width: 640px;
    margin-bottom: 48px;
}

.section-head.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--accent-text);
    margin-bottom: 12px;
}

.section-head h2 {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.section-head p {
    color: var(--ink-soft);
    font-size: 15.5px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: var(--primary);
}

/* ---------- Home highlights ---------- */
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.highlight-grid .card h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.highlight-grid .card p {
    color: var(--ink-soft);
    font-size: 14.5px;
}

.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- About / profile ---------- */
.page-head {
    padding: 64px 0 8px;
}

.page-head .eyebrow {
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.page-head h1 {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin: 8px 0 6px;
}

.page-head p {
    color: var(--ink-soft);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text p {
    color: var(--ink-soft);
    font-size: 15.5px;
    margin-bottom: 16px;
}

.about-text h3 {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--accent-text);
}

.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list .label {
    min-width: 160px;
    font-weight: 700;
    color: var(--ink);
}

.info-list .value {
    color: var(--ink-soft);
}

/* ---------- Skills ---------- */
.skill-group {
    margin-bottom: 40px;
}

.skill-group > h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--muted);
    margin-bottom: 16px;
}

.skill-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags li {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

/* ---------- Projects ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.project-thumb {
    height: 170px;
    background: linear-gradient(135deg, var(--primary-soft), var(--bg-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--border);
}

.project-thumb svg {
    width: 64px;
    height: 64px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-body h3 {
    font-size: 16.5px;
    margin-bottom: 8px;
}

.project-body p {
    color: var(--ink-soft);
    font-size: 14px;
    flex: 1;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.chip {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.project-actions {
    margin-top: 16px;
    display: flex;
    gap: 14px;
}

.project-actions a {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent-text);
    display: inline-block;
    padding: 10px 8px;
}

.project-actions a:hover {
    text-decoration: underline;
}

/* ---------- Timeline ---------- */
.timeline {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--primary-soft);
    box-shadow: 0 0 0 3px var(--bg);
}

.timeline-item .period {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--accent-text);
    margin-bottom: 4px;
}

.timeline-item h3 {
    font-size: 18px;
    margin-bottom: 2px;
}

.timeline-item .org {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
}

.timeline-item p {
    color: var(--ink-soft);
    font-size: 14.5px;
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 40px;
    align-items: start;
}

.contact-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px;
    margin-bottom: 16px;
}

.contact-card .card-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.contact-card h3 {
    font-size: 15.5px;
    margin-bottom: 2px;
}

.contact-card p {
    color: var(--ink-soft);
    font-size: 14px;
}

.contact-card a {
    overflow-wrap: anywhere;
}

.contact-card a:hover {
    color: var(--accent-text);
}

.contact-form {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-form h3 {
    font-size: 19px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg-soft);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

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

.form-group .invalid {
    border-color: var(--error) !important;
}

.form-status {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 700;
}

.form-status.error {
    color: var(--error);
}

.form-status.success {
    color: var(--primary-dark);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 2px solid var(--border);
    padding: 32px 0;
    background: var(--bg-soft);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-inner p {
    font-size: 14px;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 8px;
}

.footer-links a {
    font-size: 14px;
    color: var(--ink-soft);
    display: inline-block;
    padding: 8px;
}

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

/* ---------- Homepage layout ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-tile {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.stat-tile strong {
    display: block;
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 2px;
}

.stat-tile span {
    font-size: 13px;
    color: var(--muted);
}

.about-preview {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: center;
}

.about-preview .avatar {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

.about-preview .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-preview h2 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    max-width: 460px;
}

.about-preview p {
    color: var(--ink-soft);
    font-size: 15.5px;
    max-width: 540px;
    margin-bottom: 12px;
}

.about-preview .btn {
    margin-top: 10px;
}

.center-cta {
    text-align: center;
    margin-top: 40px;
}

.cta-band {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 56px 48px;
    text-align: center;
    color: var(--btn-fg);
    box-shadow: 0 20px 45px rgba(var(--primary-rgb), 0.3);
}

.cta-band h2 {
    color: var(--btn-fg);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.cta-band p {
    color: var(--btn-fg);
    font-size: 16px;
    margin-bottom: 4px;
}

.cta-band .cta-email {
    color: var(--btn-fg);
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.cta-band .btn {
    margin-top: 24px;
    background: #fff;
    color: #241a12;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-band .btn:hover {
    background: var(--bg);
    color: #241a12;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero {
        padding: 60px 0 56px;
        text-align: center;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-meta {
        justify-content: center;
    }

    .highlight-grid,
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-preview {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-preview h2,
    .about-preview p {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 2px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 24px 20px;
        gap: 4px;
        display: none;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
    }

    .nav-cta {
        margin-left: 0;
        text-align: center;
    }

    .hero h1 {
        font-size: 34px;
    }

    .highlight-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 60px 0;
    }

    .section-head h2 {
        font-size: 27px;
    }

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

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

    .about-preview .avatar {
        width: 200px;
        height: 200px;
    }

    .cta-band {
        padding: 40px 24px;
    }
}