:root {
    --bg: #f5f1ea;
    --surface: #faf7f2;
    --text: #161616;
    --muted: #615b56;
    --border: #d8d0c4;
    --accent: #6f7c68;
    --accent-dark: #55614e;
    --display: Georgia, "Times New Roman", serif;
    --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --container: 1180px;
    --article: 820px;
    --radius: 18px;
    --side-column: 360px;
    --callout-bg: #f3eee7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.72;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

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

.container {
    width: min(calc(100% - 48px), var(--container));
    margin: 0 auto;
}

.narrow,
.article-shell {
    width: min(calc(100% - 48px), var(--article));
    margin: 0 auto;
}

.prose {
    width: 100%;
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(245, 241, 234, 0.92);
    backdrop-filter: blur(10px);
}

.header-inner {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-responsive {
    flex-shrink: 0;
    white-space: nowrap;
}

.brand-logo-full {
    display: block;
    height: 86px;
    width: auto;
}

.brand-logo-mark {
    display: none;
    width: 28px;
    height: 28px;
    background: center / contain no-repeat url('../img/tim-mark.svg');
    opacity: 0.92;
    flex: 0 0 28px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 0.95rem;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--accent-dark);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
}

/* Typography */

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 500;
    letter-spacing: 0.01em;
    margin: 0;
}

.meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.text-link {
    color: var(--accent-dark);
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Buttons + forms */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.96rem;
    white-space: nowrap;
    cursor: pointer;
}

.button-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button-secondary:hover,
.button:hover {
    border-color: var(--accent);
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    padding: 15px 16px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: #fffdf9;
    color: var(--text);
    font: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(111, 124, 104, 0.12);
}

textarea {
    min-height: 220px;
    resize: vertical;
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
}

.notice-success {
    background: rgba(111, 124, 104, 0.11);
    border: 1px solid rgba(111, 124, 104, 0.22);
}

.notice-error {
    background: rgba(120, 40, 40, 0.08);
    border: 1px solid rgba(120, 40, 40, 0.18);
}

/* Hero */

.hero {
    padding: 56px 0 44px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-column);
    gap: 56px;
    align-items: start;
}

.hero-aside {
    width: var(--side-column);
    max-width: 100%;
}

.hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    line-height: 1.06;
    max-width: 13ch;
}

.hero-intro,
.section-text,
.page-intro,
.article-deck {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.72;
    max-width: 62ch;
}

.hero-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.hero-note,
.contact-panel,
.form-panel,
.photo-placeholder,
.info-box,
.book-inline-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
}

/* Generic sections */

.section {
    padding: 52px 0 88px;
}

.section-rule {
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 34px;
}

.section-heading h2,
.featured-grid h2,
.feature-strip h2,
.about-grid h2 {
    font-size: clamp(2.2rem, 4vw, 3.35rem);
    line-height: 1.02;
}

.featured-grid,
.feature-strip,
.about-grid,
.contact-grid,
.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-column);
    gap: 48px;
    align-items: start;
}

/* Cards */

