:root {
    --color-primary: #172968;
    --color-secondary: #117bb8;
    --color-white: #ffffff;
    --color-menu: #191919;
    --color-ink: #111827;
    --color-muted: #627084;
    --color-soft: #f4f8fc;
    --color-line: #dce7f1;
    --color-danger: #b42318;
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow-soft: 0 24px 70px rgba(16, 35, 76, 0.14);
    --shadow-card: 0 16px 42px rgba(16, 35, 76, 0.12);
    --font-main: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--color-ink);
    background:
        radial-gradient(circle at 14% 10%, rgba(17, 123, 184, 0.12), transparent 30%),
        radial-gradient(circle at 88% 4%, rgba(23, 41, 104, 0.10), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 48%, #ffffff 100%);
    font-family: var(--font-main);
    line-height: 1.6;
}

body::before,
.scanlines {
    display: none;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    position: relative;
    z-index: 1;
}

.section-search {
    width: min(620px, 100%);
}

.section-search input {
    min-height: 50px;
    border: 1px solid rgba(17, 123, 184, 0.18);
    border-radius: 999px;
    padding: 13px 22px;
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70), 0 16px 42px rgba(16, 35, 76, 0.10);
    backdrop-filter: blur(16px);
}

.section-search input::placeholder {
    color: rgba(98, 112, 132, 0.82);
}

.section-search input:focus {
    border-color: rgba(17, 123, 184, 0.72);
    box-shadow: 0 0 0 4px rgba(17, 123, 184, 0.13), 0 16px 42px rgba(16, 35, 76, 0.12);
}

.btn,
.share-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 17px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.share-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.38);
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    box-shadow: 0 14px 30px rgba(17, 123, 184, 0.28);
}

.btn.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    box-shadow: 0 14px 32px rgba(17, 123, 184, 0.26);
}

.btn.ghost {
    color: var(--color-primary);
    border-color: rgba(17, 123, 184, 0.18);
    background: rgba(17, 123, 184, 0.08);
    box-shadow: none;
}

.btn.danger {
    color: #fff;
    border-color: transparent;
    background: var(--color-danger);
}

.btn.small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.85rem;
}

.btn.full {
    width: 100%;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(56px, 8vw, 108px) 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.58fr);
    align-items: center;
    gap: clamp(28px, 6vw, 74px);
}

.hero-copy h1,
.article-head h1,
.admin-head h1,
.login-card h1,
.empty-state h1 {
    margin: 0;
    color: var(--color-primary);
    font-size: clamp(2.35rem, 6vw, 5.4rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.hero-copy h1 {
    max-width: 820px;
}

.hero-text {
    max-width: 720px;
    margin: 24px 0 0;
    color: #46556d;
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 600;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--color-secondary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-actions,
.admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-card,
.panel,
.login-card,
.featured-post,
.post-card,
.stat-card,
.empty-state,
.share-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(220, 231, 241, 0.95);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
}

.hero-card::before,
.panel::before,
.featured-post::before,
.post-card::before,
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0), rgba(17, 123, 184, 0.12), transparent 42%);
    transition: opacity 0.2s ease;
}

.hero-card:hover::before,
.panel:hover::before,
.featured-post:hover::before,
.post-card:hover::before,
.stat-card:hover::before {
    opacity: 1;
}

.hero-card {
    display: grid;
    gap: 14px;
    padding: clamp(24px, 4vw, 34px);
}

.hero-card img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hero-card-kicker {
    margin: 0;
    color: var(--color-secondary);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-card h2 {
    margin: 0;
    color: var(--color-primary);
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    line-height: 1.05;
}

.hero-card p:not(.hero-card-kicker) {
    margin: 0;
    color: var(--color-muted);
}

.content-band,
.admin-shell,
.article-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 54px 0 82px;
}

.content-band.narrow,
.admin-shell.narrow {
    width: min(860px, calc(100% - 32px));
}

.section-head {
    display: grid;
    justify-content: start;
    gap: 14px;
    margin-bottom: 30px;
}

