/*
 * Professional editorial skin
 *
 * This file intentionally changes presentation only. The site's existing
 * copy, labels, captions, navigation, games, and interactions remain intact.
 */

:root {
    --nav-height: 84px;
    --section-padding-vertical: 0px;
    --section-padding-horizontal: 0px;
    --background-color: #f3f0e8;
    --section-background: #f3f0e8;
    --post-background: #fffdf8;
    --contact-background: #e8e5dc;
    --navtext-color: #25364a;
    --yellow: #b58a49;
    --ink: #172638;
    --ink-soft: #425064;
    --paper: #f3f0e8;
    --paper-deep: #e9e4da;
    --surface: #fffdf8;
    --surface-muted: #f8f5ee;
    --line: rgba(23, 38, 56, 0.16);
    --line-strong: rgba(23, 38, 56, 0.28);
    --brass: #a97c3b;
    --brass-soft: #e7d8bd;
    --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
    --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --shadow-small: 0 8px 24px rgba(35, 42, 51, 0.07);
    --shadow-large: 0 22px 60px rgba(35, 42, 51, 0.10);
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.74), transparent 27rem),
        radial-gradient(circle at 88% 82%, rgba(208, 193, 165, 0.18), transparent 34rem),
        var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::after {
    display: none;
}

body > h1 {
    display: none;
    margin: 0 !important;
}

body > main {
    margin-top: 0 !important;
    padding-top: var(--nav-height);
}

::selection {
    color: #fff;
    background: var(--ink);
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
.gallery-item:focus-within {
    outline: 3px solid rgba(169, 124, 59, 0.48);
    outline-offset: 4px;
}

/* Navigation */

.glass-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    height: var(--nav-height);
    padding: 0 clamp(28px, 4vw, 72px);
    overflow: hidden;
    isolation: isolate;
    border: 0;
    border-radius: 0;
    background: rgba(250, 248, 242, 0.94);
    box-shadow: 0 1px 0 var(--line), 0 12px 36px rgba(29, 39, 50, 0.05);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.glass-nav::before {
    content: "";
    position: absolute;
    top: 50%;
    left: clamp(28px, 4vw, 72px);
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background:
        linear-gradient(90deg, transparent 48.5%, var(--ink) 49%, var(--ink) 51%, transparent 51.5%),
        linear-gradient(0deg, transparent 48.5%, var(--brass) 49%, var(--brass) 51%, transparent 51.5%),
        var(--surface);
    background-size: 18px 18px, 18px 18px, 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    filter: none;
    transform: translateY(-50%);
}

.glass-nav::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
    opacity: 0.64;
    transform: none;
}

.glass-nav a {
    position: relative;
    z-index: 4;
    flex: 0 0 9rem;
    width: auto;
    padding: 30px 12px 28px;
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    text-transform: uppercase;
    transition: color 180ms ease;
}

.glass-nav a::before {
    inset: 0;
    z-index: -1;
}

.glass-nav a:hover,
.glass-nav a.active-link {
    color: var(--ink);
    text-shadow: none;
}

.glass-nav .panel {
    position: absolute;
    top: 18px;
    bottom: auto;
    left: 0;
    z-index: 3;
    width: 9rem;
    min-width: 0;
    height: 48px;
    overflow: hidden;
    border: 1px solid rgba(169, 124, 59, 0.22);
    border-radius: 2px;
    background: rgba(231, 216, 189, 0.42);
    box-shadow: inset 0 -2px 0 var(--brass);
    opacity: 1;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform:
        translate3d(calc(var(--panel-offset-x) + var(--panel-shift-x)), 0, 0)
        skewX(var(--panel-tilt))
        scaleX(var(--panel-scale-x))
        scaleY(var(--panel-scale-y));
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-nav .panel > span,
.glass-nav .panel::before,
.glass-nav .panel::after {
    display: none;
}

/* Section shell */

main {
    position: relative;
}

main::before {
    content: "";
    position: fixed;
    inset: var(--nav-height) 0 auto;
    z-index: -1;
    height: 36vh;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.42), transparent 38%),
        repeating-linear-gradient(90deg, transparent 0 79px, rgba(23, 38, 56, 0.025) 80px);
    mask-image: linear-gradient(to bottom, #000, transparent);
}

main section {
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100svh - var(--nav-height));
    padding: 0;
    border: 0;
    background: transparent;
}

main section > h2 {
    display: none;
}

/* Interactive workbench */

.blog-container {
    display: grid;
    grid-template-columns: minmax(220px, 276px) minmax(0, 1fr);
    gap: clamp(20px, 2.4vw, 38px);
    width: min(100%, 1560px);
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100svh - var(--nav-height));
    margin: 0 auto;
    padding: clamp(24px, 3.2vw, 52px);
}

.preview-list {
    position: relative;
    align-self: start;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 10px 0;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: rgba(255, 253, 248, 0.74);
    box-shadow: var(--shadow-small);
}