.essay-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.essay-card,
.theme-card {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.essay-card h3,
.theme-card h3 {
    margin: 12px 0 10px;
    font-size: 1.52rem;
    line-height: 1.08;
}

.essay-card p,
.theme-card p {
    margin: 0;
    color: var(--muted);
}

/* Listing pages */

.page-hero,
.article-hero {
    padding: 56px 0 22px;
}

.page-hero h1,
.article-hero h1 {
    font-size: clamp(2.25rem, 4.5vw, 3.35rem);
    line-height: 1.02;
}

.listing {
    padding-bottom: 92px;
}

.list-stack {
    display: grid;
    gap: 30px;
}

.list-item {
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.list-item h2 {
    margin: 10px 0 12px;
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    line-height: 1.06;
}

.essay-seq {
    margin: 0 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Article body */

.article-body {
    padding: 10px 0 108px;
}

.article-subtitle {
    margin: 18px 0 12px;
    font-size: 1.18rem;
    line-height: 1.62;
    color: #242220;
}

.article-callout {
    margin: 0 0 2rem;
    padding: 18px 20px;
    background: var(--callout-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.article-callout p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.72;
    color: #3b3834;
}

.article-endnote {
    margin-top: 2.4rem;
}

.article-body > .article-shell > p,
.article-body p,
.page-copy p {
    margin: 0 0 1.3rem;
    color: #272524;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-body p:first-of-type {
    font-size: 1.24rem;
    line-height: 1.78;
    color: #1e1d1b;
}

.article-body h2,
.page-copy h2 {
    margin: 2.8rem 0 0.95rem;
    font-size: 2.08rem;
    line-height: 1.08;
}

.article-body h3,
.page-copy h3 {
    margin: 1.9rem 0 0.65rem;
    font-size: 1.4rem;
    line-height: 1.14;
}

.article-body ul,
.article-body ol,
.page-copy ul,
.page-copy ol {
    margin: 0 0 1.45rem 1.2rem;
    padding-left: 0.4rem;
    color: #2c2927;
}

.article-body li,
.page-copy li {
    margin-bottom: 0.5rem;
}

.article-body blockquote,
.page-copy blockquote {
    margin: 2.2rem 0;
    padding: 0.35rem 0 0.35rem 1.3rem;
    border-left: 2px solid var(--accent);
    color: #34302d;
    font-style: italic;
}

.article-body hr,
.page-copy hr {
    border: 0;
    height: 1px;
    margin: 2.4rem 0;
    background: var(--border);
}

.article-cover {
    margin-top: 26px;
    overflow: hidden;
    border-radius: 18px;
}

.article-cover img {
    width: 100%;
    height: auto;
}

.essay-nav {
    width: 100%;
    margin: 56px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: right;
}

.essay-nav-inner {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    flex-wrap: wrap;
    font-size: 0.95rem;
    line-height: 1.5;
}

.essay-nav-link {
    color: var(--text);
    text-decoration: none;
}

.essay-nav-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.essay-nav-separator {
    color: var(--muted);
    opacity: 0.6;
}

.essay-nav-soon {
    color: var(--muted);
}

/* About / Contact two-column layout */

.page-two-column {
    padding: 10px 0 96px;
}

.page-two-column-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-column);
    gap: 48px;
    align-items: start;
}

.page-main-column {
    min-width: 0;
    max-width: 760px;
}

.page-side-column {
    min-width: 0;
    width: 100%;
    align-self: start;
}

.page-side-stack {
    display: grid;
    gap: 20px;
    align-content: start;
    justify-items: stretch;
}

.page-side-stack > * {
    width: 100%;
}

.author-photo-box {
    width: 100%;
    max-width: var(--side-column);
    align-self: start;
}

.author-photo-box img,
.author-photo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
}

.book-inline-panel {
    margin-top: 32px;
}

.book-inline-panel-inner {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    align-items: start;
}

.book-inline-cover {
    width: 96px;
}

.book-inline-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.form-note {
    max-width: 34ch;
    font-size: 0.92rem;
    color: var(--muted);
}

/* Footer */

.site-footer {
    margin-top: 72px;
    padding: 34px 0 42px;
    border-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
}

.footer-brand-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.footer-brand img {
    height: 46px;
    width: auto;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: nowrap;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-dark);
}

.footer-meta {
    display: block;
    text-align: right;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.92rem;
}

/* Responsive */

@media (max-width: 980px) {
    .container,
    .article-shell,
    .narrow {
        width: min(calc(100% - 40px), var(--container));
    }

    .hero-grid,
    .featured-grid,
    .feature-strip,
    .about-grid,
    .contact-grid,
    .page-grid,
    .essay-grid,
    .theme-grid,
    .page-two-column-grid,
    .footer-grid,
    .form-row,
    .book-inline-panel-inner {
        grid-template-columns: 1fr;
    }

    .hero-aside,
    .author-photo-box {
        width: 100%;
        max-width: 100%;
    }

    .footer-grid {
        text-align: center;
        gap: 18px;
    }

    .footer-brand-wrap,
    .footer-links,
    .footer-meta {
        justify-content: center;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        white-space: normal;
    }
}