.section-head h2 {
    max-width: 720px;
    margin: 0;
    color: var(--color-primary);
    font-size: clamp(1.85rem, 3.5vw, 3.25rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    order: 1;
}

.section-head .eyebrow {
    order: 3;
    margin: 0;
}

.section-head .section-search {
    order: 2;
}

.featured-post {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    margin-bottom: 24px;
}

.featured-copy,
.post-body {
    position: relative;
    padding: 28px;
}

.featured-copy h2,
.post-body h3 {
    margin: 12px 0 8px;
    color: var(--color-primary);
    line-height: 1.16;
}

.featured-copy h2 {
    font-size: clamp(1.75rem, 3vw, 2.7rem);
}

.featured-copy h2 a,
.post-body h3 a {
    text-decoration: none;
}

.featured-copy h2 a:hover,
.post-body h3 a:hover,
.read-link:hover,
.back-link:hover {
    color: var(--color-secondary);
}

.date {
    color: #728196;
    font: 0.82rem var(--font-mono);
}

.post-media {
    min-height: 330px;
    background: linear-gradient(135deg, rgba(23, 41, 104, 0.08), rgba(17, 123, 184, 0.10));
}

.post-media.small {
    min-height: 180px;
}

.post-media img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}

.media-fallback {
    display: grid;
    place-items: center;
    color: var(--color-primary);
    font-weight: 900;
    background:
        radial-gradient(circle at 18% 18%, rgba(17, 123, 184, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(23, 41, 104, 0.08), rgba(17, 123, 184, 0.12));
}

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

.post-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover,
.featured-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 62px rgba(16, 35, 76, 0.17);
}

.post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.post-body p:not(.date),
.featured-copy p:not(.date) {
    color: #58677e;
}

.read-link,
.back-link {
    margin-top: auto;
    color: var(--color-secondary);
    font-weight: 900;
    text-decoration: none;
}

