.home-page {
    --bg: #1f1e1e;
    --surface: #1f1e1e;
    --surface-soft: rgba(255, 255, 255, 0.02);
    --text: #9f9d9d;
    --strong: #f5f2f2;
    --border: #3a3838;
    --border-strong: #4a4747;
    --accent: #f0f0a0;
    --accent-ink: #1f1e1e;
    --link-hover: #f0f0a0;
    --button-primary-bg: #f5f2f2;
    --button-primary-text: #1f1e1e;
    --muted-line: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(31, 30, 30, 0.96);
    --icon-filter: grayscale(1) brightness(0) invert(1);
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 2;
    overflow-x: hidden;
}

html[data-theme="light"] .home-page {
    --bg: #fefefe;
    --surface: #fefefe;
    --surface-soft: rgba(31, 30, 30, 0.02);
    --text: #646262;
    --strong: #1f1e1e;
    --border: #cfcdcb;
    --border-strong: #9f9a98;
    --accent: #d8c74d;
    --accent-ink: #1f1e1e;
    --link-hover: #4d4300;
    --button-primary-bg: #1f1e1e;
    --button-primary-text: #fffdfa;
    --muted-line: rgba(31, 30, 30, 0.08);
    --header-bg: rgba(254, 254, 254, 0.96);
    --icon-filter: grayscale(1) brightness(0);
}

.home-page * {
    box-sizing: border-box;
}

.home-page ::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

.home-page a {
    color: inherit;
    text-decoration: none;
}

.home-page img,
.home-page video {
    display: block;
    max-width: 100%;
}

.home-page button,
.home-page input,
.home-page textarea {
    font: inherit;
}

.home-page ::-webkit-scrollbar {
    width: 8px;
}

.home-page ::-webkit-scrollbar-track {
    background: transparent;
}

.home-page ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.progress-container {
    position: fixed;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    z-index: 120;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--strong);
    transition: width 120ms linear;
}

.site-shell {
    width: min(100%, 1440px);
    min-height: 100vh;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 78px;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
}

.brand-link,
.nav-link,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    padding: 0 32px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease;
}

.brand-link {
    justify-content: flex-start;
    border-right: 1px solid var(--border);
    color: var(--strong);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    align-items: stretch;
    border-left: 1px solid var(--border);
}

.nav-link {
    border-right: 1px solid var(--border);
}

.nav-link:hover,
.nav-link.active,
.theme-toggle:hover,
.brand-link:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

.theme-toggle {
    appearance: none;
    border: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--strong);
    cursor: pointer;
}

.theme-toggle i {
    font-size: 1.25rem;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.92fr);
    min-height: 810px;
    border-bottom: 1px solid var(--border);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 88px 72px 96px;
}

.hero-greeting {
    margin: 0 0 18px;
    color: var(--strong);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0;
    color: var(--strong);
    font-size: clamp(3.8rem, 5.35vw, 4.95rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
}

.hero-title-line {
    display: block;
    white-space: nowrap;
}

.hero-description {
    max-width: 52ch;
    margin: 34px 0 0;
    font-size: 1.02rem;
    color: var(--text);
    line-height: 1.78;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 46px;
}

.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 76px;
    padding: 0 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button-primary {
    background: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.home-page .button-primary,
.home-page .button-primary:visited {
    color: var(--button-primary-text) !important;
}

.home-page .button-primary * {
    color: inherit;
}

html[data-theme="dark"] .home-page .button-primary,
html[data-theme="dark"] .home-page .button-primary:visited {
    background: #f5f2f2 !important;
    border-color: #f5f2f2 !important;
    color: #1f1e1e !important;
}

html[data-theme="light"] .home-page .button-primary,
html[data-theme="light"] .home-page .button-primary:visited {
    background: #1f1e1e !important;
    border-color: #1f1e1e !important;
    color: #fffdfa !important;
}

.button-primary i {
    color: inherit;
}

.button-secondary {
    background: transparent;
    color: var(--strong);
}

html[data-theme="dark"] .home-page .button-secondary,
html[data-theme="dark"] .home-page .button-secondary:visited {
    color: #f5f2f2;
}

html[data-theme="light"] .home-page .button-secondary,
html[data-theme="light"] .home-page .button-secondary:visited {
    color: #1f1e1e;
}

.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-1px);
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.button-secondary:hover {
    color: #1f1e1e !important;
}
.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 60px;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--strong);
    font-size: 0.92rem;
    font-weight: 500;
}

