:root {
    --background: #fafaf8;
    --surface: #ffffff;
    --text: #20211f;
    --muted: #747672;
    --line: #e2e3df;
    --accent: #b5442e;
    --danger: #a22c24;
    --button-background: #20211f;
    --button-text: #ffffff;
    --button-hover-background: #8f2f1d;
    --button-hover-text: #ffffff;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font-size: 15px; line-height: 1.65; }
a { color: inherit; text-decoration-color: #a7a8a4; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: .55rem .9rem; border: 1px solid var(--button-background); border-radius: 5px; background: var(--button-background); color: var(--button-text); font-size: .8rem; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--button-hover-background); border-color: var(--button-hover-background); color: var(--button-hover-text); }
.shell { width: calc(100% - 32px); max-width: 720px; margin-inline: auto; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .5rem .75rem; background: var(--text); color: white; }
.skip-link:focus { top: 1rem; }

.site-header { padding: 28px 0 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: baseline; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark, .brand small { display: none; }
.brand strong { display: block; font-size: .92rem; font-weight: 720; letter-spacing: -.015em; }
.site-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 18px; }
.site-header nav a { color: var(--muted); font-size: .76rem; font-weight: 570; text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 36px; align-items: center; padding: 54px 0 46px; border-bottom: 1px solid var(--line); }
.intro > div, .feed-item { min-width: 0; }
.intro h1 { max-width: 590px; margin: 0 0 12px; font-size: clamp(1.55rem, 4vw, 2.05rem); font-weight: 590; letter-spacing: -.035em; line-height: 1.22; }
.intro p:not(.eyebrow) { max-width: 590px; margin: 0; color: var(--muted); font-size: .9rem; }
.intro img, .about-photo { width: 88px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.section-head { padding: 54px 0 30px; border-bottom: 1px solid var(--line); }
.section-head h1, .static-page h1, .empty h1 { margin: 0; font-size: clamp(1.9rem, 6vw, 2.7rem); font-weight: 620; letter-spacing: -.045em; line-height: 1.1; }

.feed { width: 100%; }
.feed-item { padding: 32px 0 34px; border-bottom: 1px solid var(--line); }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; margin-bottom: 10px; color: var(--muted); font-size: .67rem; font-weight: 570; }
.entry-meta a { color: inherit; text-decoration: none; }
.entry-kind { color: var(--accent); font-size: .64rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.feed-item h2 { max-width: 650px; margin: 0 0 9px; font-size: clamp(1.25rem, 3vw, 1.55rem); font-weight: 630; letter-spacing: -.03em; line-height: 1.24; }
.feed-item h2 a { color: var(--text); text-decoration: none; }
.feed-item h2 a:hover { color: var(--accent); }
.feed-item .p-summary { max-width: 650px; margin: 0 0 12px; color: #4d504c; font-size: .88rem; overflow-wrap: anywhere; }
.feed-item p { margin-top: 0; }
.read-more { color: var(--muted); font-size: .73rem; font-weight: 650; text-decoration: none; }
.read-more:hover { color: var(--accent); }
.compact-content { max-width: 650px; font-size: .94rem; }
.compact-content > :first-child, .prose > :first-child { margin-top: 0; }
.compact-content > :last-child, .prose > :last-child { margin-bottom: 0; }
.compact-content p { margin: 0 0 .8rem; }
.compact-content a { overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; color: var(--muted); font-size: .66rem; }
.card-images, .detail-images { display: grid; gap: 4px; margin: 17px 0; overflow: hidden; border-radius: 4px; background: var(--line); }
.card-images.images-2, .card-images.images-3, .card-images.images-4, .detail-images.images-2, .detail-images.images-3, .detail-images.images-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-images a, .card-images picture, .detail-images figure, .detail-images picture { display: contents; }
.card-images img { width: 100%; height: min(62vw, 430px); object-fit: contain; background: #ededeb; }
.card-images.images-2 img, .card-images.images-3 img, .card-images.images-4 img { height: min(31vw, 250px); }
.photo-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding: 30px 0 12px; }
.photo-feed .feed-item { padding: 0; border: 0; }
.photo-feed .card-images { margin: 0 0 10px; }
.photo-feed .card-images img { height: min(52vw, 430px); object-fit: contain; }
.photo-feed .entry-meta { margin-bottom: 7px; }

.entry-detail { padding: 64px 0 80px; }
.entry-header { margin-bottom: 32px; }
.entry-header h1 { max-width: 680px; margin: 0; font-size: clamp(2rem, 6vw, 3rem); font-weight: 630; letter-spacing: -.05em; line-height: 1.08; }
.detail-images { margin: 0 0 38px; }
.detail-images figure { margin: 0; }
.detail-images img { width: 100%; max-height: 82vh; object-fit: contain; background: #ededeb; }
.prose { max-width: 650px; font-size: .98rem; line-height: 1.78; }
.prose h2, .prose h3, .prose h4 { margin: 2.2em 0 .65em; line-height: 1.25; letter-spacing: -.02em; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.16rem; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.35em; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 2px solid var(--line); color: var(--muted); }
.prose pre { overflow-x: auto; padding: 14px; border-radius: 4px; background: #222321; color: #f4f4ef; font-size: .78rem; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.back-link { max-width: 650px; margin: 44px 0 0; font-size: .76rem; }
.static-page { padding: 62px 0 86px; }
.static-page .lead { color: var(--muted); font-size: 1.03rem; }
.about-photo { float: right; width: 112px; margin: 2px 0 24px 36px; }
.contact-page p { margin-bottom: 1.45em; }
.empty { padding: 90px 0; text-align: center; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 30px 0 55px; color: var(--muted); font-size: .72rem; }
.pagination > :last-child { text-align: right; }

.site-footer { padding: 26px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; }

.admin-body { background: var(--background); }
.admin-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 80px; }
.admin-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 34px; }
.admin-header.compact { align-items: start; }
.admin-header h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.7rem); font-weight: 620; letter-spacing: -.045em; line-height: 1.1; }
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 13px; font-size: .75rem; }
.stats-panel { margin: -8px 0 34px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-total { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.stats-total span { color: var(--muted); font-size: .7rem; }
.stats-total strong { font-size: 1.2rem; font-weight: 650; }
.page-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.page-stats a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--background); font-size: .7rem; text-decoration: none; }
.page-stats span { color: var(--muted); }
.page-stats strong { font-weight: 650; }
.admin-list { border-top: 1px solid var(--line); }
.admin-list article { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.admin-list h2 { margin: 3px 0 0; font-size: .92rem; }
.admin-list p { margin: 3px 0 0; color: var(--muted); font-size: .66rem; }
.draft { margin-left: 6px; color: var(--accent); font-size: .62rem; font-weight: 750; text-transform: uppercase; }
.row-actions { display: flex; align-items: center; gap: 11px; flex-shrink: 0; font-size: .7rem; }
.row-actions form { margin: 0; }
.link-button { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--danger); font-weight: 500; text-decoration: underline; }
.link-button:hover { background: none; color: var(--accent); }
.logout-form { margin-top: 32px; }
.secondary { background: transparent; color: var(--text); }

.editor-form, .password-form, .login-card form { display: grid; gap: 18px; }
.editor-form label, .password-form label, .login-card label { display: grid; gap: 6px; font-size: .75rem; font-weight: 650; }
.editor-form label small { color: var(--muted); font-weight: 450; }
input, textarea, select { width: 100%; padding: .68rem .75rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }
textarea { min-height: 300px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(181, 68, 46, .18); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.check-label input { width: auto; }
.form-actions { display: flex; align-items: center; gap: 15px; }
.form-message { padding: 10px 12px; border-radius: 4px; }
.form-message.error { background: #f7dfda; color: #7d2119; }
.form-message.success { background: #dfecdf; color: #285d31; }
.existing-images { display: flex; flex-wrap: wrap; gap: 9px; }
.existing-image { display: grid !important; gap: 5px !important; font-size: .68rem !important; }
.existing-image span { display: flex; align-items: center; gap: 5px; }
.existing-image input { width: auto; }
.existing-images img { width: 105px; height: 78px; object-fit: cover; border-radius: 3px; }
.login-card { max-width: 360px; margin: 14vh auto 0; padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.login-card h1 { margin: 34px 0 22px; font-size: 1.45rem; }
.password-form { max-width: 480px; }

@media (max-width: 620px) {
    body { font-size: 14.5px; }
    .shell { width: calc(100% - 26px); }
    .site-header { padding-top: 19px; }
    .header-row { align-items: flex-start; flex-direction: column; gap: 14px; }
    .site-header nav { width: 100%; justify-content: flex-start; gap: 7px 17px; }
    .intro { grid-template-columns: minmax(0, 1fr) 64px; gap: 20px; padding: 42px 0 37px; }
    .intro img { width: 64px; }
    .intro h1 { font-size: 1.45rem; }
    .photo-feed { grid-template-columns: 1fr; gap: 30px; }
    .photo-feed .card-images img { height: auto; max-height: none; }
    .about-photo { float: none; width: 92px; margin: 18px 0 28px; }
    .admin-header, .admin-list article { align-items: flex-start; flex-direction: column; }
    .page-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-actions { justify-content: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .footer-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (prefers-color-scheme: dark) {
    :root { --background: #181918; --surface: #202120; --text: #ecece8; --muted: #a0a29e; --line: #353734; --accent: #dc735e; --danger: #ed8178; --button-background: #ecece8; --button-text: #181918; --button-hover-background: #dc735e; --button-hover-text: #181918; color-scheme: dark; }
    .feed-item .p-summary { color: #c5c7c2; }
    .card-images img,
    .detail-images img { background: #111211; }
    .form-message.error { background: #482723; color: #ffd7cf; }
    .form-message.success { background: #263e2c; color: #daf1df; }
}

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