/*
    The year is 2005. Everything is possible. Skeuomorphism
    is alive. The future is glossy-translucent and full of hope.
                                                                   */

/* Colour lives in themes.css. Only non-colour design tokens belong here --
   they're identical across every theme, so there's nothing to switch. */
:root {
    --glass-blur: 14px;
    --container-width: 780px;
    --panel-radius: 10px;
    --btn-radius: 6px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* the nav is sticky, so anchor jumps (footnotes, headings) land under it
   without this */
[id] { scroll-margin-top: 62px; }

body {
    font-family: Tahoma, "Segoe UI", Verdana, Geneva, sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);

    background: var(--body-bg);
    background-attachment: fixed;
    min-height: 100vh;
}


.construction {
    background: repeating-linear-gradient(
        -45deg,
        #f5c518, #f5c518 10px,
        #222 10px, #222 20px
    );
    padding: 4px 0;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 1px rgba(var(--ink-rgb), 0.6);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.construction marquee {
    padding: 2px 0;
}


nav {
    background: var(--nav-bg);
    border-bottom: 2px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    padding: 6px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 4px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.site-title {
    color: var(--text-on-accent);
    text-decoration: none;
    font-size: 17px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(var(--ink-rgb), 0.35);
    letter-spacing: 0.5px;
}

/* Beta marking. Every page carries both states and CSS chooses, keyed off the
   data-site attribute that layout.php stamps pre-paint from the hostname. That
   keeps dist/ byte-identical on main and beta, so the sync workflow's
   fast-forward can never wipe the markers. Hidden is the default, so
   production needs no attribute and no JS. */
.beta-tag, .beta-disabled { display: none }
[data-site="beta"] .beta-tag { display: inline }
[data-site="beta"] .beta-disabled { display: block }
/* !important because #gb-actions and #wm-form carry display:flex in an inline
   style attribute, which otherwise wins over any rule here. */
[data-site="beta"] #gb-actions,
[data-site="beta"] #wm-form,
[data-site="beta"] #gb-email-form { display: none !important }

/* Stands in for a control that only works on production. Tinted with the
   existing accent triple so it needs no new token in themes.css. */
.beta-disabled {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px dashed rgba(var(--accent-rgb), 0.4);
    border-radius: 4px;
    background: rgba(var(--accent-rgb), 0.06);
}

/* Inherits the title's colour deliberately -- no token needed, so this works
   on all four palettes without touching themes.css. */
.beta-tag {
    font-size: 13px;
    font-weight: normal;
    opacity: 0.75;
    letter-spacing: 0;
}

.site-title:hover {
    text-shadow: 1px 1px 5px rgba(var(--ink-rgb), 0.5),
                 0 0 10px rgba(var(--sheen-rgb), 0.25);
}

.nav-links {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-on-accent);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 12px;
    text-shadow: 0 1px 1px rgba(var(--ink-rgb), 0.25);
    transition: background 0.15s;
}

.nav-links a:hover {
    background: rgba(var(--sheen-rgb), 0.22);
}

.nav-links a:active {
    background: rgba(var(--ink-rgb), 0.1);
}

/* the theme picker. lives inside .nav-links so it inherits the flex row and
   both breakpoints for free -- but it's a <select>, so `.nav-links a` above
   doesn't reach it and it needs its own rule. styled as an XP combobox. */
.theme-picker {
    font-family: inherit;
    font-size: 11px;
    color: var(--text);
    /* must follow the theme: --text is near-white on the dark themes, so a
       fixed white background here renders the control blank. */
    background: var(--input-bg);
    border: 1px solid rgba(var(--sheen-rgb), 0.35);
    border-radius: 3px;
    padding: 3px 4px;
    margin-left: 6px;
    align-self: center;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.18);
    max-width: 120px;
}

.theme-picker:hover {
    border-color: rgba(var(--sheen-rgb), 0.60);
}

.theme-picker:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 1px;
}

/* the label is for screen readers only -- the control reads as a theme
   switcher without spending nav width on the word. */
.theme-picker-label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.container {
    max-width: var(--container-width);
    margin: 20px auto;
    padding: 0 16px;
}