@media (max-width: 760px) {
    .header-inner {
        min-height: 88px;
        gap: 16px;
        flex-wrap: nowrap;
    }

    .brand,
    .brand-responsive {
        display: flex;
        align-items: center;
        min-width: 0;
        flex: 1 1 auto;
    }

    .brand-logo-full {
        display: block;
        height: 60px;
        width: auto;
        max-width: calc(100% - 56px);
        max-height: 60px;
        object-fit: contain;
        flex-shrink: 1;
    }

    .brand-logo-mark {
        display: none !important;
    }

    .nav-toggle {
        display: block;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        position: absolute;
        right: 20px;
        top: 76px;
        min-width: 220px;
        padding: 16px;
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 18px;
    }

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

    .hero {
        padding: 42px 0 44px;
    }

    .section {
        padding: 34px 0 64px;
    }

    .page-hero,
    .article-hero {
        padding: 42px 0 18px;
    }

    .site-footer {
        margin-top: 56px;
        padding-bottom: 34px;
    }

    .essay-nav {
        text-align: left;
    }

    .essay-nav-inner {
        justify-content: flex-start;
    }
}


.article-callout {
    margin: 2.2rem 0;
    padding: 18px 20px;

    background: #f7f3ed; /* jaśniejsze niż poprzednie */
    border: 1px solid #e2d9cc; /* delikatna ramka */
    border-radius: 14px;
}

/* typografia wewnątrz */
.article-callout p,
.article-callout li {
    font-size: 0.95rem;   /* WYRAŹNIE mniejsze */
    line-height: 1.65;
    color: #4a4540;
}

/* pierwszy paragraf NIE większy */
.article-callout p:first-of-type {
    font-size: 0.95rem;
}

/* odstępy */
.article-callout p {
    margin: 0 0 0.9rem;
}

.article-callout p:last-child {
    margin-bottom: 0;
}

/* listy */
.article-callout ul,
.article-callout ol {
    margin: 0 0 0.9rem 1.1rem;
}

/* cytat */
.article-callout blockquote {
    margin: 1rem 0;
    padding-left: 0.9rem;
    border-left: 2px solid #d6ccbe;
    color: #5a534d;
    font-style: italic;
}

/* bold subtelniejszy niż w body */
.article-callout strong {
    color: #2a2724;
}

/* spacing specyficzny */
.article-orientation {
    margin-top: 0;
    margin-bottom: 2.4rem;
}

.article-endnote {
    margin-top: 3rem;
}

.article-callout {
    position: relative;
    margin: 2.2rem 0;
    padding: 22px 20px 18px;

    background: #f7f3ed;
    border: 1px solid #e2d9cc;
    border-radius: 14px;
}

/* LABEL */
.article-callout-label {
    position: absolute;
    top: -10px;
    left: 14px;

    padding: 3px 8px;

    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: #6a625c;
    background: var(--bg); /* wygląda jak "wycięty" z boxa */
}

/* typografia */
.article-callout p,
.article-callout li {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #4a4540;
}

.article-callout p:first-of-type {
    font-size: 0.95rem;
}

.article-callout p {
    margin: 0 0 0.9rem;
}

.article-callout p:last-child {
    margin-bottom: 0;
}

.article-callout blockquote {
    margin: 1rem 0;
    padding-left: 0.9rem;
    border-left: 2px solid #d6ccbe;
    color: #5a534d;
    font-style: italic;
}

