@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 6%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 6%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 40%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 16%;
    --input: 0 0% 16%;
    --ring: 0 0% 83.1%;
    --radius: 0.625rem;
    --success: 142 70% 35%;
    --info: 262 60% 55%;
    --teal: 173 58% 34%;
}

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

html {
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: Geist, ui-sans-serif, system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body:has(.music-player) {
    padding-bottom: 6.5rem;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--background) / 0.85);
    backdrop-filter: blur(12px);
    padding-top: env(safe-area-inset-top);
}

.site-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.9rem max(1.5rem, env(safe-area-inset-right)) 0.9rem max(1.5rem, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.wordmark {
    display: inline;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.1;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: hsl(var(--accent));
}

.nav-toggle-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.15rem;
}

.nav-toggle-bars span {
    display: block;
    height: 2px;
    width: 100%;
    background: hsl(var(--foreground));
    border-radius: 999px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    height: 2.5rem;
    padding: 0 0.9rem;
    border-radius: calc(var(--radius) - 4px);
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--accent));
}

.search-container {
    margin-left: auto;
    flex-shrink: 0;
}

.search-container input,
.input,
input[type="text"],
input[type="password"],
textarea,
select {
    height: 2.75rem;
    width: 100%;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--input));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    padding: 0 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-container input {
    width: 14rem;
}

textarea {
    height: auto;
    padding: 0.75rem 0.9rem;
    resize: vertical;
    min-height: 6.5rem;
}

.search-container input:focus,
.input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.search-container input.error,
input.error {
    border-color: hsl(var(--destructive));
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.25);
}

.search-container input::placeholder,
input::placeholder,
textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

main {
    flex: 1 0 auto;
    max-width: 52rem;
    margin: 0 auto;
    width: 100%;
    padding: 2.75rem max(1.5rem, env(safe-area-inset-right)) 4.5rem max(1.5rem, env(safe-area-inset-left));
}

main.wide {
    max-width: 72rem;
}

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    padding: 1.35rem max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}

.site-footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
    line-height: 1.55;
}

.site-footer-inner p + p {
    margin-top: 0.3rem;
}

.page-header {
    margin-bottom: 2rem;
}

.profile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    flex-wrap: wrap;
}

.profile-heading h1 {
    margin: 0;
}

.message-ben-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 1.1rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.message-ben-btn:hover {
    background: hsl(var(--secondary) / 0.8);
}

.message-ben-box {
    margin: -1rem 0 1.75rem;
}

.message-ben-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.45rem;
}

.message-ben-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.message-success {
    color: hsl(142 70% 55%) !important;
}

.message-cell {
    max-width: 28rem;
    white-space: normal;
    line-height: 1.5;
}