.hero-links a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.24em;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 56px;
    border-left: 1px solid var(--border);
}

.portrait-frame {
    position: relative;
    width: min(100%, 270px);
    aspect-ratio: 1;
    padding: 12px;
    border: 1px solid var(--border);
}

.portrait-frame::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid var(--border);
}

.portrait-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    filter: grayscale(1) contrast(1.04);
}

.tech-marquee {
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tech-marquee-track {
    display: flex;
    align-items: center;
    gap: 26px;
    min-width: max-content;
    padding: 18px 0;
    animation: home-scroll 30s linear infinite;
}

.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--strong);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tech-separator {
    color: var(--border);
    opacity: 0.7;
}

.tech-logo,
.skill-logo {
    width: 20px;
    height: 20px;
    filter: var(--icon-filter);
    object-fit: contain;
}

.tech-glyph,
.skill-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--strong);
    font-size: 1rem;
}

.content-section {
    padding: 72px;
    border-bottom: 1px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 1px 960px;
}

.content-section.soft {
    background: var(--surface-soft);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.section-heading-line {
    width: 32px;
    height: 1px;
    background: var(--strong);
}

.section-heading h2 {
    margin: 0;
    color: var(--strong);
    font-size: 1.3rem;
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.project-card::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--strong);
    background: rgba(255, 255, 255, 0.02);
}

.project-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.project-media img,
.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-title {
    margin: 0;
    color: var(--strong);
    font-size: 1.15rem;
}

.project-copy {
    display: grid;
    gap: 14px;
}

.project-description {
    margin: 0;
    font-size: 0.92rem;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-chip {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--strong);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    color: var(--strong);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: gap 160ms ease, color 160ms ease;
}

.project-link:hover {
    gap: 14px;
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.24em;
}

.project-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.04) 14px,
            transparent 14px,
            transparent 28px
        );
    color: var(--strong);
}

.project-placeholder span {
    padding: 8px 12px;
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.project-card-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: center;
}

.project-card-wide .project-media {
    order: 2;
}

.experience-list {
    margin-left: 6px;
    border-left: 1px solid var(--border);
    display: grid;
    gap: 44px;
}

.experience-item {
    position: relative;
    padding-left: 36px;
}

.experience-marker {
    position: absolute;
    top: 10px;
    left: -7px;
    width: 13px;
    height: 13px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.experience-item:hover .experience-marker {
    background: var(--accent);
    border-color: var(--accent);
}

.experience-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 8px;
}

.experience-company {
    margin: 0;
    color: var(--strong);
    font-size: 1.1rem;
}

.experience-date {
    padding: 5px 10px;
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.experience-role {
    margin: 0 0 12px;
    color: var(--strong);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.82;
}

.experience-meta {
    margin: 0 0 14px;
    font-size: 0.92rem;
}

.experience-points {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.experience-points li {
    color: var(--text);
    font-size: 0.92rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px;
}

.skill-column h3 {
    margin: 0 0 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--strong);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.skill-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 16px;
}

.skill-column li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--strong);
    font-size: 0.92rem;
    font-weight: 500;
}

.blog-list {
    border-top: 1px solid var(--border);
}

.blog-entry,
.blog-error {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 24px;
    padding: 24px 18px;
    margin: 0 -18px;
    border-bottom: 1px solid var(--border);
    border-radius: 4px;
    transition: background-color 160ms ease, color 160ms ease;
}

.blog-entry:hover,
.blog-error:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

