body {
    background: #2c2c2c;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    color: #fff;
    font-family: Arial, sans-serif;
}

body,
.site-header,
.site-footer,
.nav-button,
.social a,
.cover,
.about,
.about-content,
.about-label,
.about-highlights span,
.skill-chip,
.project-card,
.project-links a,
.contact-page h2,
#text {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.light-theme {
    background: #f1eee8;
    color: #241c1a;
}

body.light-theme .site-header,
body.light-theme .site-footer {
    background: #fff8ec;
    color: #2b211f;
    box-shadow: 0 0.4rem 1.2rem rgba(74, 44, 42, 0.12);
}

body.light-theme .nav-button,
body.light-theme .social a {
    background: #fff;
    color: #4a2c2a;
    border-color: #b8864f;
}

body.light-theme .nav-button:hover,
body.light-theme .social a:hover,
body.light-theme .project-links a:hover {
    background: #b8864f;
    color: #fff8ec;
}

body.light-theme .cover {
    background: linear-gradient(135deg, #f8e8c2, #c9a66b);
    color: #241c1a;
    box-shadow: 0 0 20px rgba(74, 44, 42, 0.22);
}

body.light-theme .cover-profile p,
body.light-theme #text {
    color: #7a3d2f;
}

body.light-theme .about {
    background: linear-gradient(160deg, #fffaf0 0%, #f0dfba 100%);
    color: #231817;
}

body.light-theme .about-content {
    background: rgba(255, 255, 255, 0.68);
    border-color: rgba(122, 61, 47, 0.2);
}

body.light-theme .about-label,
body.light-theme .project-links a {
    background: #7a3d2f;
    color: #fff8ec;
}

body.light-theme .about-highlights span,
body.light-theme .skill-chip,
body.light-theme .project-card {
    background: #fffef9;
    color: #4a2c2a;
}

body.light-theme .project-card h3 {
    color: #7a3d2f;
}

body.light-theme .project-card p,
body.light-theme .about-content p {
    color: #4d3b35;
}

.site-header {
    width: 100%;
    box-sizing: border-box;
    padding: 20px 24px;
    background: #1c1c1c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 2rem;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: clamp(0.45rem, 1vw, 0.75rem);
    min-width: 0;
}

.brand {
    /* font-size: 24px; */
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-button {
    border: 1px solid #c9a66b;
    background: transparent;
    background: #333;
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    width: 100px;
    text-align: center;
    font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-button:hover {
    background: #c9a66b;
    color: #1c1c1c;
    transform: translateY(-1px);
}

.page-shell {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
}

#book {
    /* width: min(46vw, 520px);
    height: min(72vh, 680px);
    min-height: 520px;  */
    width: calc(100vw - 60vw);
    height: calc(100vh - 20vh);

}


/* From Uiverse.io by Madflows */
.toggle-switch {
    position: relative;
    flex: 0 0 auto;
    width: clamp(3.75rem, 6.5vw, 6.25rem);
    height: clamp(1.875rem, 3.3vw, 3.125rem);
    --light: #d8dbe0;
    --dark: #28292c;
    --link: rgb(27, 129, 112);
    --link-hover: rgb(24, 94, 82);
}

.switch-label {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-color: var(--dark);
    border-radius: 999px;
    cursor: pointer;
    border: clamp(0.12rem, 0.25vw, 0.19rem) solid var(--dark);
}

.checkbox {
    position: absolute;
    display: none;
}

.slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.checkbox:checked~.slider {
    background-color: var(--light);
}

.slider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 10%;
    width: 25%;
    aspect-ratio: 1;
    border-radius: 50%;
    -webkit-box-shadow: inset 0.75rem -0.25rem 0 0 var(--light);
    box-shadow: inset 0.75rem -0.25rem 0 0 var(--light);
    background-color: var(--dark);
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.checkbox:checked~.slider::before {
    -webkit-transform: translate(210%, -50%);
    -ms-transform: translate(210%, -50%);
    transform: translate(210%, -50%);
    background-color: var(--dark);
    -webkit-box-shadow: none;
    box-shadow: none;
}

.page {
    background: #fff;
    border: 1px solid #ddd;
    box-sizing: border-box;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: #1f1f1f;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cover {
    background: linear-gradient(135deg, #4a2c2a, #2b1a19);
    color: white;
    font-weight: bold;
    font-size: 28px;
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.page-cover {
    text-align: center;
    align-content: center;
    padding: 28px;
    box-sizing: border-box;
}

.cover-profile {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-transform: none;
}

.cover-photo {
    width: min(58%, 220px);
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #c9a66b;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cover-profile h1,
.cover-profile p {
    margin: 0;
}

.cover-profile h1 {
    font-size: clamp(22px, 4vw, 34px);
    line-height: 1.15;
    letter-spacing: 0.03em;
}

.cover-profile p {
    color: #e3c890;
    font-size: clamp(13px, 2.2vw, 18px);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.contact-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-transform: none;
}

.contact-page h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    letter-spacing: 0.08em;
    color: #f4e6c7;
}

.site-footer {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 24px;
    text-align: center;
    background: #1c1c1c;
    color: #d2d2d2;
    font-size: 14px;
}

.site-footer p {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0;
}

.social {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.social-vertical {
    width: min(100%, 320px);
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 0;
}

.social a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 40px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #333;
    color: white;
    text-decoration: none;
    border: 1px solid #c9a66b;
    transition: background 0.3s ease, transform 0.3s ease;
}

.social-vertical a {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
}

.social a i {
    font-size: 24px;
}

.social a span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.social a:hover {
    background: #c9a66b;
    color: #1c1c1c;
    transform: translateY(-2px);
}

#text {
    display: inline-block;
    font-size: 22px;
    color: #c9a66b;
    letter-spacing: 0.06em;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background-color: #00d4ff;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.8s infinite;
}

.about {
    background: linear-gradient(160deg, #f4e6c7 0%, #ead3a4 100%);
    color: #231817;
    text-transform: none;
    padding: clamp(12px, 2vw, 28px);
    box-sizing: border-box;
    align-items: stretch;
}

.about-content {
    width: 100%;
    /* max-width: 620px; */
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(8px, 1.4vw, 16px);
    padding: clamp(14px, 2.4vw, 28px);
    box-sizing: border-box;
    /* overflow: auto; */
    /* overflow-wrap: anywhere; */
    border: 2px solid rgba(74, 44, 42, 0.18);
    border-radius: clamp(16px, 2vw, 24px);
    background: rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.about-label {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: #4a2c2a;
    color: #f4e6c7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.about-content h2 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.18;
    letter-spacing: 0.02em;
    text-transform: none;
}

.about-content p {
    margin: 0;
    font-size: clamp(13px, 1.2vw, 17px);
    line-height: 1.65;
    color: #43302d;
    letter-spacing: 0.01em;
}

.about-highlights {
    display: flex;
    /* flex-wrap: wrap; */
    font-size: .5em;
    gap: 10px;
    margin-top: 6px;
}

.about-highlights span {
    padding: 9px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(74, 44, 42, 0.2);
    color: #4a2c2a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(74, 44, 42, 0.2);
    color: #4a2c2a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.skill-chip i {
    font-size: 18px;
    color: #8b2f2b;
}

.projects-content {
    justify-content: flex-start;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(74, 44, 42, 0.2);
    box-shadow: 0 8px 18px rgba(74, 44, 42, 0.08);
}

.project-card > div {
    min-width: 0;
}

.project-card h3 {
    margin: 0 0 5px;
    color: #4a2c2a;
    font-size: clamp(16px, 1.5vw, 21px);
    line-height: 1.2;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}

.project-card p {
    margin: 0;
    color: #5a4540;
    font-size: clamp(12px, 1vw, 14px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.project-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 96px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #4a2c2a;
    color: #f4e6c7;
    border: 1px solid rgba(74, 44, 42, 0.24);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-links a:hover {
    background: #c9a66b;
    color: #1c1c1c;
    transform: translateY(-1px);
}

.project-links i {
    font-size: 16px;
}

.experience-page {
    align-items: stretch;
}

.experience-layout {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(10px, 1.6vw, 18px);
}

.experience-content {
    width: min(100%, 420px);
    max-width: none;
    justify-content: center;
    justify-self: center;
    padding: clamp(12px, 1.8vw, 20px);
}

.experience-card {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
}

.experience-card .project-links {
    display: block;
}

.experience-card .project-links a {
    width: 100%;
    box-sizing: border-box;
}

.experience-media {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.experience-media img {
    display: block;
    /* width: 150%; */
    height: 16rem;
    object-fit: contain;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 680px) {
    .site-header {
        justify-content: center;
        /* text-align: center; */
        gap: 12px;
        padding-inline: 14px;
    }

    .brand-row {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .brand {
        font-size: clamp(1.1rem, 6vw, 1.6rem);
    }

    .toggle-switch {
        width: clamp(3.25rem, 16vw, 4rem);
        height: clamp(1.6rem, 8vw, 2rem);
    }

    .slider::before {
        -webkit-box-shadow: inset 0.5rem -0.16rem 0 0 var(--light);
        box-shadow: inset 0.5rem -0.16rem 0 0 var(--light);
    }

    .header-nav {
        justify-content: center;
    }

    /* .header-nav {
        gap: 8px;
    }

    .nav-button{
        width: 65px;
        font-size: 10px;
        justify-content: center;
    } */

    #book {
        width: min(100%, 360px);
        height: 520px;
        min-height: 0;
    }

    .page {
        font-size: 18px;
    }

    .page-cover {
        padding: 22px;
    }

    .about {
        padding: 12px;
    }

    .about-content {
        height: 100%;
        gap: 8px;
        padding: 16px 14px;
        border-radius: 18px;
    }

    .about-label {
        padding: 6px 12px;
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .about-content h2 {
        font-size: 20px;
        line-height: 1.28;
    }

    .about-content p {
        font-size: 13px;
        line-height: 1.55;
    }

    .about-highlights {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .about-highlights span {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 11px;
        letter-spacing: 0.02em;
    }

    .skills-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
    }

    .skill-chip {
        justify-content: center;
        min-width: 0;
        padding: 10px 8px;
        font-size: 12px;
        gap: 7px;
        text-align: center;
    }

    .projects-content {
        justify-content: center;
    }

    .projects-list {
        gap: 9px;
    }

    .project-card {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
        padding: 11px;
        border-radius: 16px;
    }

    .project-card h3 {
        margin-bottom: 3px;
        font-size: 15px;
    }

    .project-card p {
        font-size: 12px;
        line-height: 1.3;
    }

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

    .project-links a {
        min-width: 0;
        padding: 8px 6px;
        font-size: 11px;
        gap: 5px;
    }

    .project-links i {
        font-size: 14px;
    }

    .experience-layout {
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
    }

    .experience-content {
        min-height: 0;
        padding: 12px;
    }

    .experience-card {
        padding: 10px;
    }

    .experience-media {
        min-height: 0;
    }

    .experience-media img {
        width: min(100%, 230px);
        max-height: 100%;
    }

    .cover-photo {
        width: min(62%, 170px);
    }

    .social a {
        min-width: 125px;
        padding: 10px 14px;
    }

    .social-vertical {
        width: 70%;
    }

    .site-footer .social {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .site-footer .social a {
        min-width: 0;
        flex: 1 1 0;
        padding: 8px 4px;
        gap: 4px;
        border-radius: 16px;
    }

    .site-footer .social a i {
        font-size: 16px;
    }

    .site-footer .social a span {
        font-size: 10px;
        letter-spacing: 0;
    }
}

@media (max-width: 420px) {
    .page-shell {
        padding: 20px 10px;
    }

    #book {
        width: min(100%, 320px);
        height: 500px;
    }

    .about-content h2 {
        font-size: 18px;
    }

    .about-content p {
        font-size: 12px;
        line-height: 1.45;
    }

    .skills-grid {
        gap: 7px;
    }

    .skill-chip {
        padding: 9px 6px;
        font-size: 11px;
    }

    .skill-chip i {
        font-size: 16px;
    }

    .projects-list {
        gap: 7px;
    }

    .project-card h3 {
        font-size: 14px;
    }

    .project-card p {
        font-size: 11px;
        line-height: 1.25;
    }

    .project-links {
        gap: 6px;
    }

    .project-links a {
        padding: 8px 6px;
        font-size: 11px;
    }

    .experience-content {
        padding: 12px;
    }

    .experience-media img {
        width: min(100%, 200px);
        max-height: 100%;
    }
}

@media (max-height: 760px) and (min-width: 681px) {
    #book {
        height: calc(100vh - 220px);
        min-height: 440px;
    }

    .about-content {
        gap: 10px;
        padding: 18px;
    }

    .about-content h2 {
        font-size: clamp(20px, 2vw, 28px);
    }

    .about-content p {
        font-size: clamp(12px, 1vw, 15px);
        line-height: 1.5;
    }

    .about-highlights span {
        padding: 7px 10px;
        font-size: 11px;
    }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 950px) {
    .site-header {
        padding: 8px 12px;
        gap: 8px;
        font-size: 1.2rem;
        align-items: center;
    }

    .brand-row {
        width: auto;
        justify-content: flex-start;
        gap: 6px;
    }

    .brand {
        font-size: clamp(0.95rem, 2.6vw, 1.25rem);
        letter-spacing: 0.02em;
    }

    .toggle-switch {
        width: clamp(2.8rem, 8vw, 3.5rem);
        height: clamp(1.35rem, 4vw, 1.75rem);
    }

    .header-nav {
        flex: 1 1 22rem;
        justify-content: flex-end;
        gap: 6px;
    }

    .nav-button {
        width: auto;
        min-width: 4.2rem;
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .page-shell {
        padding: 8px 10px;
        align-items: flex-start;
    }

    #book {
        width: min(62vw, 420px);
        height: calc(100svh - 92px);
        min-height: 230px;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .page {
        font-size: 0.95rem;
        letter-spacing: 0.03em;
    }

    .page-cover {
        padding: 10px;
    }

    .cover-profile {
        gap: 6px;
    }

    .cover-photo {
        width: min(36%, 110px);
        border-width: 3px;
    }

    .cover-profile h1 {
        font-size: clamp(1rem, 3.8vw, 1.35rem);
    }

    .cover-profile p,
    #text {
        font-size: clamp(0.72rem, 2.3vw, 0.9rem);
    }

    .about {
        padding: 6px;
    }

    .about-content {
        justify-content: flex-start;
        gap: 5px;
        padding: 8px;
        border-radius: 12px;
    }

    .about-label {
        padding: 4px 8px;
        font-size: 0.58rem;
        letter-spacing: 0.06em;
    }

    .about-content h2 {
        font-size: clamp(0.85rem, 2.4vw, 1.1rem);
        line-height: 1.18;
    }

    .about-content p {
        font-size: clamp(0.62rem, 1.8vw, 0.75rem);
        line-height: 1.35;
    }

    .about-highlights {
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 2px;
    }

    .about-highlights span {
        padding: 4px 7px;
        font-size: 0.6rem;
    }

    .skills-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        margin-top: 2px;
    }

    .skill-chip {
        min-width: 0;
        justify-content: center;
        gap: 4px;
        padding: 5px 6px;
        font-size: 0.62rem;
        text-align: center;
    }

    .skill-chip i {
        font-size: 0.8rem;
    }

    .projects-list {
        gap: 5px;
    }

    .project-card {
        gap: 5px;
        padding: 7px;
        border-radius: 10px;
    }

    .project-card h3 {
        margin-bottom: 2px;
        font-size: clamp(0.75rem, 2vw, 0.9rem);
    }

    .project-card p {
        font-size: clamp(0.6rem, 1.6vw, 0.7rem);
        line-height: 1.2;
    }

    .project-links {
        gap: 4px;
    }

    .project-links a {
        min-width: 0;
        padding: 5px 6px;
        font-size: 0.6rem;
        gap: 4px;
    }

    .project-links i {
        font-size: 0.72rem;
    }

    .experience-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 6px;
    }

    .experience-content {
        padding: 8px;
    }

    .experience-card {
        padding: 7px;
    }

    .experience-media img {
        width: 100%;
        height: auto;
        max-height: 100%;
    }

    .contact-page {
        gap: 8px;
    }

    .contact-page h2 {
        font-size: clamp(1rem, 3vw, 1.25rem);
    }

    .social-vertical {
        width: min(88%, 240px);
    }

    .social a {
        min-width: 0;
        padding: 6px 10px;
        gap: 6px;
    }

    .social a i {
        font-size: 1rem;
    }

    .social a span {
        font-size: 0.7rem;
    }

    .site-footer {
        padding: 6px 12px;
        font-size: 0.68rem;
    }

    .site-footer .social {
        margin-bottom: 4px;
        gap: 4px;
    }

    .site-footer .social a {
        padding: 4px 6px;
        border-radius: 10px;
    }
}