.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--panel-radius);
    padding: 24px 28px;
    margin-bottom: 18px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 48%;
    background: var(--panel-sheen);
    pointer-events: none;
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
}

/* .glass-panel::before is absolutely positioned, so by default stacking
   rules it paints above static-flow content near the top of the panel --
   lift every direct child above it once here, rather than re-patching each
   new content type (see the now-redundant fixes on .post-body/.photo-grid). */
.glass-panel > * {
    position: relative;
    z-index: 1;
}

.glass-panel h2 {
    font-size: 17px;
    color: var(--luna-blue-dark);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
    position: relative;
}


.hero {
    text-align: center;
    padding: 36px 28px;
}

.hero h1 {
    font-size: 24px;
    color: var(--luna-blue-dark);
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.08);
}

.hero .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.duck-ascii {
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    line-height: 1.2;
    color: var(--duck);
    margin-bottom: 14px;
    display: inline-block;
    text-align: left;
    text-shadow: 0 1px 0 rgba(var(--ink-rgb), 0.06);
}


.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: var(--card-sheen);
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--shadow-rgb), 0.12);
}

.project-card h3 {
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--luna-blue);
    position: relative;
}

.project-card p {
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
}

.project-card a {
    font-size: 12px;
    display: inline-block;
    margin-top: 8px;
    position: relative;
}


.post-preview {
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.06);
}

.post-preview:last-child { border-bottom: none; }

.post-preview h3 {
    font-size: 14px;
    margin-bottom: 2px;
}

.post-preview h3 a {
    color: var(--link);
    text-decoration: none;
}

.post-preview h3 a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.post-preview time {
    font-size: 11px;
    color: var(--text-light);
}

.post-preview .excerpt {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.h-entry > .post-tags {
    margin-bottom: 18px;
}

.tag-chip {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--luna-blue);
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover {
    color: var(--link-hover);
    background: var(--glass-bg-hover);
    border-color: var(--luna-blue-light);
}


/* sits above .glass-panel::before so content isn't washed out by the highlight */
.post-body {
    line-height: 1.85;
    position: relative;
    z-index: 1;
}
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
    margin-top: 22px;
    margin-bottom: 8px;
    color: var(--luna-blue-dark);
}
.post-body h1 { font-size: 20px; }
.post-body h2 { font-size: 17px; }
.post-body h3 { font-size: 15px; }

.post-body p   { margin-bottom: 12px; }
.post-body a   { color: var(--link); }
.post-body a:hover { color: var(--link-hover); }

.post-body pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 14px;
    overflow-x: auto;
    margin: 14px 0;
    font-size: 12px;
}

.post-body code {
    font-family: "Courier New", Consolas, monospace;
    font-size: 12px;
}

.post-body p code,
.post-body li code {
    background: var(--inline-code-bg);
    padding: 1px 5px;
    border-radius: 3px;
}

/* cap the height too, otherwise portrait shots run the full column width
   and end up absurdly tall. width:auto keeps the aspect ratio. */
.post-body img {
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    margin: 12px auto;
    display: block;
}

.post-body video {
    max-width: 100%;
    max-height: 600px;
    border-radius: 6px;
    margin: 12px auto;
    display: block;
}

/* .table-wrap lets wide tables scroll instead of blowing out the column */
.post-body .table-wrap {
    overflow-x: auto;
    margin: 14px 0;
}

.post-body table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.post-body th,
.post-body td {
    padding: 7px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}

.post-body thead th {
    color: var(--luna-blue-dark);
    background: rgba(var(--accent-rgb), 0.06);
    border-bottom: 2px solid rgba(var(--accent-rgb), 0.22);
}

.post-body tbody tr:last-child td { border-bottom: none; }