#section1 .preview-list {
    --side-panel-highlight-opacity: 0;
}

#section1 .preview-list::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 42%),
        repeating-linear-gradient(0deg, transparent 0 47px, rgba(23, 38, 56, 0.023) 48px);
    opacity: 1;
}

#section1 .preview-list::after,
#section1 .preview-list .side-panel {
    display: none !important;
}

.preview-list .post:not(.static) {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 76px;
    margin: 0;
    padding: 17px 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease;
}

.preview-list .post:not(.static) + .post:not(.static)::before {
    content: "";
    position: absolute;
    inset: 0 22px auto;
    height: 1px;
    background: var(--line);
}

.preview-list .post:not(.static)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 22px;
    width: 7px;
    height: 7px;
    border-top: 1px solid var(--ink-soft);
    border-right: 1px solid var(--ink-soft);
    opacity: 0.62;
    transform: translateY(-50%) rotate(45deg);
    transition: right 180ms ease, opacity 180ms ease;
}

.preview-list .post:not(.static):hover {
    background: rgba(231, 216, 189, 0.24);
}

.preview-list .post:not(.static):hover::after {
    right: 18px;
    opacity: 1;
}

.preview-list .post.active:not(.static) {
    color: var(--surface);
    border: 0;
    background: var(--ink);
    box-shadow: inset 3px 0 0 var(--brass);
}

.preview-list .post.active:not(.static)::before {
    opacity: 0;
}

.preview-list .post.active:not(.static)::after {
    border-color: var(--brass-soft);
    opacity: 1;
}

.preview-list .post h3 {
    margin: 0;
    padding-right: 22px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 680;
    letter-spacing: 0.09em;
    line-height: 1.35;
    text-align: left;
    text-shadow: none;
    text-transform: uppercase;
}

.preview-list .post.active h3 {
    color: var(--surface);
    text-shadow: none;
}

.preview-list .post .preview,
.preview-list .post .full-body {
    display: none;
}

.post-detail {
    align-self: start;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    box-shadow: var(--shadow-large);
    font-size: 1rem;
}

.post-detail article {
    min-width: 0;
    background: var(--surface);
}

.post-detail article > h3:not([data-no-title]) {
    margin: 0;
    padding: 22px 28px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.post-detail article > h3[data-no-title] {
    display: none;
}

.post-detail .full-body {
    display: block;
    min-width: 0;
}

.post-detail iframe {
    display: block;
    width: 100%;
    height: clamp(560px, calc(100svh - 220px), 720px) !important;
    min-height: 560px;
    margin: 0;
    border: 0 !important;
    background: #fff;
}

.post-detail iframe[src="assets/hummingbirds.html"] {
    height: clamp(480px, calc(100svh - 250px), 680px) !important;
    min-height: 480px;
}

.post-detail iframe[src^="coin.html"] {
    height: clamp(640px, calc(100svh - 150px), 820px) !important;
    min-height: 640px;
}

.post-detail iframe[src="solitaire.html"],
.post-detail iframe[src="minesweeper.html"] {
    height: 980px !important;
    min-height: 980px;
}

.tetris-controls {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 14px 20px 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.tetris-controls .tetris-website-fullscreen-btn {
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    color: var(--ink);
    background: transparent;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.tetris-controls .tetris-website-fullscreen-btn:hover {
    color: #fff;
    border-color: var(--ink);
    background: var(--ink);
}

.tetris-notes,
.solitaire-notes {
    margin: 0;
    padding: 8px 22px 22px;
    color: #5c6673;
    background: var(--surface);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    line-height: 1.65;
}

/* Photography */

#section2 {
    padding: clamp(24px, 3.4vw, 54px);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 30px);
    width: min(100%, 1450px);
    margin: 0 auto;
    padding: 0;
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface-muted);
    box-shadow: var(--shadow-small);
    cursor: zoom-in;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.gallery-item:hover {
    z-index: 2;
    border-color: var(--line-strong);
    box-shadow: 0 18px 48px rgba(35, 42, 51, 0.14);
    transform: translateY(-4px);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    box-shadow: none;
    filter: saturate(0.88) contrast(0.98);
    transform: none !important;
    transition: filter 260ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
    filter: saturate(1) contrast(1);
    transform: scale(1.025) !important;
}

.gallery-item .description {
    position: absolute;
    inset: auto 0 0;
    max-height: none;
    padding: 13px 16px;
    overflow: hidden;
    border-top: 1px solid rgba(23, 38, 56, 0.12);
    color: var(--ink);
    background: rgba(255, 253, 248, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    line-height: 1.3;
    text-align: left;
    text-transform: uppercase;
}

/* Gallery modal */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: clamp(20px, 5vw, 72px);
    visibility: hidden;
    opacity: 0;
    background: rgba(12, 20, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: zoom-out;
    transition: visibility 220ms ease, opacity 220ms ease;
}

.modal.show {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.modal img {
    width: auto;
    max-width: min(92vw, 1400px);
    height: auto;
    max-height: 78vh;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

.modal-caption {
    max-width: 80ch;
    padding: 18px 12px 0;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
}

/* Coin flip */

#section3 {
    padding: clamp(24px, 3.4vw, 54px);
}

#section3 > iframe {
    display: block;
    width: min(100%, 1220px);
    height: clamp(640px, calc(100svh - 150px), 820px) !important;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: 4px;
    background: var(--surface);
    box-shadow: var(--shadow-large);
}

/* Full-screen game states */

body.tetris-website-fullscreen > main,
body.solitaire-website-fullscreen > main,
body.minesweeper-website-fullscreen > main {
    padding-top: 0;
}

body.tetris-website-fullscreen #section1 .post-detail,
body.solitaire-website-fullscreen #section1 .post-detail,
body.minesweeper-website-fullscreen #section1 .post-detail {
    align-self: stretch;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    box-shadow: none;
}

body.tetris-website-fullscreen #section1 .post-detail article,
body.tetris-website-fullscreen #section1 .post-detail .full-body,
body.solitaire-website-fullscreen #section1 .post-detail article,
body.solitaire-website-fullscreen #section1 .post-detail .full-body,
body.minesweeper-website-fullscreen #section1 .post-detail article,
body.minesweeper-website-fullscreen #section1 .post-detail .full-body {
    height: 100%;
    min-height: 100%;
}