.page-header h1,
.user-display h2 {
    font-size: 2.15rem;
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.page-header p,
.lead {
    margin-top: 0.55rem;
    color: hsl(var(--muted-foreground));
    font-size: 1.05rem;
}

.user-display {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.card {
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 2px hsl(0 0% 0% / 0.25);
}

.card-header {
    padding: 1.5rem 1.65rem 0.35rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.card-description {
    margin-top: 0.3rem;
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 1.4rem 1.65rem 1.65rem;
}

.card-content p + p {
    margin-top: 0.85rem;
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
}

.video-frame video,
.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

button {
    font-family: inherit;
    cursor: pointer;
}

.btn,
button.btn-primary,
button.btn-edit,
button.btn-save,
button.btn-cancel,
button.btn-delete,
button.btn-posts,
button.btn-music,
button.btn-danger-small,
.stuff-card-btn,
.password-input-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.75rem;
    padding: 0 1.1rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary,
.password-input-row button,
.btn-save {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-primary:hover,
.password-input-row button:hover,
.btn-save:hover {
    background: hsl(var(--primary) / 0.9);
}

.btn-outline,
.btn-cancel,
.stuff-card-btn {
    background: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.btn-outline:hover,
.btn-cancel:hover,
.stuff-card-btn:hover {
    background: hsl(var(--accent));
}

.btn-secondary,
.btn-edit,
.btn-posts,
.btn-music {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover,
.btn-edit:hover,
.btn-posts:hover,
.btn-music:hover {
    background: hsl(var(--secondary) / 0.8);
}

.btn-delete,
.btn-danger-small {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-delete:hover,
.btn-danger-small:hover {
    background: hsl(0 72% 48%);
}

.btn-sm {
    height: 2.4rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
}

.btn-posts,
.btn-edit,
.btn-music,
.btn-save,
.btn-cancel,
.btn-delete,
.btn-danger-small {
    height: 2.4rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.badge-muted {
    color: hsl(var(--muted-foreground));
    background: transparent;
}

/* ── Home / credits ─────────────────────────────────────────────────────── */

.index-content {
    color: hsl(var(--muted-foreground));
}

.index-content p + p {
    margin-top: 0.75rem;
}

.content-text p {
    color: hsl(var(--muted-foreground));
}

/* ── Profile posts ──────────────────────────────────────────────────────── */

.profile-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem 1.15rem;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: hsl(var(--muted-foreground));
}

.post-like-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.9rem;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.4rem;
    padding: 0 0.85rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: transparent;
    color: hsl(var(--muted-foreground));
    font-size: 0.95rem;
    font-weight: 500;
}

.like-btn:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}

.like-btn.liked {
    color: hsl(0 80% 68%);
    border-color: hsl(0 80% 68% / 0.4);
}

.like-heart {
    font-size: 1.05rem;
    line-height: 1;
}

.no-posts {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
}

.blog-date {
    margin: -0.15rem 0 0.75rem;
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
}

.blog-sort {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
    font-weight: 500;
}

.blog-sort select {
    width: auto;
    min-width: 10.5rem;
}

.post-image {
    max-width: 100%;
    display: block;
    border-radius: calc(var(--radius) - 4px);
    margin-bottom: 0.85rem;
    border: 1px solid hsl(var(--border));
}

/* ── Admin ──────────────────────────────────────────────────────────────── */

.admin-password-form {
    max-width: 26rem;
    margin: 3rem auto 0;
    padding: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.admin-password-form h2 {
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}

.admin-password-form > p {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.password-input-row {
    display: flex;
    gap: 0.5rem;
}

.password-input-row input {
    flex: 1;
}

.password-input-row button {
    flex-shrink: 0;
}

.admin-error {
    color: hsl(0 90% 70%);
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.admin-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.config-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.config-tab {
    position: relative;
    height: 2.75rem;
    padding: 0 1.15rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: transparent;
    color: hsl(var(--muted-foreground));
    font-size: 0.95rem;
    font-weight: 500;
}

.config-tab:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}

.config-tab.active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: transparent;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.4rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: hsl(0 80% 55%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.config-tab.active .tab-badge {
    background: hsl(0 80% 48%);
}

.admin-header-row h2 {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.admin-section {
    margin-bottom: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem 1.55rem;
}

.admin-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    font-size: 1rem;
}

.admin-table th {
    text-align: left;
    padding: 0.8rem 0.85rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 1px solid hsl(var(--border));
}

.admin-table td {
    padding: 0.9rem 0.85rem;
    border-bottom: 1px solid hsl(var(--border));
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover td {
    background: hsl(var(--muted) / 0.35);
}

.user-id-input,
.user-bio-input {
    height: 2.5rem;
    padding: 0 0.7rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem;
    width: 100%;
    max-width: 14rem;
}

.action-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-form {
    max-width: 24rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.85rem;
}

.form-row label {
    font-size: 0.95rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.4rem;
}

.optional {
    color: hsl(var(--muted-foreground));
    font-weight: 400;
}

.form-row input[type="file"] {
    height: auto;
    padding: 0.45rem 0;
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    box-shadow: none;
}

.form-row input[type="file"]:focus {
    box-shadow: none;
}

/* ── Posts / music manager ──────────────────────────────────────────────── */

.posts-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.posts-manager-header h3 {
    margin-bottom: 0;
}

.posts-manager-header span {
    color: hsl(var(--foreground));
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.post-admin-card {
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    padding: 1rem 1.1rem;
    margin-bottom: 0.7rem;
}

.post-admin-view {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.post-admin-info {
    flex: 1;
    min-width: 0;
}

.post-admin-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.post-admin-content {
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.post-admin-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.post-admin-edit-form {
    margin-top: 0.85rem;
    border-top: 1px solid hsl(var(--border));
    padding-top: 0.85rem;
}

.post-edit-btns {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.posts-add-form,
.music-upload-form {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid hsl(var(--border));
    max-width: 36rem;
}

.posts-add-form h4,
.music-upload-form h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.85rem;
}

.no-posts-admin {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.music-admin-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    padding: 0.85rem 1rem;
    margin-bottom: 0.7rem;
}

.music-admin-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.music-admin-filename {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-family: 'Geist Mono', ui-monospace, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-admin-thumbnail {
    max-width: 5.5rem;
    max-height: 4rem;
    object-fit: cover;
    display: block;
    margin: 0.4rem 0;
    border-radius: 0.35rem;
    border: 1px solid hsl(var(--border));
}

.post-edit-image-current {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.5rem;
}

.post-edit-remove-image-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.8rem;
    cursor: pointer;
}

/* ── Music player ───────────────────────────────────────────────────────── */

.music-player {
    position: fixed;
    top: 4.5rem;
    left: 1rem;
    z-index: 50;
    min-width: 14.5rem;
    max-width: 16.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    box-shadow: 0 10px 30px hsl(0 0% 0% / 0.4);
}

.music-player-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.music-note {
    color: hsl(var(--muted-foreground));
    font-size: 0.8rem;
}

.music-track-name {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.music-minimize-btn {
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.15rem;
    line-height: 1;
}

.music-minimize-btn:hover {
    color: hsl(var(--foreground));
}

.music-controls-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.music-play-btn {
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    width: 1.7rem;
    height: 1.7rem;
    border-radius: calc(var(--radius) - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.music-play-btn:hover {
    background: hsl(var(--accent));
}

.music-progress {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: hsl(var(--muted));
    outline: none;
    cursor: pointer;
    border-radius: 999px;
}

.music-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    background: hsl(var(--primary));
    cursor: pointer;
    border-radius: 50%;
}

.music-progress::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: hsl(var(--primary));
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.music-time {
    font-size: 0.7rem;
    color: hsl(var(--muted-foreground));
    font-variant-numeric: tabular-nums;
    min-width: 1.9rem;
    text-align: right;
}

/* ── Stuff grid ─────────────────────────────────────────────────────────── */

.stuff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.stuff-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.45rem 1.4rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transition: border-color 0.15s, background 0.15s;
}

.stuff-card:hover {
    border-color: hsl(var(--ring) / 0.35);
    background: hsl(var(--card));
}

.stuff-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stuff-card-title svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    stroke: hsl(var(--muted-foreground));
}

.stuff-card-desc {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
    flex: 1;
}

.stuff-card-btn {
    align-self: flex-start;
    margin-top: 0.35rem;
    min-width: 7.5rem;
    text-decoration: none;
    box-sizing: border-box;
}

.gallery-choice {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.back-link {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 1.05rem;
}

.back-link:hover {
    color: hsl(var(--foreground));
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .stuff-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wordmark {
        font-size: 1.5rem;
    }

    .site-header-inner {
        flex-wrap: wrap;
        padding: 0.85rem max(1rem, env(safe-area-inset-right)) 0.9rem max(1rem, env(safe-area-inset-left));
        gap: 0.75rem;
        align-items: center;
    }

    .nav-toggle {
        display: inline-flex;
        order: 2;
    }

    .site-nav {
        display: none;
        order: 4;
        flex: 1 1 100%;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        padding: 0.4rem;
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        background: hsl(var(--card));
    }

    .site-header.nav-open .site-nav {
        display: flex;
    }

    .nav-link {
        height: 2.85rem;
        font-size: 1.05rem;
        padding: 0 0.95rem;
        width: 100%;
        justify-content: flex-start;
    }

    .search-container {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0;
    }

    .search-container input {
        width: 100%;
        height: 3rem;
        font-size: 1.0625rem;
    }

    main {
        padding: 1.75rem max(1rem, env(safe-area-inset-right)) 4rem max(1rem, env(safe-area-inset-left));
    }

    .page-header h1,
    .user-display h2,
    .admin-header-row h2 {
        font-size: 1.85rem;
    }

    .page-header p,
    .lead {
        font-size: 1.05rem;
    }

    .message-ben-btn {
        width: 100%;
    }

    .blog-sort {
        width: 100%;
    }

    .blog-sort select {
        width: 100%;
        min-width: 0;
    }

    .admin-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .config-tab {
        flex: 1;
        min-width: 10rem;
    }

    .admin-header-row .btn-danger-small {
        width: 100%;
        height: 3rem;
        font-size: 1rem;
    }

    .password-input-row {
        flex-direction: column;
    }

    .password-input-row button,
    .btn-primary {
        width: 100%;
        height: 3rem;
        font-size: 1rem;
    }

    .admin-form {
        max-width: 100%;
    }

    .post-admin-view {
        flex-direction: column;
    }

    .post-admin-actions {
        width: 100%;
    }

    .post-admin-actions button,
    .post-edit-btns button {
        flex: 1;
        height: 2.75rem;
    }

    .music-player {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        min-width: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 0.9rem 1rem max(0.9rem, env(safe-area-inset-bottom));
    }

    body:has(.music-player) {
        padding-bottom: 7.5rem;
    }
}

@media (max-width: 640px) {
    .stuff-grid,
    .gallery-choice {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .stuff-card-btn {
        width: 100%;
        height: 2.9rem;
        font-size: 1rem;
    }
}

@media (max-width: 430px) {
    .page-header h1,
    .user-display h2,
    .admin-header-row h2 {
        font-size: 1.65rem;
    }
}