.post-body blockquote {
    border-left: 3px solid var(--luna-blue-light);
    padding: 8px 16px;
    margin: 14px 0;
    background: rgba(var(--accent-rgb), 0.04);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-body ul, .post-body ol {
    margin: 10px 0 10px 24px;
}

.post-body li { margin-bottom: 4px; }

.post-body hr {
    border: none;
    border-top: 1px solid rgba(var(--accent-rgb), 0.10);
    margin: 22px 0;
}

/* the divider under a post/reply/place header. was an inline style duplicated
   across five templates -- one class so it tracks the theme. */
hr.rule {
    border: none;
    border-top: 1px solid rgba(var(--accent-rgb), 0.10);
    margin-bottom: 20px;
}

/* footnotes are <details> accordions. the number sits in the summary where a
   list marker used to, so they still read as a numbered set when collapsed. */
.post-body .footnote {
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.035);
    margin: 6px 0;
    padding: 0 12px;
    font-size: 13px;
}

.post-body .footnote[open] { padding-bottom: 10px; }

/* summary is full-bleed, the content sits in the padding above. keeping the
   inset off the children so nested lists keep their own indent. */
.post-body .footnote > summary {
    margin: 0 -12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-weight: bold;
    color: var(--luna-blue-dark);
    border-radius: 6px;
    list-style: none;
}

.post-body .footnote > summary::-webkit-details-marker { display: none; }

.post-body .footnote > summary:hover { background: rgba(var(--accent-rgb), 0.08); }

.post-body .footnote > summary::after {
    content: "\25B8";
    display: inline-block;
    margin-left: auto;
    font-weight: normal;
    opacity: 0.55;
    transition: transform 0.15s;
}

.post-body .footnote[open] > summary::after { transform: rotate(90deg); }

.post-body .fn-num {
    flex-shrink: 0;
    min-width: 20px;
    padding: 1px 4px;
    text-align: center;
    font-size: 11px;
    background: rgba(var(--accent-rgb), 0.14);
    border-radius: 3px;
}

.post-body .footnote > summary + * { margin-top: 10px; }
.post-body .footnote > :last-child { margin-bottom: 0; }

.post-body .fn-back {
    padding-top: 8px;
    font-size: 12px;
}

/* so you can see which one you landed on after clicking a ref */
.post-body .footnote:target {
    border-color: var(--luna-blue-light);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}


.links-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}


.button {
    display: inline-block;
    padding: 6px 18px;
    background: var(--btn-bg);
    color: var(--btn-text) !important;
    text-decoration: none !important;
    border-radius: var(--btn-radius);
    font-size: 12px;
    font-weight: bold;
    border: 1px solid var(--btn-border);
    box-shadow:
        inset 0 1px 0 rgba(var(--sheen-rgb), 0.32),
        0 1px 3px rgba(var(--shade-rgb), 0.18);
    text-shadow: 0 -1px 0 rgba(var(--ink-rgb), 0.20);
    transition: all 0.12s ease;
    position: relative;
}

.button::before {
    content: '';
    position: absolute;
    top: 1px; left: 1px; right: 1px;
    height: 44%;
    background: var(--btn-sheen);
    border-radius: var(--btn-radius) var(--btn-radius) 50% 50%;
    pointer-events: none;
}

.button:hover {
    background: var(--btn-bg-hover);
    box-shadow:
        inset 0 1px 0 rgba(var(--sheen-rgb), 0.42),
        0 2px 6px rgba(var(--shade-rgb), 0.28);
}

.button:active {
    background: var(--btn-bg-active);
    box-shadow: inset 0 2px 4px rgba(var(--shade-rgb), 0.30);
}

/* the semantic/brand variants pin their label to white rather than picking up
   --btn-text, which would go dark on a light theme like Silver. All three come
   from theme tokens so the dark themes can darken them; every variant stays
   dark enough for a white label. */
.button-green, .button-blurple, .button-orange {
    color: #fff !important;
}

.button-green {
    background: var(--btn-green-bg);
    border-color: var(--btn-green-border);
}

.button-green:hover {
    background: var(--btn-green-bg-hover);
}

.button-green:active {
    background: var(--btn-green-bg-active);
}

.button-blurple {
    background: var(--btn-blurple-bg);
    border-color: var(--btn-blurple-border);
}

.button-blurple:hover {
    background: var(--btn-blurple-bg-hover);
}

.button-blurple:active {
    background: var(--btn-blurple-bg-active);
}


