/* ============================================================
   fukisrl.com — editorial design system
   ============================================================ */

:root {
    color-scheme: light;

    /* palette */
    --paper:        #f7f5f0;
    --paper-raise:  #fdfcfa;
    --ink:          #1b1c22;
    --muted:        #5f6370;
    --line:         #e3dfd5;
    --accent:       #14465f;
    --accent-ink:   #0e3246;
    --footer-bg:    #10141b;
    --footer-ink:   rgba(255, 255, 255, 0.78);

    /* type */
    --sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;

    /* rhythm */
    --wrap: 1100px;
    --pad-x: clamp(20px, 4vw, 40px);
    --measure: 46rem;
}

html { background: var(--paper); }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
}

a { color: var(--accent); text-decoration: none; }
a:visited { color: var(--accent); }
a:hover { color: var(--accent-ink); }

::selection { background: rgba(20, 70, 95, 0.18); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
}

/* ============ header ============ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 245, 240, 0.86);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap;
}
.brand:hover { color: var(--accent); }

.site-nav menu {
    display: flex;
    align-items: center;
    gap: clamp(20px, 2.8vw, 36px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* hamburger toggle (mobile only) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ink);
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============ home / landing ============ */

.home { flex: 1; }

.hero {
    padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 64px);
}

.kicker {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 22px;
}

.hero h1 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.3rem, 5.2vw, 3.6rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    max-width: 17ch;
    margin-bottom: 26px;
}

.hero .lede {
    font-size: clamp(1.08rem, 1.6vw, 1.3rem);
    line-height: 1.65;
    color: var(--muted);
    max-width: var(--measure);
    margin-bottom: 34px;
}

.hero .lede strong { color: var(--ink); font-weight: 600; }

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    margin-bottom: 46px;
}

.btn {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    padding: 0.8em 1.7em;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn:visited { color: #fff; } /* visited links must not inherit accent color */

.btn-ghost {
    display: inline-block;
    font-weight: 600;
    border-bottom: 2px solid var(--line);
    padding-bottom: 2px;
}
.btn-ghost:visited { color: var(--accent); }
.btn-ghost:hover { border-bottom-color: var(--accent); }

.deal {
    border-left: 3px solid var(--accent);
    background: var(--paper-raise);
    border-radius: 0 8px 8px 0;
    padding: 20px 26px;
    max-width: var(--measure);
}
.deal p { color: var(--muted); }
.deal strong { color: var(--ink); }

/* series grid */
.series {
    padding: 8px 0 72px;
}

.series-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--ink);
    padding-top: 18px;
    margin-bottom: 26px;
}
.series-head h2 {
    font-family: var(--serif);
    font-size: 1.55rem;
}
.series-head .note {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.essay-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 26px 26px 24px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.essay-card a.card-link { display: block; }

.essay-card:hover {
    transform: translateY(-3px);
    border-color: rgba(20, 70, 95, 0.45);
    box-shadow: 0 10px 24px rgba(16, 20, 27, 0.08);
}

.essay-no {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--accent);
    letter-spacing: 0.08em;
}

.essay-title {
    font-family: var(--serif);
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
}
.essay-card:hover .essay-title { color: var(--accent); }

.essay-desc {
    font-size: 0.94rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

.essay-go {
    font-size: 0.9rem;
    font-weight: 600;
}

.essay-card.is-coming {
    background: transparent;
    border-style: dashed;
    opacity: 0.85;
}
.essay-card.is-coming .essay-go { color: var(--muted); }

.about-strip {
    padding: 0 0 80px;
}
.about-strip a {
    font-weight: 600;
    border-bottom: 2px solid var(--line);
    padding-bottom: 2px;
}
.about-strip a:hover { border-bottom-color: var(--accent); }

/* ============ article pages ============ */

.page { flex: 1; }

.article {
    padding: clamp(44px, 7vw, 80px) 0 clamp(64px, 9vw, 110px);
}

.article-head {
    max-width: var(--measure);
    margin-bottom: 30px;
}

.article-head h1 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.18;
    letter-spacing: -0.012em;
    margin: 0 0 18px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.article-head hr {
    border: 0;
    border-top: 1px solid var(--ink);
    margin-top: 26px;
}

/* prose */
.prose {
    max-width: var(--measure);
}

.prose > * + * { margin-top: 1.25em; }

.prose p {
    line-height: 1.78;
    margin-bottom: 1.4em;
}

.prose strong { font-weight: 700; color: var(--ink); }

.prose a {
    text-decoration: underline;
    text-decoration-color: rgba(20, 70, 95, 0.4);
    text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--accent); }

.prose h2, .prose h3 {
    font-family: var(--serif);
    line-height: 1.3;
    margin-top: 1.9em;
}
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }

.prose blockquote {
    border-left: 3px solid var(--line);
    padding: 2px 0 2px 22px;
    color: var(--muted);
    font-style: italic;
}

.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.prose li { margin-bottom: 0.5em; }

.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.4em 0;
}

.prose .donate-cta { margin: 8px 0 22px; }

/* buttons inside prose must keep .btn styling, not link styling */
.prose a.btn {
    color: #fff;
    text-decoration: none;
}
.prose a.btn:hover { color: #fff; }

.qr-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin: 18px 0 26px;
}
.qr-grid figure {
    margin: 0;
    text-align: center;
}
.qr-grid img {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    margin: 0 auto 10px;
}
.qr-grid figcaption { margin-bottom: 6px; }
.qr-grid code {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: var(--muted);
    word-break: break-all;
    max-width: 250px;
    margin: 0 auto;
}

/* ============ footer ============ */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: auto;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 32px;
    padding-top: 34px;
    padding-bottom: 34px;
}

.site-footer .f-brand {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.site-footer .f-tag {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

.site-footer .f-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 0.9rem;
}
.site-footer .f-nav a { color: rgba(255, 255, 255, 0.72); }
.site-footer .f-nav a:hover { color: #fff; }

.site-footer .donate-btn,
.site-footer .donate-btn:visited {
    display: inline-block;
    color: #fff;
    background: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 6px 18px;
    font-weight: 600;
    margin-left: 10px;
    transition: background 0.15s ease;
}
.site-footer .donate-btn:hover { background: var(--accent-ink); color: #fff; }

.site-footer .f-fine {
    width: 100%;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.42);
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============ responsive ============ */

@media (max-width: 760px) {
    .site-header .wrap {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* JS on: hide the wrapped menu behind a toggle */
    html.js .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgba(16, 20, 27, 0.08);
        padding: 6px 0 14px;
    }
    html.js .site-nav.open { display: block; }

    html.js .site-nav menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 var(--pad-x);
    }
    html.js .site-nav a {
        display: block;
        font-size: 1.05rem;
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }
    html.js .site-nav menu a:last-child { border-bottom: 0; }

    .nav-toggle { display: flex; }

    .series-head { flex-direction: column; gap: 4px; }
    .series-head .note { white-space: normal; }

    .article-head h1 { font-size: clamp(1.7rem, 7.2vw, 2.1rem); }
    .hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }

    body { font-size: 17px; }
    .prose p { line-height: 1.82; }
}

@media (max-width: 480px) {
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; text-align: center; }
    .btn-ghost { text-align: center; }
    .essay-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
