.app-window {
    --window-surface:
        linear-gradient(180deg, rgba(255, 255, 255, calc(var(--window-opacity) + 0.02)), rgba(241, 246, 252, var(--window-opacity)));
    --window-surface-border: rgba(255, 255, 255, 0.32);
    --window-surface-divider: rgba(15, 23, 42, 0.08);
    position: absolute;
    z-index: 10;
    border-radius: var(--window-radius);
    overflow: hidden;
    width: 760px;
    height: 560px;
    background: var(--window-surface);
    border: 1px solid var(--window-surface-border);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.26),
        0 10px 24px rgba(var(--accent-rgb), 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: var(--ink);
}

.app-window.is-launching {
    animation: windowLaunch 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-window.is-maximized {
    inset: 34px 10px 84px !important;
    width: auto !important;
    height: auto !important;
    border-radius: var(--window-radius);
}

.window-chrome {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    padding: 10px 16px;
    background: var(--window-surface);
    border-bottom: 1px solid var(--window-surface-divider);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.window-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    font-size: 13px;
}

.window-title {
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.window-controls {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-controls button {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, filter 120ms ease;
}

.window-controls button::before {
    content: "";
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    color: rgba(0, 0, 0, 0.65);
    opacity: 0;
    transition: opacity 120ms ease;
}

.window-controls:hover button::before {
    opacity: 0.9;
}

.window-controls button[data-action="close"] {
    background: var(--macos-traffic-close, #ff5f56);
    order: 1;
}

.window-controls button[data-action="close"]::before {
    content: "×";
    font-size: 11px;
}

.window-controls button[data-action="minimize"] {
    background: var(--macos-traffic-min, #ffbd2e);
    order: 2;
}

.window-controls button[data-action="minimize"]::before {
    content: "−";
    font-size: 11px;
    margin-top: -2px;
}

.window-controls button[data-action="maximize"] {
    background: var(--macos-traffic-max, #27c93f);
    order: 3;
}

.window-controls button[data-action="maximize"]::before {
    content: "+";
    font-size: 10px;
}

.window-body {
    position: relative;
    height: calc(100% - 62px);
    overflow: auto;
    padding: 20px;
    background: var(--window-surface);
}

.window-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 24%, transparent 54%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 30%);
    pointer-events: none;
}

.window-body>* {
    position: relative;
    z-index: 1;
}

.window-body p,
.window-body li,
.window-body span,
.window-body strong,
.window-body h2,
.window-body h3,
.window-body h4 {
    color: var(--ink);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.content-grid,
.skills-grid,
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.stack-list strong {
    display: block;
    margin-bottom: 4px;
}

.timeline {
    display: grid;
    gap: 18px;
    padding-left: 14px;
    border-left: 2px solid rgba(var(--accent-rgb), 0.18);
}

.timeline-item {
    position: relative;
    padding-left: 20px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 8px;
    left: -23px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 1);
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.12);
}

.timeline-item h4,
.project-card h4,
.content-card h3 {
    margin: 0 0 8px;
}

.timeline-item p,
.project-card p,
.content-card p,
blockquote {
    margin: 0;
    line-height: 1.7;
}

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

.project-tag,
.contact-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(var(--accent-rgb), 1);
}

.project-workspace {
    display: grid;
    gap: 18px;
}

.project-workspace-head {
    align-items: flex-start;
}

.project-head-status,
.project-utility-chips,
.project-detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-grid--workspace {
    align-items: start;
}

.project-card--interactive,
.project-card--locked {
    display: grid;
    gap: 14px;
}

.project-card--interactive {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-card--interactive.is-selected {
    border-color: rgba(var(--accent-rgb), 0.26);
    box-shadow: 0 16px 32px rgba(var(--accent-rgb), 0.14);
}

.project-card--interactive.is-smart-highlight {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), rgba(255, 255, 255, 0.9));
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.project-card-title {
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.project-card-title:hover {
    color: rgba(var(--accent-rgb), 1);
}

.project-card-metrics {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted-ink);
    font-size: 0.78rem;
    font-weight: 600;
}

.project-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
    gap: 16px;
}

.project-detail-shell,
.project-compare-shell {
    display: grid;
    align-content: start;
}

.project-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.project-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
}

.project-detail-section {
    display: grid;
    gap: 6px;
}

.project-demo {
    display: grid;
    gap: 12px;
}

