/* Shared styles for the Yazılar (blog) pages — ink/washi, theme-aware */
:root {
    --ink: #14110F; --ink-800: #1c1815; --ink-700: #241f1b;
    --hairline: rgba(237, 231, 219, 0.12); --hairline-strong: rgba(237, 231, 219, 0.22);
    --washi: #EDE7DB; --washi-dim: rgba(237, 231, 219, 0.74); --washi-faint: rgba(237, 231, 219, 0.46);
    --shu: #C1352A; --shu-bright: #d64435;
    --code-bg: #100d0b;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-jp: 'Shippori Mincho B1', serif;
}
:root[data-theme="light"] {
    --ink: #EDE7DB; --ink-800: #E5DDCD; --ink-700: #DBD1BE;
    --hairline: rgba(20, 17, 15, 0.14); --hairline-strong: rgba(20, 17, 15, 0.26);
    --washi: #241E19; --washi-dim: rgba(36, 30, 25, 0.78); --washi-faint: rgba(36, 30, 25, 0.52);
    --shu: #A62B22; --shu-bright: #B23127;
    --code-bg: #E3D9C6;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --ink: #EDE7DB; --ink-800: #E5DDCD; --ink-700: #DBD1BE;
        --hairline: rgba(20, 17, 15, 0.14); --hairline-strong: rgba(20, 17, 15, 0.26);
        --washi: #241E19; --washi-dim: rgba(36, 30, 25, 0.78); --washi-faint: rgba(36, 30, 25, 0.52);
        --shu: #A62B22; --shu-bright: #B23127;
        --code-bg: #E3D9C6;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; background: var(--ink); color: var(--washi);
    font-family: var(--font-body); font-weight: 300; font-size: 18px; line-height: 1.85;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    transition: background 0.4s ease, color 0.4s ease;
}
::selection { background: var(--shu); color: #EDE7DB; }
:focus-visible { outline: 2px solid var(--shu-bright); outline-offset: 3px; border-radius: 2px; }
a { color: inherit; }
img { max-width: 100%; height: auto; border-radius: 4px; display: block; }
hr { border: 0; height: 1px; background: var(--hairline); margin: 2.4rem 0; }

.skip-link { position: absolute; left: -999px; background: var(--shu); color: #EDE7DB; padding: 0.6rem 1rem; z-index: 50; font-family: var(--font-mono); font-size: 0.8rem; }
.skip-link:focus { left: 0; top: 0; }

/* top bar */
.bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    max-width: 820px; margin: 0 auto; padding: 1.1rem 1.5rem;
    background: color-mix(in srgb, var(--ink) 82%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
}
.bar .back, .bar .home { font-family: var(--font-mono); font-size: 0.78rem; color: var(--washi-dim); text-decoration: none; letter-spacing: 0.03em; transition: color 0.2s ease; }
.bar .back:hover, .bar .home:hover { color: var(--shu-bright); }
.bar-right { display: flex; align-items: center; gap: 1.3rem; }
.theme-btn { background: none; border: 1px solid var(--hairline-strong); color: var(--washi); border-radius: 4px; width: 34px; height: 30px; cursor: pointer; font-size: 0.9rem; line-height: 1; transition: border-color 0.2s ease, color 0.2s ease; }
.theme-btn:hover { border-color: var(--shu-bright); color: var(--shu-bright); }

main { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }

/* article */
.post { padding: 3rem 0 4rem; }
.post-head { padding-bottom: 2rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--hairline); }
.post-date { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--shu-bright); text-transform: uppercase; margin-bottom: 1rem; }
.post h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0; }

