:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #15803d;
    --accent-light: #dcfce7;
    --accent-dark: #166534;
    --green: #059669;
    --green-light: #d1fae5;
    --tag-bg: #166534;
    --available-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #dc2626;
    --error-border: #fca5a5;
    --header-bg: rgba(255, 255, 255, 0.88);
    --hero-grad: linear-gradient(160deg, #f0fdf4 0%, #ffffff 60%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Fira Code", Menlo, monospace;
    --radius: 6px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #070e08;
        --bg-alt: #0c1510;
        --bg-muted: #162518;
        --border: #1e3a24;
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --accent: #4ade80;
        --accent-light: #0a2e14;
        --accent-dark: #86efac;
        --green: #34d399;
        --green-light: #022c22;
        --tag-bg: #0d3b1e;
        --available-text: #4ade80;
        --error-bg: #2d1010;
        --error-text: #f87171;
        --error-border: #7f1d1d;
        --header-bg: rgba(7, 14, 8, 0.88);
        --hero-grad: linear-gradient(160deg, #0c2214 0%, #070e08 60%);
        --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    }
}

.dark-only {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .light-only {
        display: none;
    }

    .dark-only {
        display: inline;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans), sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand {
    font-family: var(--font-mono), monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

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

nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

nav a:hover {
    color: var(--text);
}

.lang-toggle {
    font-family: var(--font-mono), monospace;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.2rem 0.5rem;
    transition: border-color 0.15s, color 0.15s !important;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    background: var(--bg);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-right {
    font-family: var(--font-mono), monospace;
}

#hero {
    padding: 6rem 0 5rem;
    background: var(--hero-grad);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.available-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--tag-bg);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    width: fit-content;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

#hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-title {
    font-family: var(--font-mono), monospace;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--accent);
    font-weight: 500;
}

.hero-sub {
    font-size: 1.0625rem;
    color: var(--text-muted);
    line-height: 1.7;
}

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

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

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

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.section-inner {
    padding: 4.5rem 1.5rem;
}

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

.section-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

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

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-meta {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.meta-value {
    font-size: 1em;
}

.meta-value.available {
    color: var(--available-text);
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-group h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono), monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    background: var(--tag-bg);
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
}

.tag-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.tags.small .tag-icon {
    width: 14px;
    height: 14px;
}

.timeline {
    display: flex;
    flex-direction: column;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.timeline-entry {
    display: block;
    position: relative;
    padding: 2rem 0;
    padding-left: 1.5rem;
}

.timeline-entry:first-child {
    padding-top: 0;
}

.timeline-meta {
    display: none;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: 0;
    top: 28px;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 3px var(--accent-light);
    z-index: 1;
}

.timeline-entry:first-child::before { animation: pulse 2s infinite; }

.timeline-entry:not(:first-child)::before { top: calc(2rem + 28px); }

.timeline-period {
    font-family: var(--font-mono), monospace;
    font-size: 1em;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
}

.period-start { order: 1; }
.period-start::after { content: "\00a0\2013\00a0"; }
.period-end { order: 2; }

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.timeline-role {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.timeline-company {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.timeline-company:hover { text-decoration: underline; }

.timeline-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.timeline-points li {
    font-size: 1em;
    color: var(--text-muted);
    padding-left: 1rem;
    position: relative;
    line-height: 1.6;
}

.timeline-points li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--border);
}

.company-logo {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: contain;
    padding: 6px;
    background: #ffffff;
    flex-shrink: 0;
}

.timeline-group-company {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1em;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.timeline-group-company:hover { color: var(--accent); }

.timeline-sub-entry {
    padding-top: 0.75rem;
}

.timeline-sub-entry + .timeline-sub-entry {
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.timeline-sub-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.timeline-sub-period {
    font-family: var(--font-mono), monospace;
    font-size: 1em;
    color: var(--text-muted);
}

.project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--bg);
}
.project-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.project-title  { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.project-sub    { font-size: 0.875rem; color: var(--accent); font-weight: 500; margin-bottom: 0.75rem; }
.project-company a { color: inherit; text-decoration: none; }
.project-company a:hover { color: var(--accent); }
.project-desc   { font-size: 1em; color: var(--text-muted); line-height: 1.75; margin-bottom: 1rem; }

.ai-intro {
    color: var(--text-muted);
    font-size: 1.0625rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.ai-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-points li {
    font-size: 1em;
    color: var(--text-muted);
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.6;
}

.ai-points li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
}

#contact { border-top: 1px solid var(--border); }

.contact-sub {
    color: var(--text-muted);
    font-size: 1.0625rem;
    margin-bottom: 2rem;
}

.contact-feedback {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 1em;
    margin-bottom: 1.5rem;
}

.contact-success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid var(--green);
}

.contact-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-field input,
.form-field textarea {
    font-family: var(--font-sans), sans-serif;
    font-size: 1em;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    resize: none;
    width: 100%;
}
.form-field textarea { resize: vertical; }

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

.form-actions {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-actions .btn { display: flex; align-items: center; }

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1em;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.contact-email {
    cursor: default;
    user-select: all;
}

.contact-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.contact-service-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

@media (max-width: 720px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .timeline-entry {
        padding-left: 0;
    }

    .timeline::before,
    .timeline-entry::before {
        display: none;
    }

    .timeline-period {
        flex-direction: column;
        align-items: flex-end;
        white-space: normal;
    }

    .period-start { order: 2; }
    .period-start::after { content: none; }
    .period-end { order: 1; }

    nav {
        gap: 1rem;
    }

    nav a:nth-child(-n+5) {
        display: none;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-links {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }
}

@media print {

    .site-header,
    .hero-links,
    .available-badge {
        display: none;
    }

    #hero {
        padding: 2rem 0 1.5rem;
        background: none;
        border: none;
    }

    .section-inner {
        padding: 2rem 0;
    }

    .section-alt {
        background: none;
        border: none;
    }

    body {
        font-size: 11pt;
    }

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

    .timeline-entry {
        break-inside: avoid;
    }
}
