/* Shared styling for Click's /about + /log — the Rendered "about + log" convention
   (lineage: Boltkey -> SetKey), retoned to Click's warm-amber-on-dark design system. */

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

:root {
  --bg: #0a0a0b; --text: #fafafa; --muted: #a1a1a6; --dim: #8a8a8e;
  --surface: #16130e; --border: #3a352c;
  --amber: #e8a849; --amber-bright: #f0c060; --accent: var(--amber); --green: #7ac47a;
  --glow: rgba(232,168,73,0.30); --radius: 12px; --radius-sm: 6px;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.light-mode {
  --bg: #fafafa; --text: #1c1c1e; --muted: #48484a; --dim: #6e6e72;
  --surface: #f2efe9; --border: #d8d2c6; --amber: #8a6015; --amber-bright: #a8761c;
  --green: #4a7a4a; --glow: rgba(232,168,73,0.10);
}
html.high-contrast { --glow: transparent; --border: #888; --text: #fff; --muted: #e0e0e0; --dim: #b0b0b0; --amber: #ffcc00; --amber-bright: #ffdd55; --surface: #1a1a1a; }
html.high-contrast.light-mode { --text: #000; --muted: #222; --dim: #444; --amber: #cc8800; --amber-bright: #aa6e00; --surface: #f0f0f0; }

body {
  font-family: var(--font-body); color: var(--text); line-height: 1.62;
  min-height: 100vh; min-height: 100dvh; padding: 2.25rem 1.5rem 4rem;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
  background:
    radial-gradient(60% 42% at 50% 22%, var(--glow) 0%, transparent 60%),
    radial-gradient(140% 100% at 50% 0%, #16120c 0%, #0c0a08 55%, #0a0a0b 100%);
  background-attachment: fixed;
}
.light-mode body { background: radial-gradient(60% 38% at 50% 0%, var(--glow) 0%, transparent 60%), var(--bg); }
html.high-contrast body { background: #000; }
html.high-contrast.light-mode body { background: #fff; }

.wrap { max-width: 44rem; margin: 0 auto; }

/* nav */
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em; color: var(--dim); text-decoration: none; margin-bottom: 2rem; transition: color 0.15s; }
.back-link:hover, .back-link:focus-visible { color: var(--amber); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.76rem; color: var(--dim); margin-bottom: 1.75rem; }
.breadcrumb a { color: var(--dim); text-decoration: none; }
.breadcrumb a:hover, .breadcrumb a:focus-visible { color: var(--amber); }

/* "click" wordmark + eighth-note lockup */
.brand { display: inline-flex; align-items: baseline; gap: 0.06rem; font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; letter-spacing: -0.01em; line-height: 1; color: var(--amber); }
.brand-note { width: auto; height: 0.92em; align-self: flex-end; transform: translateY(-0.06em); filter: drop-shadow(0 0 10px var(--glow)); }
.brand-lockup { display: inline-flex; flex-direction: column; align-items: flex-start; }
.brand-the { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.45em; color: var(--dim); margin: 0 0 0.25rem 0.12rem; }

/* about app-icon header */
.app-icon-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.app-icon { width: 84px; height: 84px; border-radius: 20px; flex-shrink: 0; box-shadow: 0 0 38px var(--glow), 0 8px 20px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.05); }
.app-icon-header .brand { font-size: 1.9rem; }
.app-subtitle { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin: 0.3rem 0 0.15rem; }
.app-version { font-family: var(--font-mono); font-size: 0.7rem; color: var(--dim); }

/* typography */
.page-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin: 0.6rem 0 0.35rem; }
.lede { color: var(--muted); font-size: 1.04rem; margin: 0.25rem 0 2.25rem; max-width: 36rem; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--text); margin: 2.5rem 0 0.8rem; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text); margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 0.9rem; color: var(--text); }
p, li, dd { color: var(--text); }
ol, ul { padding-left: 1.3rem; margin: 0 0 1.1rem; color: var(--text); }
li { margin-bottom: 0.45rem; }
strong { color: var(--amber); font-weight: 600; }
em { color: var(--muted); }
dl { margin: 0 0 1.4rem; }
dt { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--text); margin-top: 1.1rem; }
dd { font-size: 0.92rem; color: var(--muted); margin: 0.25rem 0 0; }
kbd { font-family: var(--font-mono); font-size: 0.78rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0.08rem 0.4rem; color: var(--text); }
details { margin: 1.4rem 0; }
details summary { cursor: pointer; color: var(--text); font-family: var(--font-display); font-weight: 600; }
details summary:hover { color: var(--amber); }