.project-demo-frame {
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(255, 255, 255, 0.92));
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.project-demo-topbar {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.08);
}

.project-demo-topbar span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.24);
}

.project-demo-stage {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.project-demo-panel,
.project-demo-grid article {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.project-demo-panel small,
.project-demo-grid small {
    color: var(--muted-ink);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.project-demo--embed iframe {
    width: 100%;
    min-height: 360px;
    border: none;
    display: block;
    background: #0f172a;
}

.project-compare-shell-inner {
    display: grid;
    gap: 14px;
}

.project-compare-table {
    display: grid;
    gap: 8px;
}

.project-compare-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.74);
}

.project-compare-row span {
    color: var(--muted-ink);
    font-weight: 700;
}

.project-compare-row strong {
    line-height: 1.5;
}

.project-compare-row--head {
    background: rgba(var(--accent-rgb), 0.1);
}

.project-empty-state {
    display: grid;
    gap: 8px;
}

.quick-hire-popup {
    position: fixed;
    right: 18px;
    bottom: 104px;
    z-index: 205;
    width: min(360px, calc(100vw - 20px));
}

.quick-hire-popup__shell {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.22), transparent 34%),
        linear-gradient(180deg, rgba(9, 16, 31, 0.96), rgba(14, 23, 42, 0.92));
    color: #eef4ff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.quick-hire-popup__shell p,
.quick-hire-popup__shell strong,
.quick-hire-popup__shell span,
.quick-hire-popup__shell h4 {
    color: inherit;
}

.quick-hire-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    min-width: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #eef4ff;
}

.notepad-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
}

.toolbar,
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar button,
.game-actions button,
.inline-actions button,
.upload-button {
    min-width: 110px;
}

#notepad-editor {
    width: 100%;
    min-height: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    resize: none;
    line-height: 1.7;
    font-family: var(--mono-font);
}

.status-bar {
    justify-content: space-between;
    color: var(--muted-ink);
    font-size: 0.84rem;
}

.tab-strip {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-button {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 14px;
}

.tab-button.is-active {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.2);
    color: rgba(var(--accent-rgb), 1);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.game-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted-ink);
}

.game-board {
    margin-top: 16px;
}

.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    max-width: 372px;
}

.mine-cell {
    aspect-ratio: 1;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-weight: 800;
}

.mine-cell.revealed {
    background: rgba(226, 232, 240, 0.8);
}

.mine-cell.mine {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.mine-cell.flagged {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

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

.memory-card {
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.9), rgba(15, 23, 42, 0.86));
    color: #f8fafc;
    font-weight: 800;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
}

.memory-card.revealed,
.memory-card.matched {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.snake-grid {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 4px;
    max-width: 430px;
}

.snake-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.snake-cell.snake {
    background: linear-gradient(135deg, #166534, #4ade80);
}

.snake-cell.head {
    background: linear-gradient(135deg, #14532d, #22c55e);
}

.snake-cell.food {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 120px));
    gap: 10px;
    justify-content: start;
}

.ttt-cell {
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 2rem;
    font-weight: 800;
}

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

.control-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.control-field input[type="color"] {
    width: 100%;
    height: 46px;
    border: none;
    padding: 0;
    background: transparent;
}

.control-field input[type="range"],
.control-field input[type="url"],
.control-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

.wallpaper-swatches {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.swatch {
    position: relative;
    height: 58px;
    border-radius: 18px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.22);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

.swatch.is-active {
    border-color: rgba(var(--accent-rgb), 0.42);
    box-shadow:
        0 0 0 3px rgba(var(--accent-rgb), 0.18),
        0 16px 28px rgba(15, 23, 42, 0.18);
}

.swatch.is-active::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
    pointer-events: none;
}

.swatch.bliss {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
        url("../img/img1.webp") center center / cover no-repeat;
}

.swatch.aurora {
    background: linear-gradient(135deg, #071223, #1d4ed8);
}

.swatch.sunset {
    background: linear-gradient(135deg, #7c2d12, #fdba74, #0f3f75);
}

.swatch.matrix {
    background: linear-gradient(135deg, #031613, #0f766e);
}

.swatch.graphite {
    background: linear-gradient(135deg, #111827, #475569);
}

#background-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.top-gap {
    margin-top: 16px;
}

@keyframes windowLaunch {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}