/* keys.lucafchala.com — 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: 720px; 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 { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.back { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 6px 0; }
.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; border-radius: 2px; line-height: 1; transition: color 0.15s, background 0.15s; }
.ctrl-btn:hover { color: var(--accent); }
.ctrl-btn[aria-pressed="true"] { color: var(--text); background: var(--border); }
.ctrl-btn.theme { font-size: 15px; padding: 4px 8px; }
.ctrl-sep { color: var(--border-strong); font-size: 10px; user-select: none; }

header { margin-bottom: 44px; 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); }
.micro { color: var(--muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.rule { display: flex; align-items: center; gap: 16px; margin: 36px 0; color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.section { margin-bottom: 44px; animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.section + .section { animation-delay: 0.18s; }
.section-label { font-size: 10px; font-weight: 400; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.key-block { background: var(--ctrl-bg); border: 1px solid var(--border); border-radius: 4px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.key-content { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 12px 14px; max-height: 360px; overflow: auto; }
.key-short { max-height: none; }
.meta { display: flex; flex-direction: column; }
.meta-row { display: flex; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.meta-row:last-child { border-bottom: none; }
.meta-row dt { color: var(--muted); width: 140px; flex-shrink: 0; }
.meta-row dd { color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fp { color: var(--accent); letter-spacing: 0.02em; }
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.act-btn { display: inline-flex; align-items: center; 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; white-space: nowrap; }
.act-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.act-btn.ok { color: var(--accent); border-color: var(--accent-dim); }
.cmd-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: -6px; }
.cmd { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 6px 6px 6px 12px; }
.cmd code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; color: var(--text); overflow-x: auto; white-space: nowrap; }
.armor summary { cursor: pointer; font-size: 11px; color: var(--muted); padding: 4px 0; }
.armor summary:hover { color: var(--accent); }
.armor[open] summary { margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.hint a { color: var(--accent); }

@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; }
    .key-block { padding: 14px; }
    .meta-row { flex-direction: column; gap: 0; }
    .meta-row dt { width: auto; }
    .key-content { font-size: 11px; }
}