/* the "from X" example chip rendered like the app draws it */
.chip { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--dim); font-family: var(--font-mono); font-size: 0.74rem; white-space: nowrap; vertical-align: middle; }
.star-ex { color: var(--amber); font-weight: 700; }

/* tooltips (terms AND commit receipts) — JS-controlled, edge-aware */
.about-ref { display: inline-block; position: relative; color: var(--amber); cursor: help; border-bottom: 1px dotted var(--amber); }
.about-ref.commit { font-family: var(--font-mono); font-size: 0.82em; color: var(--dim); border-bottom-color: var(--dim); }
.about-ref.commit:hover, .about-ref.commit.tooltip-visible, .about-ref.commit.tooltip-open { color: var(--amber); border-bottom-color: var(--amber); }
.about-tip { position: absolute; bottom: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--border); padding: 0.55rem 0.75rem; border-radius: 7px; font-size: 0.72rem; font-family: var(--font-body); white-space: normal; width: min(300px, calc(100vw - 2rem)); color: var(--muted); line-height: 1.55; box-shadow: 0 6px 18px rgba(0,0,0,0.5); z-index: 10; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.15s; }
.about-tip::after { content: ''; position: absolute; top: 100%; left: 1rem; border: 5px solid transparent; border-top-color: var(--border); }
.about-tip strong { color: var(--text); font-weight: 600; }
.about-tip code { color: var(--amber); font-family: var(--font-mono); font-size: 0.92em; }
.about-ref.tooltip-visible .about-tip, .about-ref.tooltip-open .about-tip { opacity: 1; visibility: visible; }
.about-ref.tooltip-below .about-tip { bottom: auto; top: calc(100% + 6px); }
.about-ref.tooltip-below .about-tip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--border); }
.about-ref.tooltip-right .about-tip { left: auto; right: 0; }
.about-ref.tooltip-right .about-tip::after { left: auto; right: 1rem; }

/* log callout (about -> log) */
.log-callout { margin: 2.5rem 0 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: var(--radius); font-size: 0.9rem; }
.log-callout a { color: var(--amber); font-weight: 600; text-decoration: none; }
.log-callout a:hover, .log-callout a:focus-visible { text-decoration: underline; }

/* log timeline */
.log-timeline { border-left: 2px solid var(--border); padding-left: 1.6rem; margin: 0 0 0 0.25rem; }
.log-entry { position: relative; margin-bottom: 2.6rem; }
.log-entry::before { content: ''; position: absolute; left: -1.95rem; top: 0.4rem; width: 9px; height: 9px; background: var(--amber); border: 2px solid var(--bg); border-radius: 50%; box-shadow: 0 0 8px var(--glow); }
.log-date { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--dim); margin-bottom: 0.25rem; }
.log-headline { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--text); margin: 0 0 0.5rem; }
.log-body { font-size: 0.92rem; color: var(--muted); line-height: 1.72; }
.log-body p { color: var(--muted); margin: 0 0 0.8rem; }
.log-body a { color: var(--amber); }

/* site footer — the Rendered Digital lockup convention (nav + prism + wordmark) */
.site-footer { width: 100%; max-width: 44rem; margin: 2.75rem auto 0; padding: 1.75rem 1.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); text-align: center; }
.footer-nav { display: flex; justify-content: center; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; }
.footer-nav a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--amber); }
.footer-dot { color: var(--border); }
.footer-signout { display: inline-flex; align-items: center; }
.footer-signout button { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1; color: var(--muted); background: none; border: none; padding: 0; margin: 0; cursor: pointer; transition: color 0.15s; }
.footer-signout button:hover, .footer-signout button:focus-visible { color: var(--amber); }
.footer-trust { font-size: 0.78rem; color: var(--dim); font-style: italic; margin: 0.9rem auto 0; max-width: 30rem; line-height: 1.5; }
.footer-credit { font-size: 0.75rem; color: var(--muted); opacity: 0.62; margin: 0.95rem 0 0; }
.footer-credit a { color: var(--muted); text-decoration: none; }
.footer-credit a:hover, .footer-credit a:focus-visible { color: var(--amber); }
.rendered-lockup { display: inline-flex; align-items: center; gap: 0.4em; text-decoration: none; color: inherit; }
.rendered-lockup:hover { color: var(--amber); }
.rendered-prism { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: middle; }
.rendered-verb { font-weight: 400; letter-spacing: normal; }
.rendered-wordmark { font-family: var(--font-body); font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; font-size: 0.85em; }

:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { .back-link, .breadcrumb a, .about-ref { transition: none; } }
