:root {
    --bg: #f3eaff;
    --bg-2: #ece2ff;
    --panel: rgba(255,255,255,0.72);
    --panel-2: rgba(255,255,255,0.92);
    --text: #1d1730;
    --muted: #5f5875;
    --line: rgba(29,23,48,0.10);
    --nav: #343441;
    --shadow: 0 18px 50px rgba(78, 40, 140, 0.16);
    --radius: 24px;
    --radius-sm: 16px;
    --max: 1160px;
    --bg-img: rgb(238, 237, 237);
}

[data-theme="darkmode"] {
    --bg: #1b1728;
    --bg-2: #171324;
    --panel: rgba(34, 27, 52, 0.78);
    --panel-2: rgba(42, 34, 63, 0.95);
    --text: #f5f1ffea;
    --muted: #bdb3db;
    --line: rgba(255,255,255,0.10);
    --nav: #232323;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --bg-img: #232323;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg), var(--bg-2));
    min-height: 100vh;
}

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

button, input, select {
    font: inherit;
}

.wrap { 
    width: min(var(--max), 
    calc(100% - 32px)); 
    margin: 0 auto; 
}

.topnav {
    position: sticky;
    top: 0;
    z-index: 20;    
    background: var(--nav);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    color: #f4f1ff;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.nav-links a, .nav-links button, .toggle {
    border: 1px solid #ffffff1a;
    background: #ffffff0f;
    color: inherit;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
}

.nav-links a:hover, .nav-links button:hover, .toggle:hover {
    border-color: #b07cff8c;
    background: #ffffff2a;
}

.section {
      padding: 28px 0;
}

.section-h {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-h h2 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

hr {
    color: var(--line);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.intro {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 14px;
    align-items: stretch;
}

.bio, .summary, .projects, .contact {
    padding: 23px;
}

.infotext {
    line-height: 1.7;
    font-size: clamp(0.7rem, 5vw, 1.2rem);
}

h1, h2, h3 {
    letter-spacing: -0.03em;
}

h1 { 
    margin: 0;
    font-size: clamp(1.2rem, 5vw, 3.4rem);
    line-height: 0.98;
}

.info-sub, .body-text {
    color: var(--muted);
    line-height: 1.75;
}

.info-sub { 
    margin: 14px 0 0;
    max-width: 64ch;
}

.tag, .contact-icons, .project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.summary h3 {
    margin: 0 0 10px;
}

.summary-block {
    padding: 16px;
    border-radius: 15px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    margin-top: 12px;
}

.summary-block strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.96rem;
    color: var(--text);
}

.summary-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.icon-link-c {
    font-size: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.icon-link-c:hover {
    color: rgba(38, 38, 39, 0.564);
}

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

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

.project-card {
    overflow: hidden;
    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--bg-img);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.project-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    margin: 0 0 10px;
}

.project-t {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.project-t span {
    background: rgba(29, 29, 29, 0.104);
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 15px;
    color: var(--text);
}

.project-info p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.98rem;
    margin: 0;
}

.project-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.project-buttons a, 
.project-buttons button {
    border: 1px solid var(--line);
    background: var(--nav);
    color: white;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
}

.project-buttons a:hover,
.project-buttons button:hover {
    opacity: 0.8;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 18, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    position: relative;
    width: min(1120px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.modal-head h3 {
    margin: 0 0 10px;
    font-size: 1.7rem;
}

.modal-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.modal-tags span {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.9rem;
}

.modal-viewer {
    margin-top: 18px;
}

.modal-viewer > img {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    background: var(--bg-img);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
}

.modal-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.modal-thumbs img {
    width: 110px;
    height: 82px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid var(--line);
    opacity: 0.72;
    transition: 0.2s ease;
}

.modal-thumbs img:hover,
.modal-thumbs img.active {
    opacity: 1;
    transform: translateY(-2px);
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.modal-links a {
    border: 1px solid var(--line);
    background: var(--nav);
    color: white;
    padding: 10px 14px;
    border-radius: 999px;
}

@media (max-width: 700px) {
    .modal-thumbs {
        gap: 8px;
    }

    .modal-thumbs img {
        width: 92px;
        height: 72px;
    }
}

/*2*/
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffffff1a;
    background: #ffffff0f;
    color: inherit;
    border-radius: 999px;
    padding: 10px 14px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    padding: 28px 0;
    align-items: start;
}

.detail-nav {
    position: sticky;
    top: 92px;
    padding: 18px;
}

.detail-nav h3 {
    margin-top: 0;
}

.detail-nav a {
    display: block;
    padding: 10px 0;
    color: var(--muted);
}

.detail-nav a:hover {
    cursor: pointer;
    text-decoration: underline;
}

.detail-content {
    display: grid;
    gap: 18px;
}

.detail-h,
.detail-section {
    padding: 24px;
}

.detail-kicker {
    margin: 0 0 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
}

.detail-step {
    margin-top: 18px;
    padding: 14px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.detail-section img:not(.thumb) {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    background: var(--bg-img);
    border: 1px solid var(--line);
    border-radius: 16px;
    display: block;
}

.detail-section img.gifs {
    max-height: 420px;
    width: 100%;
    object-fit: contain;
}

.detail-section p {
    margin: 12px 0 0;
}

.project-tech {
    color: var(--text);
    background: var(--bg-2);
}

.gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.thumb {
    width: 140px;
    height: 85px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: 0.2s ease;
    display: block;
    background: var(--bg-img);
}

.thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.active-thumb {
    border-color: #9b6dff;
    opacity: 1;
}

@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-nav {
        position: static;
    }
}

@media (max-width: 700px) {
    .detail-step img {
        max-height: 420px;
    }
}