.read-link::after,
.back-link::after {
    content: " →";
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(17, 123, 184, 0.18);
    border-radius: 999px;
    color: var(--color-primary);
    background: rgba(17, 123, 184, 0.08);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.empty-state {
    padding: 34px;
    text-align: center;
}

.empty-state p {
    color: var(--color-muted);
}

.search-empty {
    margin-top: 22px;
}

.article-shell {
    width: min(900px, calc(100% - 32px));
}

.back-link {
    display: inline-flex;
    margin-bottom: 24px;
}

.article-head {
    margin-bottom: 28px;
}

.article-head h1 {
    font-size: clamp(2.05rem, 5vw, 4.5rem);
}

.article-image {
    margin: 28px 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.article-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-content {
    color: #26344d;
    font-size: 1.07rem;
    line-height: 1.78;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 34px 0 12px;
    color: var(--color-primary);
    line-height: 1.15;
}

.article-content p,
.article-content ul,
.article-content blockquote {
    margin: 0 0 15px;
}

.article-content ul {
    padding-left: 24px;
}

.article-content li {
    margin: 0 0 6px;
}

.article-content blockquote {
    padding: 16px 18px;
    border-left: 4px solid var(--color-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: #33445c;
    background: rgba(17, 123, 184, 0.08);
}

.article-content a {
    color: var(--color-secondary);
    font-weight: 800;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.text-underline {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.text-blue {
    color: var(--color-secondary);
    font-weight: 800;
}

.text-accent {
    color: var(--color-primary);
    font-weight: 900;
}

.article-inline-image {
    margin: 26px 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.youtube-embed {
    position: relative;
    margin: 28px 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: var(--shadow-card);
}

.youtube-embed::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.youtube-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-inline-image img,
.inline-post-image {
    width: 100%;
    height: auto;
    display: block;
}

.inline-post-image {
    margin: 18px 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
}

.article-content code {
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--color-primary);
    background: rgba(17, 123, 184, 0.10);
}

.share-panel {
    margin-top: 34px;
    padding: 22px;
}

.share-panel p {
    margin: 0 0 12px;
    color: var(--color-primary);
    font-weight: 900;
    text-transform: uppercase;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    color: var(--color-primary);
    border-color: rgba(17, 123, 184, 0.18);
    background: rgba(17, 123, 184, 0.08);
}

.share-hint {
    display: block;
    margin-top: 12px;
    color: var(--color-muted);
}

.admin-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.admin-head h1,
.login-card h1,
.empty-state h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.admin-head p,
.stat-card p,
.login-card p,
.admin-row small,
.inline-image-tool small,
.inline-image-status {
    color: var(--color-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.stat-card,
.panel,
.login-card {
    padding: 24px;
}

.stat-card span {
    display: block;
    color: var(--color-secondary);
    font-weight: 900;
    font-size: 2.6rem;
    line-height: 1;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
    color: var(--color-primary);
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: #fff;
}

.admin-row strong,
.admin-row small {
    display: block;
}

.login-screen {
    width: min(460px, calc(100% - 32px));
    min-height: calc(100vh - 180px);
    margin: 0 auto;
    display: grid;
    place-items: center;
}

.form-stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: #26344d;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d8e2ed;
    border-radius: var(--radius-md);
    padding: 12px 13px;
    color: #172033;
    background: #fff;
    font: 1rem var(--font-main);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(17, 123, 184, 0.13);
}

input[type="file"] {
    padding: 10px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: #f8fbff;
}

.editor-toolbar button {
    min-height: 34px;
    border: 1px solid rgba(17, 123, 184, 0.18);
    border-radius: 10px;
    padding: 7px 10px;
    color: var(--color-primary);
    background: #fff;
    font: 800 0.86rem var(--font-main);
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.editor-toolbar button:hover {
    transform: translateY(-1px);
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
}

.inline-image-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: rgba(17, 123, 184, 0.06);
}

.inline-image-tool strong,
.inline-image-tool small,
.inline-image-status {
    display: block;
}

.inline-image-tool input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.inline-image-status {
    grid-column: 1 / -1;
    min-height: 20px;
}

.inline-image-status.is-error {
    color: var(--color-danger);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 16px;
}

.alert {
    margin: 0 0 16px;
    padding: 13px 15px;
    border: 1px solid rgba(17, 123, 184, 0.18);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    background: rgba(17, 123, 184, 0.08);
}

.alert.danger {
    border-color: rgba(180, 35, 24, 0.22);
    color: var(--color-danger);
    background: rgba(180, 35, 24, 0.08);
}

.responsive-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--color-primary);
    font-weight: 900;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.confirm-panel {
    text-align: center;
}

.confirm-panel .admin-actions {
    justify-content: center;
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 38px;
    border-top: 1px solid var(--color-line);
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-muted);
    font-weight: 700;
}

.footer-inner img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.footer-inner p {
    margin: 0;
}

.back-to-top {
    position: fixed;
    right: clamp(16px, 3vw, 28px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 70;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    box-shadow: 0 18px 42px rgba(23, 41, 104, 0.28), 0 8px 20px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(0.94);
    transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.back-to-top span {
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 22px 52px rgba(23, 41, 104, 0.34), 0 10px 24px rgba(0, 0, 0, 0.20);
}

@media (max-width: 900px) {
    .hero,
    .featured-post,
    .post-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .admin-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-actions {
        width: 100%;
    }

    .admin-actions .btn {
        flex: 1;
    }
}

@media (max-width: 620px) {
    .section-search,
    .hero-actions .btn,
    .admin-actions .btn {
        width: 100%;
    }

    .hero-copy h1 {
        font-size: 2.45rem;
    }

    .content-band,
    .admin-shell,
    .article-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 34px;
    }

    .featured-copy,
    .post-body,
    .panel,
    .login-card,
    .empty-state,
    .hero-card {
        padding: 20px;
    }

    .form-grid,
    .inline-image-tool {
        grid-template-columns: 1fr;
    }

    .admin-row,
    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    th,
    td {
        min-width: 150px;
    }

    .back-to-top {
        width: 46px;
        height: 46px;
    }
}
