/* Prophetus — house fonts (SIL OFL) and a few hand-made touches on top of Tailwind. */
@font-face { font-family: "Le Murmure"; src: url("../fonts/LeMurmure-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Brygada 1918"; src: url("../fonts/Brygada1918.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Brygada 1918"; src: url("../fonts/Brygada1918-Italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("../fonts/SplineSansMono.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Major Mono Display"; src: url("../fonts/MajorMonoDisplay-Regular.woff2") format("woff2"); font-display: swap; }

:root { --paper: #F4F1EA; --ink: #111113; --ash: #8A8780; --ember: #C4472D; --dawn: #E2A33B; --tide: #2F6F8F; --violet: #5B4A8C; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "kern", "liga", "onum"; text-rendering: optimizeLegibility; }
::selection { background: var(--ember); color: var(--paper); }

/* Subtle paper grain */
.grain::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.grain > :where(main, footer) { position: relative; z-index: 1; }
.grain > #site-header { position: sticky; z-index: 40; }

.display { font-family: "Le Murmure", "Brygada 1918", serif; text-transform: uppercase; letter-spacing: .01em; line-height: .92; font-weight: 400; }
.mono { font-family: "Spline Sans Mono", ui-monospace, Menlo, Consolas, monospace; }
.numeral { font-family: "Major Mono Display", "Spline Sans Mono", monospace; text-transform: lowercase; }
.label { font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }

/* The horizon line: a hairline with an ember half-sun */
.horizon { position: relative; height: 1px; background: currentColor; opacity: .9; }
.horizon.sun::after { content: ""; position: absolute; left: var(--sun, 50%); bottom: 0; width: 14px; height: 7px; transform: translateX(-50%);
  background: var(--ember); border-radius: 14px 14px 0 0; }
.draw-line { transform-origin: left; animation: draw 1.6s cubic-bezier(.2,.7,.1,1) both; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rise { animation: rise .9s cubic-bezier(.2,.7,.1,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.1,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal, .rise, .draw-line { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; } }

/* Book covers */
.cover { aspect-ratio: 2 / 3; position: relative; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 18px 30px -18px rgba(17,17,19,.45); transition: transform .5s cubic-bezier(.2,.7,.1,1), box-shadow .5s; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card:hover .cover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 28px 40px -20px rgba(17,17,19,.55); }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 5%; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.08) 60%, transparent); pointer-events: none; }
.gen-cover { display: flex; flex-direction: column; container-type: inline-size; }
.gen-cover .gc-title { font-family: "Le Murmure", serif; text-transform: uppercase; line-height: .9; font-size: 13cqw; letter-spacing: .01em; }
.gen-cover .gc-sub { font-family: "Brygada 1918", serif; font-style: italic; font-size: 4.2cqw; line-height: 1.25; }
.gen-cover .gc-author { font-family: "Spline Sans Mono", monospace; text-transform: uppercase; letter-spacing: .32em; font-size: 3.4cqw; }
.gen-cover .gc-step { font-family: "Major Mono Display", monospace; font-size: 3.4cqw; }

/* Long-form text */
.prose-p { font-size: 1.125rem; line-height: 1.75; color: #1A1A1C; }
.prose-p > * + * { margin-top: 1.1em; }
.prose-p h2 { font-family: "Brygada 1918", serif; font-weight: 700; font-size: 1.6rem; line-height: 1.25; margin-top: 2em; }
.prose-p h3 { font-weight: 700; font-size: 1.25rem; margin-top: 1.6em; }
.prose-p a { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose-p ul { list-style: none; padding-left: 0; }
.prose-p ul li { position: relative; padding-left: 1.6em; margin-top: .55em; }
.prose-p ul li::before { content: ""; position: absolute; left: 0; top: .78em; width: .8em; height: 1px; background: var(--ember); }
.prose-p ol { list-style: decimal; padding-left: 1.4em; }
.prose-p blockquote { border-left: 1px solid var(--ink); padding: .2em 0 .2em 1.4em; font-style: italic; font-size: 1.25rem; }
.prose-p code { font-family: "Spline Sans Mono", monospace; font-size: .85em; background: rgba(17,17,19,.06); padding: .1em .35em; }
.prose-p pre { background: var(--ink); color: var(--paper); padding: 1.2em; overflow-x: auto; font-size: .85rem; }
.prose-p pre code { background: none; padding: 0; }
.prose-p img { max-width: 100%; height: auto; }
.prose-p hr { border: 0; height: 1px; background: var(--ash); margin: 2.5em auto; width: 6rem; }
.prose-p .table-wrap { overflow-x: auto; }
.prose-p table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose-p th, .prose-p td { text-align: left; padding: .6em .8em; border-bottom: 1px solid rgba(17,17,19,.15); vertical-align: top; }
.prose-p th { font-family: "Spline Sans Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.prose-p > p:first-child::first-line { font-variant: small-caps; letter-spacing: .04em; }
.prose-p strong { font-weight: 700; }

/* Confidence labels */
.conf { font-family: "Spline Sans Mono", monospace; font-size: .66rem; letter-spacing: .16em; padding: .2em .55em; border: 1px solid currentColor; white-space: nowrap; }
.conf-KNOWN { color: #111113; } .conf-LIKELY { color: #2F6F8F; } .conf-POSSIBLE { color: #B07A1F; } .conf-SPECULATIVE { color: #5B4A8C; } .conf-OPEN { color: #8A8780; }

/* Forms */
.field { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(17,17,19,.35); padding: .7rem 0; font-size: 1rem; outline: none; transition: border-color .2s; border-radius: 0; }
.field:focus { border-bottom-color: var(--ember); }
textarea.field { border: 1px solid rgba(17,17,19,.25); padding: .8rem; }
textarea.field:focus { border-color: var(--ember); }
.btn { display: inline-flex; align-items: center; gap: .6rem; font-family: "Spline Sans Mono", monospace; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; padding: .9rem 1.4rem; background: var(--ink); color: var(--paper); transition: background .25s, transform .25s; }
.btn:hover { background: var(--ember); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.link-u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s; }
.link-u:hover { background-size: 100% 1px; }

/* Star rating input */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.stars input { display: none; }
.stars label { cursor: pointer; color: rgba(17,17,19,.2); font-size: 1.2rem; transition: color .15s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--ember); }

/* Command palette */
#palette[open] { display: flex; }
dialog::backdrop { background: rgba(17,17,19,.45); backdrop-filter: blur(3px); }

/* Reading progress bar */
#progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--ember); z-index: 60; width: 0; transition: width .1s linear; }

.toast { animation: toast 5s ease both; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(10px); } }

.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Text wordmark: PROPHETUS / horizon line with ember half-sun / PUBLISHING */
.wordmark { display: inline-flex; flex-direction: column; align-items: center; color: var(--ink); line-height: 1; user-select: none; }
.wordmark-paper { color: var(--paper); }
.wm-name { font-family: "Le Murmure", "Brygada 1918", serif; text-transform: uppercase; letter-spacing: .015em; line-height: .86; font-size: 1em; padding-left: .015em; }
.wm-rule { position: relative; display: block; align-self: stretch; height: 1px; margin: .1em -.5em 0; background: currentColor; }
.wm-rule::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: .24em; height: .12em; transform: translateX(-50%); background: var(--ember); border-radius: .24em .24em 0 0; transition: height .4s cubic-bezier(.2,.7,.1,1), width .4s cubic-bezier(.2,.7,.1,1); }
.wm-sub { font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .17em; letter-spacing: .62em; padding-left: .62em; margin-top: .55em; text-transform: uppercase; opacity: .85; }
a:hover > .wordmark .wm-rule::after { width: .3em; height: .15em; }

/* Header: the wordmark stands on the menu's bottom border, which doubles as its horizon. */
.wm-home { position: relative; z-index: 2; }
.wordmark-on-line { display: block; }
.wordmark-on-line .wm-name { display: block; line-height: .78; padding: 0 .04em; margin-bottom: -.045em; }
.wordmark-on-line .wm-sub { position: absolute; left: 50%; top: calc(100% + 1px); transform: translateX(-50%); margin: 0; padding: .55em .25em .4em .87em; white-space: nowrap; background: var(--paper); color: var(--ink); opacity: 1; font-size: .16em; }
#hdr-line.sun::after { z-index: 1; transition: width .45s cubic-bezier(.2,.7,.1,1), height .45s cubic-bezier(.2,.7,.1,1), box-shadow .45s; animation: sunrise 1.4s .5s cubic-bezier(.2,.7,.1,1) both; }
#hdr-line { background: linear-gradient(90deg, currentColor, currentColor) ; }
#hdr-line.glow::after { width: 20px; height: 10px; box-shadow: 0 -2px 18px 3px rgba(196,71,45,.35); }
@keyframes sunrise { from { height: 0; width: 6px; opacity: 0; } to { height: 7px; width: 14px; opacity: 1; } }
#site-header .wm-home:hover .wm-name { color: #000; }

/* Invisible hCaptcha container: keep it out of flex layouts */
.js-hcaptcha { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Single-colour icon from an SVG file (inherits text colour, like Font Awesome) */
.icon-mask { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.15em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* Cookie consent */
.cookie-banner { opacity: 0; transform: translateY(14px); transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.1,1); }
.cookie-banner.is-in { opacity: 1; transform: none; }
.toggle { appearance: none; width: 44px; height: 24px; border-radius: 99px; background: rgba(17,17,19,.18); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.7,.1,1); }
.toggle:checked { background: var(--ember); }
.toggle:checked::after { transform: translateX(20px); }
.toggle:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* Footer wordmark: larger, and its horizon line stays inside the footer column */
.footer-wordmark .wordmark { max-width: 100%; }
.footer-wordmark .wm-rule { margin-left: 0; margin-right: 0; }