.blog-entry:hover .blog-entry-title,
.blog-entry:hover .blog-entry-date,
.blog-entry:hover .blog-entry-copy p {
    color: var(--accent-ink);
}

.blog-entry-copy {
    max-width: 68ch;
}

.blog-entry-title {
    margin: 0 0 10px;
    color: var(--strong);
    font-size: 1.08rem;
    line-height: 1.5;
}

.blog-entry-copy p {
    margin: 0;
    font-size: 0.92rem;
    opacity: 0.88;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.blog-entry-date {
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    justify-self: end;
}

.blog-entry-arrow {
    justify-self: end;
    width: 1rem;
    color: var(--strong);
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 160ms ease, color 160ms ease;
}

.blog-entry:hover .blog-entry-arrow {
    opacity: 1;
    color: var(--accent-ink);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gallery-card {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.gallery-card::after {
    content: "View";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(226, 212, 92, 0.92);
    color: var(--accent-ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 180ms ease;
}

.gallery-card:hover img {
    transform: scale(1.06);
}

.gallery-card:hover::after {
    opacity: 1;
}

.gallery-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.contact-card {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 48px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.contact-card::before,
.contact-card::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
}

.contact-card::before {
    top: -1px;
    right: -1px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.contact-card::after {
    left: -1px;
    bottom: -1px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.contact-title {
    margin: 0 0 16px;
    color: var(--strong);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.2;
    text-align: center;
}

.contact-copy {
    max-width: 56ch;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 0.92rem;
}

.contact-form {
    display: grid;
    gap: 28px;
}

.contact-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.field {
    display: grid;
    gap: 10px;
}

.field label {
    color: var(--strong);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 4px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--strong);
    transition: border-color 160ms ease, background-color 160ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--strong);
    background: rgba(240, 240, 160, 0.06);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-submit {
    justify-self: flex-end;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 72px;
}

.footer-copy {
    margin: 0;
    color: var(--strong);
    font-size: 0.92rem;
    font-weight: 500;
}

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

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--strong);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-links a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.24em;
}

@keyframes home-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 1180px) {
    .hero-copy,
    .content-section,
    .site-footer {
        padding-left: 40px;
        padding-right: 40px;
    }

    .hero-section {
        grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.82fr);
    }

    .projects-grid,
    .skills-grid {
        gap: 28px;
    }
}

@media (max-width: 980px) {
    .site-header {
        grid-template-columns: 1fr;
    }

    .brand-link {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .site-nav {
        overflow-x: auto;
        border-left: 0;
        border-bottom: 1px solid var(--border);
    }

    .theme-toggle {
        min-height: 64px;
        border-left: 0;
    }

    .hero-section,
    .project-card-wide,
    .contact-row {
        grid-template-columns: 1fr;
    }

    .hero-section {
        min-height: auto;
    }

    .hero-visual {
        border-left: 0;
        border-top: 1px solid var(--border);
        min-height: 280px;
    }

    .projects-grid,
    .skills-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .experience-header,
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-entry,
    .blog-error {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .blog-entry-arrow {
        display: none;
    }

    .contact-submit {
        justify-self: stretch;
    }
}

@media (max-width: 720px) {
    .brand-link,
    .nav-link,
    .theme-toggle {
        min-height: 62px;
        padding: 0 18px;
    }

    .hero-copy,
    .content-section,
    .site-footer {
        padding: 40px 18px;
    }

    .hero-copy {
        padding-top: 56px;
    }

    .hero-title {
        font-size: clamp(2.7rem, 14vw, 4rem);
    }

    .hero-title-line {
        display: inline;
        white-space: normal;
    }

    .hero-description {
        max-width: none;
    }

    .hero-links,
    .hero-actions,
    .footer-links {
        gap: 16px;
    }

    .button-primary,
    .button-secondary {
        min-height: 64px;
        width: 100%;
    }

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

    .project-card {
        padding: 18px;
    }

    .contact-card {
        padding: 32px 18px;
    }
}