.button-orange {
    background: var(--btn-orange-bg);
    border-color: var(--btn-orange-border);
}

.button-orange:hover {
    background: var(--btn-orange-bg-hover);
}

.button-orange:active {
    background: var(--btn-orange-bg-active);
}

/* badge shelf. one flex row, wraps, left aligned. add badges as children. */
.badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

/* classic 88x31 buttons: keep them crisp, no link underline/colour bleed */
.badges a {
    display: inline-flex;
    line-height: 0;
    border: 0;
}

.badges img {
    display: block;
    image-rendering: pixelated;
}

/* the carbon badge ships its own centred styles, override them */
#wcb.carbonbadge {
    text-align: left !important;
    font-size: 13px !important;
}

.guestbook-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gb-entry {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--gb-bg);
    border: 1px solid var(--gb-border);
    border-radius: 8px;
}

.gb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}

.gb-avatar-default {
    background: rgba(var(--accent-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-light);
}

.gb-content strong {
    font-size: 13px;
    color: var(--luna-blue-dark);
}

.gb-content time {
    font-size: 10px;
    color: var(--text-light);
    margin-left: 6px;
}

.gb-content p {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.photo-grid img {
    width: 100%;
    border-radius: 6px;
    display: block;
    cursor: pointer;
    transition: transform 0.15s;
}

.photo-grid img:hover {
    transform: scale(1.02);
}



.photo-grid video {
    width: 100%;
    border-radius: 6px;
}

.easter-egg-hint {
    margin-top: 8px;
}

.secret-link {
    font-size: 9px;
    color: var(--secret-link) !important;
    text-decoration: none !important;
    transition: color 0.3s;
    cursor: default;
}

.secret-link:hover {
    color: var(--link) !important;
    cursor: pointer;
    text-decoration: underline !important;
}


.lastfm-track {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
}

.lastfm-track:last-child { border-bottom: none; }

.lastfm-art {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(var(--shade-rgb), 0.15);
}

.lastfm-art-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.08);
    font-size: 18px;
    color: var(--text-light);
}

.lastfm-meta {
    min-width: 0;
    flex: 1;
}

.lastfm-title {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: var(--luna-blue-dark);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lastfm-title:hover { color: var(--link-hover); text-decoration: underline; }

.lastfm-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lastfm-when {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.lastfm-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--live);
    font-weight: bold;
}

.lastfm-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}

.lastfm-eq i {
    width: 2px;
    background: var(--live);
    display: block;
    animation: lastfm-eq-bounce 0.9s ease-in-out infinite;
}

.lastfm-eq i:nth-child(1) { animation-delay: 0s; }
.lastfm-eq i:nth-child(2) { animation-delay: 0.2s; }
.lastfm-eq i:nth-child(3) { animation-delay: 0.4s; }

@keyframes lastfm-eq-bounce {
    0%, 100% { height: 3px; }
    50% { height: 10px; }
}


footer {
    max-width: var(--container-width);
    margin: 8px auto 30px;
    padding: 16px 20px;
    text-align: center;
    font-size: 11px;
    color: var(--footer-text);
    text-shadow: var(--footer-shadow);
}

footer a { color: var(--footer-link); }

.visitor-counter {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    background: var(--counter-bg);
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--counter-text);
}


a {
    color: var(--link);
    transition: color 0.12s;
}

a:hover { color: var(--link-hover); }

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-light);
    text-decoration: none;
}

.back-link:hover { color: var(--link); text-decoration: underline; }

.back-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.back-links .back-link { margin-bottom: 0; }

.post-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 18px;
}

.section-link {
    margin-top: 10px;
    font-size: 12px;
}


@media (max-width: 640px) {
    .nav-inner {
        justify-content: center;
        text-align: center;
    }
    .nav-links { justify-content: center; }

    /* nav wraps onto two rows down here */
    [id] { scroll-margin-top: 96px; }

    .glass-panel { padding: 18px 16px; }
    .hero { padding: 28px 16px; }
    .hero h1 { font-size: 20px; }

    .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .nav-links a { padding: 4px 8px; font-size: 11px; }
    body { font-size: 12px; }
}
