:root {
  --ink: #141714;
  --paper: #f3f0e8;
  --white: #fffdf8;
  --acid: #d5f33d;
  --coral: #ff6b4a;
  --sky: #8bc9e8;
  --muted: #686d67;
  --line: #cbc8bf;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Manrope", sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: sticky; top: 0; z-index: 20; height: 74px; padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; font-weight: 800; font-size: 18px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--acid); font: 500 12px "DM Mono", monospace; }
.desktop-nav { display: flex; gap: 34px; font-size: 14px; font-weight: 600; }
.desktop-nav a { transition: opacity .2s; }
.desktop-nav a:hover { opacity: .55; }
.header-actions { justify-self: end; display: flex; gap: 8px; }

.button, .icon-button, .text-button {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700;
}
.button { min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 4px; font-size: 13px; transition: transform .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button svg, .text-button svg { width: 17px; height: 17px; }
.button-dark { background: var(--ink); color: var(--white); }
.button-dark:hover { background: #30352f; }
.button-ghost { background: transparent; }
.button-ghost:hover { background: var(--white); }
.button-accent { background: var(--acid); }
.button-light { background: var(--white); border-color: var(--white); }
.text-button { padding: 10px 0; background: transparent; border-bottom: 1px solid var(--ink); }
.icon-button { width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: transparent; }
.icon-button svg { width: 19px; }

.hero { position: relative; max-width: var(--max); min-height: 650px; margin: auto; padding: 76px 0 64px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 68px; align-items: center; }
.hero::before { content: ""; position: absolute; left: -80px; top: 56px; width: 110px; height: 110px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.eyebrow { margin: 0 0 22px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; font: 500 11px "DM Mono", monospace; letter-spacing: 0; }
.eyebrow span { width: 26px; height: 2px; background: var(--coral); }
h1 { margin: 0; max-width: 710px; font-size: clamp(48px, 6vw, 84px); line-height: .98; letter-spacing: 0; font-weight: 800; }
h1 em { color: transparent; -webkit-text-stroke: 1.5px var(--ink); font-style: normal; }
.hero-copy { max-width: 590px; margin: 30px 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 26px; }
.hero-visual { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: #c9d0ce; }
.hero-visual::after { content: ""; position: absolute; inset: 0; border: 1px solid rgb(20 23 20 / .18); pointer-events: none; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.65) contrast(1.05); }
.visual-label { position: absolute; left: 0; bottom: 0; width: 100%; padding: 17px 20px; display: flex; justify-content: space-between; color: white; background: rgb(20 23 20 / .78); font: 500 11px "DM Mono", monospace; }
.hero-index { position: absolute; right: -42px; top: 50%; writing-mode: vertical-rl; font: 500 10px "DM Mono", monospace; }

.stats { border-block: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) 1.4fr; }
.stats > * { min-height: 120px; padding: 26px 32px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.stats strong { font-size: 30px; }
.stats span { color: var(--muted); font-size: 12px; }
.stats p { margin: 0; border-right: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.section { padding: 105px max(24px, calc((100vw - var(--max)) / 2)); }
.section-heading { margin-bottom: 34px; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.section-heading .eyebrow { margin-bottom: 13px; }
h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1; letter-spacing: 0; }
.latest-presentations-section { margin-top: 78px; padding-top: 54px; border-top: 1px solid var(--line); }
.latest-presentations-section h2 { font-size: clamp(30px, 3.2vw, 44px); }
.latest-library-link { padding-bottom: 6px; display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 700; }
.latest-library-link svg { width: 16px; height: 16px; }
.latest-presentation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.latest-presentation-card { min-width: 0; border-top: 3px solid var(--ink); }
.latest-presentation-visual { position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 28px; overflow: hidden; display: flex; align-items: flex-end; border: 0; color: var(--white); background: var(--ink); cursor: pointer; text-align: left; }
.latest-presentation-visual::before { content: ""; position: absolute; top: 25px; right: 25px; width: 29%; height: 38%; border-top: 9px solid var(--acid); border-bottom: 1px solid #6d726b; }
.latest-presentation-visual::after { content: ""; position: absolute; top: 51px; right: 25px; width: 20%; height: 1px; background: #6d726b; box-shadow: 0 10px #6d726b, 0 20px #6d726b; }
.latest-presentation-visual strong { position: relative; z-index: 1; width: 65%; display: -webkit-box; overflow: hidden; font-size: clamp(17px, 1.7vw, 24px); line-height: 1.15; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.latest-slide-format { position: absolute; top: 22px; left: 25px; color: var(--coral); font: 500 10px "DM Mono", monospace; }
.latest-slide-preview { position: absolute; z-index: 1; right: 22px; bottom: 20px; display: flex; align-items: center; gap: 6px; color: #c7cbc5; font: 500 9px "DM Mono", monospace; text-transform: uppercase; }
.latest-slide-preview svg { width: 14px; height: 14px; }
.latest-presentation-visual:hover .latest-slide-preview, .latest-presentation-visual:focus-visible .latest-slide-preview { color: var(--acid); }
.latest-presentation-visual:focus-visible { outline: 3px solid var(--coral); outline-offset: -3px; }
.latest-presentation-body { padding: 18px 2px 0; }
.latest-presentation-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
.latest-presentation-meta span { color: var(--ink); }
.latest-presentation-body h3 { margin: 13px 0 7px; overflow: hidden; font-size: 19px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.latest-presentation-body > p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.latest-presentation-footer { margin-top: 17px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.latest-presentation-footer .icon-button { width: 36px; height: 36px; }
.section-tools { display: flex; gap: 10px; }
.search-box { width: 260px; height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--ink); }
.search-box svg { flex: none; width: 17px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.mobile-add { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 30px; }
.filter-chip { padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; cursor: pointer; font: 500 11px "DM Mono", monospace; }
.filter-chip.active { border-color: var(--ink); background: var(--ink); color: var(--white); }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; align-items: stretch; }
.article-card { min-width: 0; display: flex; flex-direction: column; cursor: pointer; outline: none; }
.article-card:focus-visible .article-title, .article-card:hover .article-title { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.article-image { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: #d9d7cf; }
.article-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78); transition: transform .45s; }
.article-card:hover img { transform: scale(1.025); }
.article-body { height: 100%; padding-top: 20px; display: flex; flex: 1; flex-direction: column; }
.article-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
.article-meta .tag { padding: 5px 7px; color: var(--ink); background: var(--acid); }
.article-title { margin: 15px 0 10px; font-size: 21px; line-height: 1.25; }
.article-card:first-child .article-title { font-size: 21px; }
.article-summary { margin: 0 0 19px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.article-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; }
.article-footer svg { width: 18px; }

.presentations-section { color: var(--white); background: var(--ink); }
.eyebrow-light span { background: var(--acid); }
.presentation-toolbar { margin-bottom: 20px; padding-bottom: 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #3c413b; }
.search-dark { border-color: #6b7069; color: var(--white); }
.search-dark input { color: var(--white); }
.search-dark input::placeholder { color: #9da29b; }
.presentation-toolbar p { display: flex; align-items: center; gap: 8px; margin: 0; color: #aeb3ac; font-size: 11px; }
.presentation-toolbar svg { width: 15px; }
.presentation-list { display: grid; }
.presentation-item { min-height: 118px; padding: 20px 8px; display: grid; grid-template-columns: 132px 1fr 160px 130px auto; align-items: center; gap: 24px; border-bottom: 1px solid #3c413b; }
.presentation-preview-box { position: relative; width: 132px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; display: grid; place-items: center; border: 1px solid #656a63; border-radius: 3px; color: var(--white); background: linear-gradient(135deg, #343933 0 58%, #2b302b 58%); cursor: pointer; }
.presentation-preview-box::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgb(255 255 255 / .13); }
.presentation-preview-box:hover, .presentation-preview-box:focus-visible { border-color: var(--acid); outline: 0; }
.presentation-preview-box svg { position: relative; width: 22px; height: 22px; transition: transform .2s; }
.presentation-preview-box:hover svg { transform: scale(1.12); }
.presentation-preview-box span { position: absolute; top: 7px; left: 8px; color: var(--coral); font: 500 9px "DM Mono", monospace; }
.presentation-preview-box small { position: absolute; right: 8px; bottom: 6px; color: #c7cbc5; font: 500 8px "DM Mono", monospace; text-transform: uppercase; }
.presentation-title { margin: 0 0 7px; font-size: 17px; }
.presentation-subtitle, .presentation-detail { margin: 0; color: #aeb3ac; font-size: 11px; }
.presentation-item > div:nth-child(2) { min-width: 0; }
.presentation-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presentation-category { color: var(--acid); font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
.presentation-actions { display: flex; gap: 7px; }
.presentation-actions .icon-button { border-color: #555a54; color: white; }
.presentation-actions .icon-button:hover { color: var(--ink); background: var(--acid); }

.empty-state { grid-column: 1 / -1; padding: 70px 20px; text-align: center; border: 1px dashed var(--line); }
.empty-state svg { width: 34px; height: 34px; }
.empty-state h3 { margin: 14px 0 4px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-dark { border-color: #4d524c; }
.empty-dark p { color: #aeb3ac; }
.about-section { max-width: 900px; margin: auto; padding: 120px 24px; text-align: center; }
.about-section .eyebrow { justify-content: center; }
.about-section blockquote { margin: 0; font-size: clamp(30px, 4.2vw, 54px); font-weight: 700; line-height: 1.15; }
.about-section > p:last-child { max-width: 560px; margin: 28px auto 0; color: var(--muted); line-height: 1.7; }
footer { min-height: 150px; padding: 35px max(24px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); }
footer p { color: var(--muted); font-size: 12px; }
footer > a:last-child { display: flex; gap: 8px; font-size: 12px; font-weight: 700; }
footer svg { width: 15px; }

::backdrop { background: rgb(20 23 20 / .68); backdrop-filter: blur(4px); }
dialog { color: var(--ink); }
.editor-dialog, .reader-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 6px; background: var(--white); box-shadow: 0 24px 90px rgb(0 0 0 / .3); }
.editor-dialog form { padding: 34px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 30px; }
.dialog-header .eyebrow { margin-bottom: 8px; }
.dialog-header h2 { font-size: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid label { display: grid; gap: 7px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.form-grid label span { color: var(--muted); font-weight: 500; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 3px; outline: 0; background: #fbfaf6; font-size: 14px; text-transform: none; resize: vertical; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px var(--acid); }
.file-drop { min-height: 150px; place-items: center; align-content: center; border: 1px dashed #92978f; cursor: pointer; text-align: center; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop svg { width: 30px; height: 30px; margin-bottom: 5px; }
.file-drop strong { font-size: 13px; text-transform: none; }
.file-drop.dragging { border-color: var(--ink); background: color-mix(in srgb, var(--acid) 20%, white); }
.dialog-actions { margin-top: 26px; display: flex; justify-content: flex-end; gap: 8px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: #b32716; font-size: 12px; }
.reader-dialog { width: min(820px, calc(100% - 28px)); }
.reader-close { position: sticky; z-index: 2; top: 18px; float: right; margin: 18px 18px 0 0; background: var(--white); }
.reader-cover { width: 100%; max-height: min(520px, 56vh); aspect-ratio: 3 / 2; object-fit: cover; }
.reader-inner { padding: 48px clamp(24px, 7vw, 72px) 70px; }
.reader-inner h1 { margin: 12px 0 18px; font-size: clamp(36px, 6vw, 58px); line-height: 1.05; }
.reader-inner .byline { color: var(--muted); font-size: 12px; }
.reader-inner .article-copy { margin-top: 35px; white-space: pre-wrap; font-size: 16px; line-height: 1.8; }
.reader-inner .delete-post { margin-top: 34px; color: #a52e1b; background: transparent; border-color: #c9988f; }
.presentation-preview-dialog { width: min(1120px, calc(100% - 28px)); height: min(880px, calc(100vh - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #e7e5de; box-shadow: 0 24px 90px rgb(0 0 0 / .38); }
.preview-dialog-header { min-height: 104px; padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: var(--white); }
.preview-dialog-header .eyebrow { margin-bottom: 7px; }
.preview-dialog-header h2 { max-width: 700px; overflow: hidden; font-size: 27px; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.preview-header-actions { display: flex; align-items: center; gap: 8px; }
.preview-stage { height: calc(100% - 104px); padding: 24px; overflow: auto; }
.preview-content { width: max-content; max-width: 100%; margin: auto; }
.preview-content > div { margin-inline: auto; }
.preview-content .pptx-preview-wrapper { height: auto !important; overflow: visible !important; background: transparent !important; }
.preview-status { min-height: 100%; padding: 40px 20px; display: grid; place-items: center; align-content: center; text-align: center; }
.preview-status[hidden], .preview-content[hidden] { display: none; }
.preview-status svg { width: 38px; height: 38px; margin-bottom: 14px; color: var(--coral); }
.preview-status .preview-spinner { animation: preview-spin 1s linear infinite; }
.preview-status h3 { margin: 0 0 7px; font-size: 20px; }
.preview-status p { max-width: 500px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
@keyframes preview-spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; padding: 13px 17px; color: white; background: var(--ink); border-left: 4px solid var(--acid); border-radius: 3px; font-size: 13px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .hero { min-height: auto; padding: 55px 24px 70px; grid-template-columns: 1fr; gap: 45px; }
  .hero-visual { max-width: 760px; margin-inline: auto; }
  .hero-index { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats p { display: none; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-presentation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presentation-item { grid-template-columns: 112px 1fr 120px auto; }
  .presentation-preview-box { width: 112px; }
  .presentation-detail { display: none; }
}

@media (max-width: 650px) {
  .site-header { height: 66px; padding-inline: 16px; }
  .header-actions .button-ghost { display: none; }
  .header-actions .button { min-height: 40px; padding: 0 12px; }
  .hero { padding: 46px 20px 55px; }
  h1 { font-size: 47px; }
  .hero-copy { font-size: 16px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero-visual { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > * { min-height: 94px; padding: 19px; }
  .stats > :nth-child(3) { display: none; }
  .section { padding: 76px 20px; }
  .section-heading { align-items: start; }
  .latest-presentations-section .section-heading { flex-direction: column; }
  .latest-presentation-grid { grid-template-columns: 1fr; }
  .latest-presentation-visual { padding: 24px; }
  .section-heading > .button { display: none; }
  .section-tools { width: 100%; }
  .articles-section .section-heading { flex-direction: column; }
  .search-box { width: 100%; }
  .mobile-add { display: inline-flex; flex: none; }
  .article-grid { grid-template-columns: 1fr; gap: 42px; }
  .article-card { margin: 0; }
  .presentation-toolbar { align-items: stretch; flex-direction: column; gap: 18px; }
  .presentation-toolbar p { justify-content: flex-end; }
  .presentation-item { width: 100%; padding: 18px 0; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 12px; }
  .presentation-preview-box { width: 86px; }
  .presentation-preview-box small { display: none; }
  .presentation-category { display: none; }
  .presentation-actions { flex-direction: column; }
  .presentation-actions .icon-button { width: 36px; height: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .editor-dialog form { padding: 24px 18px; }
  .presentation-preview-dialog { height: calc(100vh - 16px); }
  .preview-dialog-header { min-height: 128px; padding: 16px; align-items: flex-start; gap: 12px; }
  .preview-dialog-header > div:first-child { min-width: 0; flex: 1; }
  .preview-dialog-header h2 { max-width: 100%; font-size: 20px; }
  .preview-header-actions { flex: none; }
  .preview-header-actions .button { width: 42px; padding: 0; }
  .preview-header-actions .button span { display: none; }
  .preview-stage { height: calc(100% - 128px); padding: 12px; }
  footer { padding-block: 30px; align-items: flex-start; flex-direction: column; }
  footer p { margin: 0; }
}
