/* paste.lucafchala.com — shared styles for the index, every paste page and the
   hand-built pages. Tokens match the ecosystem (see lucafchala.com/style.css). */

@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/fonts/cormorant-garamond-latin.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('/fonts/cormorant-garamond-italic-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 300 500; font-display: swap; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0c0a; --ctrl-bg: #161412; --border: #252220; --border-strong: #3a342d;
    --text: #e6e1d6; --muted: #948a7c; --accent: #c08030; --accent-dim: #6a4818;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --serif: 'Cormorant Garamond', 'Iowan Old Style', Palatino, Georgia, serif;
    color-scheme: dark;
}
[data-theme="light"] {
    --bg: #f4efe6; --ctrl-bg: #ede8df; --border: #d8d1c4; --border-strong: #c4b9a6;
    --text: #1c1a17; --muted: #6b6152; --accent: #8a5712; --accent-dim: #c89050;
    color-scheme: light;
}

html { background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 14px; line-height: 1.75; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; transition: background 0.25s, color 0.25s; }
body { min-height: 100vh; max-width: 680px; margin: 0 auto; padding: 48px 32px 72px; }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9998; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"); opacity: 0.28; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10000; background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 3px; font-size: 12px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── Controls ── */
.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.controls:has(> .controls-inner:only-child) { justify-content: flex-end; }
.back { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 6px 0; transition: color 0.15s; }
.back:hover { color: var(--accent); }
.controls-inner { display: flex; align-items: center; gap: 2px; background: var(--ctrl-bg); border: 1px solid var(--border); border-radius: 3px; padding: 3px 5px; }
.ctrl-btn { background: none; border: none; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; padding: 7px 8px; min-height: 28px; cursor: pointer; transition: color 0.15s, background 0.15s; border-radius: 2px; line-height: 1; display: inline-flex; align-items: center; }
.ctrl-btn:hover { color: var(--accent); }
.ctrl-btn[aria-pressed="true"] { color: var(--text); background: var(--border); }
.ctrl-btn.theme, #btn-theme { font-size: 15px; padding: 4px 8px; }
.ctrl-sep { color: var(--border-strong); font-size: 10px; user-select: none; line-height: 1; }

/* ── Headings ── */
header { margin-bottom: 40px; animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.name { font-family: var(--serif); font-size: clamp(48px, 10vw, 72px); font-weight: 300; line-height: 0.92; letter-spacing: -0.025em; margin-bottom: 18px; }
.name em { font-style: italic; color: var(--accent); }
.slug { font-family: var(--serif); font-size: clamp(30px, 7vw, 52px); font-weight: 300; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 12px; color: var(--accent); overflow-wrap: anywhere; }
.micro { color: var(--muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.rule { display: flex; align-items: center; gap: 16px; margin: 32px 0; color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* Shells keep the rule inside <header> (every piece of content in a landmark);
   these keep the spacing it had as a sibling: 40px above, 32px below. */
header:has(> .rule) { margin-bottom: 0; }
header > .rule { margin: 40px 0 32px; }

/* ── Paste page ── */
.content { animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.paste-pre { font-family: var(--mono); font-size: 13px; line-height: 1.85; color: var(--text); white-space: pre-wrap; word-break: break-word; tab-size: 4; }
.paste-pre.nowrap { white-space: pre; word-break: normal; overflow-x: auto; padding-bottom: 8px; }
.paste-pre a, .paste-link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
.paste-pre a:hover { text-decoration-color: var(--accent); }
.paste-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.act-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; padding: 7px 12px; min-height: 30px; cursor: pointer; text-decoration: none; transition: color 0.15s, border-color 0.15s; }
.act-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.act-btn.ok { color: var(--accent); border-color: var(--accent-dim); }
.meta { margin-bottom: 20px; }
.meta-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--muted); width: 100px; flex-shrink: 0; }
.meta-val { color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.meta-val a { color: var(--accent); }
.note { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.note a { color: var(--accent); }
.not-found { font-size: 13px; color: var(--muted); }

/* ── Index ── */
.tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.search { flex: 1; min-width: 0; background: var(--ctrl-bg); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--mono); font-size: 13px; padding: 8px 12px; }
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--accent-dim); }
.count { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; white-space: nowrap; }
.paste-list { list-style: none; animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both; }
.paste-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); text-decoration: none; transition: padding-left 0.15s; }
.paste-list li:first-child .paste-item { border-top: 1px solid var(--border); }
.paste-item:hover { padding-left: 6px; }
.paste-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.paste-slug { font-family: var(--serif); font-size: 20px; font-weight: 400; color: var(--text); line-height: 1.15; overflow-wrap: anywhere; }
.paste-desc { font-size: 11px; color: var(--muted); }
.paste-arrow { color: var(--accent); font-size: 16px; flex-shrink: 0; transition: transform 0.15s; }
.paste-item:hover .paste-arrow { transform: translateX(3px); }
.empty { color: var(--muted); font-size: 12px; padding: 16px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 540px) { body { padding: 28px 18px 52px; } }

/* type "links" (paste.js renderLinks) */
.links-view { margin-top: 20px; }
.links-view .notice { border-left: 3px solid var(--accent); padding: 12px 18px; background: var(--ctrl-bg); border-radius: 0 3px 3px 0; margin-bottom: 28px; font-size: 13px; font-weight: 500; color: var(--accent); white-space: pre-line; }
.links-view .block { margin-bottom: 24px; }
.links-view .block p, .links-view .links-text { font-size: 13px; color: var(--muted); margin-bottom: 8px; white-space: pre-line; }
.links-view .link-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 3px; background: var(--ctrl-bg); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.links-view .link-row:hover { border-color: var(--accent); }
.links-view .link-url { font-size: 12px; color: var(--accent); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-view .link-arr { color: var(--accent); font-size: 13px; flex-shrink: 0; }
.links-view .members { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.links-view .members span { display: block; padding: 4px 0; }
.links-view .members .members-title { color: var(--accent); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
