:root {
    --bg: #131312;
    --ink: #e8e6e1;
    --ink-dim: #a8a39d;
    --ink-mute: #9c9c9c;
    --line: rgba(57, 50, 45, 0.99);
    --accent: #7dd3a8;

    --card-bg: rgba(22, 22, 22, 0.85);
    --card-border: rgba(255, 255, 255, 0.04);
    --card-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.65),
    0 8px 24px -8px rgba(0, 0, 0, 0.4);

    --overlay-top: rgba(100, 102, 104, 0.08);
    --overlay-bottom: rgb(5, 8, 12);
}

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

html, body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-image: linear-gradient(180deg, var(--overlay-top) 0%, var(--overlay-bottom) 100%),
    url('assets/mountains.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: bg-drift 40s ease-in-out infinite alternate;
}

@keyframes bg-drift {
    0%   { transform: scale(1)    translate3d(0, 0, 0); }
    100% { transform: scale(1.05) translate3d(-1%, -0.5%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .scene { animation: none; }
}

.corner-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    color: var(--ink);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, border-color 0.2s ease;
    font: inherit;
}
@media (hover: hover) {
    .corner-button:hover {
        transform: scale(1.05);
        border-color: var(--ink-mute);
    }
}
.corner-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.corner-button svg {
    width: 18px;
    height: 18px;
}

.wrap {
    max-width: 720px;
    margin: 14dvh auto 6dvh;
    padding: 56px 48px 40px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    animation: card-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    overflow-x: hidden;
}

@keyframes card-in {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
@media (hover: hover) {
    a:hover { border-bottom-color: var(--accent); }
}

header {
    margin-bottom: 36px;
}

h1 {
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--ink-dim);
    font-size: 18px;
}
.subtitle + .subtitle {
    margin-top: 2px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink-mute);
    letter-spacing: 0.02em;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
}

.tab {
    position: relative;
    padding: 10px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .tab:hover {
        color: var(--ink-dim);
    }
}
.tab[aria-selected="true"] {
    color: var(--ink);
}
.tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}
.tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.panel {
    margin-top: 0;
    animation: panel-in 0.25s ease both;
}
.panel[hidden] {
    display: none;
}

@keyframes panel-in {
    0%   { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.panel p {
    color: var(--ink-dim);
}
.panel p + p {
    margin-top: 14px;
}

.panel-subhead {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 28px 0 12px;
}
.panel-subhead:first-child { margin-top: 0; }

section { margin-top: 0; }

.bare-list {
    list-style: none;
    padding: 0;
}
.bare-list li {
    padding: 6px 0;
    display: flex;
    gap: 14px;
    align-items: baseline;
    color: var(--ink-dim);
}
.bare-list .when {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 110px;
}
.bare-list .what {
    color: var(--ink);
    font-size: 14px;
}

.chip-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-list li {
    padding: 5px 11px;
    font-size: 12.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.panel.contact a {
    display: inline-block;
    margin-right: 24px;
}

footer {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--ink-mute);
    letter-spacing: 0.04em;
}

@media (max-width: 900px) {
    .wrap {
        max-width: 600px;
        padding: 48px 40px 36px;
    }
}

@media (max-width: 600px) {
    body { font-size: 15px; line-height: 1.6; }

    .wrap {
        margin: 6dvh 12px 6dvh;
        padding: 28px 18px 24px;
        border-radius: 14px;
    }

    header { margin-bottom: 22px; }
    h1 { font-size: 22px; }
    .subtitle { font-size: 14px; }
    .subtitle + .subtitle {
        font-size: 11px;
        margin-top: 4px;
    }

    .tabs {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 2px;
        padding: 3px;
        margin-bottom: 22px;
        border: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.25);
        width: 100%;
    }

    .tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 4px;
        font-size: 10px;
        letter-spacing: 0.04em;
        border-radius: 7px;
        text-align: center;
        transition: background 0.2s ease, color 0.2s ease;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab[aria-selected="true"] {
        background: var(--card-bg);
        color: var(--ink);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--card-border) inset;
    }
    .tab[aria-selected="true"]::after {
        display: none;
    }

    .panel p { font-size: 14.5px; }

    .panel-subhead {
        margin: 22px 0 10px;
        font-size: 10.5px;
    }

    .bare-list li {
        flex-direction: column;
        gap: 2px;
        padding: 8px 0;
    }
    .bare-list .when { min-width: 0; }
    .bare-list .what { font-size: 14.5px; }

    .chip-list { gap: 5px; }
    .chip-list li {
        padding: 5px 10px;
        font-size: 12px;
    }

    .panel.contact a { margin-right: 18px; }

    footer {
        margin-top: 36px;
        padding-top: 16px;
        font-size: 11px;
    }

    .corner-button {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }
    .corner-button svg {
        width: 16px;
        height: 16px;
    }

    @keyframes bg-drift {
        0%   { transform: scale(1)     translate3d(0, 0, 0); }
        100% { transform: scale(1.025) translate3d(-0.5%, -0.25%, 0); }
    }
}

@media (max-width: 380px) {
    .wrap {
        margin: 5dvh 10px 5dvh;
        padding: 24px 14px 22px;
    }
    h1 { font-size: 20px; }

    .tab {
        font-size: 9.5px;
        padding: 8px 2px;
        letter-spacing: 0.02em;
    }
}