.post-body { font-size: 1.05rem; }
.post-body h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3.5vw, 1.9rem); line-height: 1.3; margin: 2.6rem 0 1rem; letter-spacing: -0.01em; }
.post-body h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin: 2rem 0 0.8rem; }
.post-body h4 { font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: 0.02em; margin: 1.6rem 0 0.6rem; color: var(--washi); }
.post-body p { color: var(--washi-dim); margin: 0 0 1.35rem; }
.post-body strong { color: var(--washi); font-weight: 500; }
.post-body a { color: var(--washi); text-decoration: none; border-bottom: 1px solid var(--shu); transition: background 0.2s ease; }
.post-body a:hover { background: color-mix(in srgb, var(--shu) 16%, transparent); }
.post-body ul, .post-body ol { color: var(--washi-dim); margin: 0 0 1.4rem; padding-left: 1.3rem; }
.post-body li { margin: 0.5rem 0; }
.post-body ul li::marker { color: var(--shu); }
.post-body ol li::marker { color: var(--shu-bright); font-family: var(--font-mono); font-size: 0.85em; }
.post-body img { margin: 1.8rem 0; border: 1px solid var(--hairline); }

/* inline + block code */
.post-body code { font-family: var(--font-mono); font-size: 0.86em; background: var(--code-bg); border: 1px solid var(--hairline); border-radius: 3px; padding: 0.12em 0.4em; }
.post-body pre.code { background: var(--code-bg); border: 1px solid var(--hairline); border-left: 2px solid var(--shu); border-radius: 4px; padding: 1.15rem 1.3rem; overflow-x: auto; margin: 1.6rem 0; position: relative; }
.post-body pre.code code { background: none; border: 0; padding: 0; font-size: 0.84rem; line-height: 1.7; color: var(--washi); white-space: pre; }
.post-body pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 0; right: 0; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--washi-faint); background: var(--hairline); padding: 0.15rem 0.5rem; border-radius: 0 4px 0 4px; }

.post-body blockquote { margin: 1.8rem 0; padding: 0.4rem 0 0.4rem 1.5rem; border-left: 2px solid var(--shu); }
.post-body blockquote p { color: var(--washi); font-family: var(--font-display); font-style: italic; font-size: 1.15rem; margin: 0.4rem 0; }

.post-body table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: 0.92rem; }
.post-body th, .post-body td { border: 1px solid var(--hairline); padding: 0.6rem 0.8rem; text-align: left; }
.post-body th { font-family: var(--font-mono); font-size: 0.78rem; color: var(--washi); }

/* prev / next */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.pn { display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; padding: 1rem 1.2rem; border: 1px solid var(--hairline); border-radius: 4px; transition: border-color 0.25s ease, background 0.25s ease; }
.pn:hover { border-color: var(--hairline-strong); background: var(--ink-800); }
.pn.newer { text-align: right; }
.pn-k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--shu-bright); }
.pn-t { font-family: var(--font-display); font-size: 0.98rem; color: var(--washi); line-height: 1.35; }

/* index list */
.idx-head { padding: 3.5rem 0 1rem; }
.idx-head .kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--shu-bright); }
.idx-head h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); margin: 0.8rem 0 0.6rem; }
.idx-head p { color: var(--washi-dim); max-width: 56ch; margin: 0; }
.post-list { list-style: none; margin: 2.5rem 0 4rem; padding: 0; counter-reset: pl; border-top: 1px solid var(--hairline); }
.post-list li { border-bottom: 1px solid var(--hairline); }
.post-list a { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 1.2rem; align-items: baseline; text-decoration: none; padding: 1.1rem 0.4rem; transition: background 0.25s ease, padding-left 0.25s ease; }
.post-list a:hover, .post-list a:focus-visible { background: var(--ink-800); padding-left: 1rem; }
.post-list a::before { counter-increment: pl; content: counter(pl, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.72rem; color: var(--shu-bright); }
.post-list .pl-title { font-family: var(--font-display); font-size: 1.14rem; font-weight: 500; color: var(--washi); line-height: 1.4; }
.post-list a:hover .pl-title { color: var(--shu-bright); }
.post-list .pl-date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--washi-faint); white-space: nowrap; }

.foot { max-width: 820px; margin: 0 auto; padding: 2.2rem 1.5rem; border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--washi-faint); }
.foot .motto { font-family: var(--font-jp); font-size: 0.85rem; color: var(--washi-dim); }

@media (max-width: 560px) {
    body { font-size: 17px; }
    .post-nav { grid-template-columns: 1fr; }
    .pn.newer { text-align: left; }
    .post-list a { grid-template-columns: 2rem 1fr; }
    .post-list .pl-date { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } body { transition: none; } }