body.tetris-website-fullscreen #section1 .post-detail iframe[src="tetris.html"],
body.solitaire-website-fullscreen #section1 .post-detail iframe[src="solitaire.html"],
body.minesweeper-website-fullscreen #section1 .post-detail iframe[src="minesweeper.html"] {
    height: 100% !important;
    min-height: 100% !important;
}

body.tetris-website-fullscreen .tetris-controls {
    padding: 0;
    border: 0;
    background: transparent;
}

/* Responsive */

@media (max-width: 980px) {
    .glass-nav {
        padding-right: 24px;
        padding-left: 24px;
    }

    .glass-nav::before {
        left: 24px;
    }

    .glass-nav a,
    .glass-nav .panel {
        width: 7.4rem;
        flex-basis: 7.4rem;
    }

    .blog-container {
        grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
        padding: 24px;
    }

    .preview-list .post:not(.static) {
        min-height: 70px;
        padding: 15px 18px;
    }

    .preview-list .post:not(.static)::after {
        right: 17px;
    }

    .preview-list .post h3 {
        font-size: 0.69rem;
    }
}

@media (max-width: 760px) {
    :root {
        --nav-height: 68px;
    }

    .glass-nav {
        justify-content: space-between;
        padding: 0 12px;
    }

    .glass-nav::before {
        display: none;
    }

    .glass-nav a {
        flex: 1 1 0;
        width: auto;
        padding: 25px 4px 23px;
        font-size: clamp(0.63rem, 2.8vw, 0.72rem);
        letter-spacing: 0.08em;
    }

    .glass-nav .panel {
        top: 11px;
        width: calc((100% - 24px) / 2);
        height: 46px;
    }

    .blog-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        min-height: 0;
        padding: 16px;
    }

    .preview-list {
        display: flex;
        gap: 5px;
        width: 100%;
        padding: 5px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        border-radius: 3px;
        scrollbar-width: none;
    }

    .preview-list::-webkit-scrollbar {
        display: none;
    }

    #section1 .preview-list::before {
        background: rgba(255, 253, 248, 0.82);
    }

    .preview-list .post:not(.static) {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 11px 15px;
        border-radius: 2px;
    }

    .preview-list .post:not(.static) + .post:not(.static)::before,
    .preview-list .post:not(.static)::after {
        display: none;
    }

    .preview-list .post.active:not(.static) {
        box-shadow: inset 0 -2px 0 var(--brass);
    }

    .preview-list .post h3 {
        padding: 0;
        font-size: 0.65rem;
        white-space: nowrap;
    }

    .post-detail iframe {
        height: clamp(500px, calc(100svh - 175px), 680px) !important;
        min-height: 500px;
    }

    .post-detail article > h3:not([data-no-title]) {
        padding: 18px 20px;
    }

    #section2,
    #section3 {
        padding: 16px;
    }

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

    .gallery-item .description {
        padding: 10px 12px;
        font-size: 0.62rem;
    }

    #section3 > iframe {
        height: calc(100svh - var(--nav-height) - 32px) !important;
        min-height: 580px;
    }
}

@media (max-width: 520px) {
    .gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .gallery-item {
        aspect-ratio: 4 / 3;
    }

    .tetris-controls {
        padding-right: 14px;
        padding-left: 14px;
    }

    .tetris-notes,
    .solitaire-notes {
        padding-right: 16px;
        padding-left: 16px;
        font-size: 0.67rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