.field-note {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-mini-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.admin-mini-toolbar .button {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.brand {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

.brand-logo-full {
    display: block;
    height: 86px;
    width: auto;
    max-width: 100%;
    flex-shrink: 1;
}

@media (max-width: 760px) {
    .brand-logo-full {
        display: block;
        height: 60px;
        max-width: calc(100% - 56px);
        width: auto;
        max-height: 60px;
    }

    .brand-logo-mark {
        display: none !important;
    }

    .nav-toggle {
        display: block;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin-left: auto;
    }

    .site-nav {
        display: none;
    }

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

@media (max-width: 520px) {
    .brand-logo-full {
        display: block;
        height: 54px;
        max-width: calc(100% - 56px);
        max-height: 54px;
    }

    .brand-logo-mark {
        display: none !important;
    }
}


.article-left,
.article-left h1,
.article-left .article-subtitle,
.article-left .article-deck,
.article-left .meta,
.article-left .prose,
.article-left .prose p,
.article-left .prose h2,
.article-left .prose h3 {
    text-align: left;
}

.article-hero .article-shell,
.article-body .article-shell {
    margin-left: auto;
    margin-right: auto;
}

.article-callout.article-context,
.section-referential,
#home-learn-engine {
    background: var(--context-bg);
}

.article-callout.article-context {
    border-color: rgba(22,22,22,0.1);
}

.section-referential {
    padding-top: 56px;
    padding-bottom: 56px;
}

.breadcrumbs {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.breadcrumbs span {
    display: inline;
}

.breadcrumbs a:hover,
.section-links-inline a:hover,
.bibliography-list-simple a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bibliography-list-simple {
    margin: 0;
    padding-left: 22px;
}

.bibliography-list-simple li {
    margin: 0 0 10px;
}

.dictionary-entry {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(22,22,22,0.08);
}

.prompt-box {
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.45);
    padding: 12px 14px;
}

.prompt-box summary {
    cursor: pointer;
    font-weight: 600;
}

.prompt-box pre {
    white-space: pre-wrap;
    font-family: var(--body);
    font-size: 0.96rem;
    line-height: 1.65;
    margin: 14px 0 0;
}

.learn-engine-list {
    margin: 0;
    padding-left: 18px;
}

.learn-engine-list li {
    margin: 0 0 10px;
}

.essay-seq {
    display: none;
}


/* Referential layer unification */
:root {
    --ref-border: rgba(22,22,22,0.14);
    --ref-label: #6f6559;
}

.article-callout,
.referential-shell,
.prompt-box {
    background: transparent !important;
    border: 1px solid var(--ref-border);
    border-radius: 0;
    box-shadow: none;
}

.referential-shell {
    padding: 28px 32px;
}

.section-referential,
#home-learn-engine,
.article-callout.article-context {
    background: transparent !important;
}

.section-referential {
    padding-top: 28px;
    padding-bottom: 28px;
}

.article-callout {
    padding: 22px 24px;
    margin: 28px 0;
}

.article-callout-label,
.referential-label {
    display: inline-block;
    margin: 0 0 12px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ref-label);
    font-weight: 600;
}

.referential-shell h1,
.referential-shell h2,
.referential-shell h3,
.article-callout h2,
.article-callout h3 {
    text-align: left;
}

.referential-shell .section-text,
.referential-shell p,
.referential-shell li,
.article-callout p,
.article-callout li,
.prompt-box pre,
.learn-engine-list,
.bibliography-list-simple,
.dictionary-entry p {
    font-size: 0.98rem;
    line-height: 1.6;
}

.referential-shell .section-links-inline,
.article-callout .section-links-inline,
.breadcrumbs {
    font-size: 0.92rem;
    line-height: 1.6;
}

.breadcrumbs {
    margin: 0 0 10px;
}

.dictionary-entry {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(22,22,22,0.08);
}

.dictionary-entry:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.bibliography-list-simple {
    list-style: none;
    padding-left: 0;
}

.bibliography-list-simple li {
    margin: 0 0 12px;
    padding-left: 0;
}

.bibliography-list-simple li::before {
    content: '- ';
}

.prompt-box {
    padding: 14px 16px;
    margin-bottom: 14px;
}

.prompt-box summary {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.learn-engine-list {
    list-style: none;
    padding-left: 0;
}

.learn-engine-list li {
    margin-bottom: 10px;
}

/* keep essays left aligned */
.article-hero,
.article-body,
.article-hero .container,
.article-body .container {
    text-align: left;
}

/* Homepage book cover */
.publication-strip {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.feature-strip-left {
    display: grid;
    gap: 12px;
    align-content: start;
    justify-items: start;
}

.book-cover-frame {
    width: 100%;
    max-width: 160px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.book-cover-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

@media (max-width: 760px) {
    .publication-strip {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .feature-strip-left {
        justify-items: start;
    }
}
