/* Cesar's Hideout. Self-hosted fonts, no external requests. */
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --bg-2: #141418;
  --surface: #17171c;
  --line: #26262d;
  --text: #ffffff;
  --muted: #b3b3bb;      /* 9.6:1 on --bg */
  --faint: #8c8c95;      /* 5.9:1 on --bg */
  --yellow: #ffc400;
  --orange: #ff7a00;
  --accent: linear-gradient(100deg, var(--yellow), var(--orange));
  --head: "Barlow Condensed", "Oswald", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 78rem;
}
/* Big screens: scale everything up so 1440p and 4K don't look tiny. */
@media (min-width: 1900px) { html { font-size: 19px; } }
@media (min-width: 2500px) { html { font-size: 23px; } }
@media (min-width: 3400px) { html { font-size: 30px; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { overflow-x: clip; scrollbar-gutter: stable; background: #0b0b0d; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--yellow); }
a:hover { color: var(--orange); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: 12px; transform: translateY(-200%); z-index: 50; padding: 10px 14px; background: var(--yellow); color: #111; font-weight: 700; border-radius: 6px; text-decoration: none; }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Headings: heavy condensed, italic slant like the logo. */
h1, h2, h3, .head {
  font-family: var(--head);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* Backdrop: plain dark with a little film grain. Shared by the full-screen pages. */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
}
.stage::after {            /* grain */
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Transparent logo, shown as-is. */
.logo, .brand img { display: block; margin: 0 auto; }

/* Full-viewport pages: / and 404 */
.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  text-align: center;
}
.screen main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.screen .logo { width: min(86vw, 34rem, 56svh * 1.355); }
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: clamp(8px, 2svh, 20px) 0 10px;
  font: 600 0.78rem/1 var(--body);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--yellow);
}
.kicker::before, .kicker::after { content: ""; width: clamp(28px, 6vw, 64px); height: 1px; background: var(--accent); }
.kicker::after { transform: scaleX(-1); }
.tagline {
  margin: 0;
  font-family: var(--head);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.5rem, 4.4vw, 2.5rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-wrap: balance;
  max-width: 22em;
}
.contact { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; }
.screen footer { padding: 0 20px 22px; color: var(--faint); font-size: 0.8rem; letter-spacing: 0.04em; }

/* Gentle entrance */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(10px); animation: rise 0.9s cubic-bezier(.2, .7, .2, 1) forwards; }
  .rise.d1 { animation-delay: 0.12s; }
  .rise.d2 { animation-delay: 0.26s; }
  .rise.d3 { animation-delay: 0.4s; }
  .logo.rise { transform: translateY(10px) scale(0.985); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: 0.75; } }

/* 404 */
.code {
  margin: 0;
  font-size: clamp(4.5rem, 16vw, 9rem);
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em; /* room for the slant */
}
.screen-404 .logo { width: min(60vw, 18rem, 30svh * 1.355); margin-bottom: 4px; }
.lead { margin: 10px auto 22px; max-width: 30em; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 8px;
  font: 700 0.95rem/1 var(--body);
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #141008; }
.btn-primary:hover { color: #141008; filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { color: var(--text); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { color: var(--text); border-color: #3a3a44; background: rgba(255, 255, 255, 0.05); }

/* Site header (books) */
.site-header { border-bottom: 1px solid var(--line); background: rgba(11, 11, 13, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
.brand { display: block; line-height: 0; border-radius: 6px; }
.brand img { height: 2.6rem; width: auto; margin: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 8px 4px; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Books page */
.page-head { padding-top: clamp(1.75rem, 4vw, 3rem); padding-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }
.page-head h1 { margin: 0; font-size: clamp(2.6rem, 6.5vw, 4.5rem); padding-right: 0.06em; }
.page-head h1 span { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.page-head .crumb { margin: 0 0 0.6rem; font-size: 0.9rem; }
.page-head .crumb a { color: var(--faint); text-decoration: none; font-weight: 600; }
.page-head .crumb a:hover { color: var(--text); }
.page-head p { margin: 12px 0 0; color: var(--muted); max-width: 36em; font-size: 1.05rem; }
.rule { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, var(--orange), rgba(255, 196, 0, 0.35) 30%, var(--line) 60%); }

.books {
  list-style: none;
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 13rem));
  gap: clamp(1.25rem, 2.4vw, 2rem);
}
.book { display: flex; flex-direction: column; }
.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px rgba(0, 0, 0, 0.45);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a.cover:hover, a.cover:focus-visible { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 166, 0, 0.35); }
/* Placeholder cover: used until a book has its own cover image. */
.cover-ph {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1.1rem;
  background:
    radial-gradient(90% 60% at 85% 10%, rgba(255, 122, 0, 0.22), transparent 70%),
    linear-gradient(180deg, #1c1c22 0%, #101013 100%);
  border: 1px solid var(--line);
}
.cover-ph::before {  /* speed streak, like the logo's swooshes */
  content: "";
  position: absolute;
  left: -10%;
  right: 18%;
  top: 30%;
  height: 0.55rem;
  background: var(--accent);
  transform: rotate(-9deg);
  clip-path: polygon(0 60%, 100% 0, 92% 100%, 0 100%);
  opacity: 0.9;
}
.cover-ph .ph-mark { position: absolute; top: 1.1rem; left: 1.1rem; font: 700 0.68rem/1 var(--body); letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); }
.cover-ph .ph-title { font-family: var(--head); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(1.7rem, 2.4vw, 2.1rem); line-height: 0.9; padding-right: 0.1em; overflow-wrap: anywhere; }
.cover-ph .ph-series { font: 600 0.75rem/1.3 var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--yellow); }

.book-info { padding-top: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.book h2 { margin: 0; font-size: 1.5rem; padding-right: 0.06em; }
.book .series-sm { margin: 0; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.book h2 a { color: var(--text); text-decoration: none; }
.book h2 a:hover { color: var(--yellow); }
.book .tagline-sm { margin: 0; color: var(--muted); font-size: 0.95rem; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 0.75rem; }
.status {
  font: 700 0.7rem/1 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.status-published { color: #5fe0a0; }
.status-draft { color: var(--yellow); }
.status-in-progress { color: #ff9b42; }
.status-coming-soon { color: var(--faint); }
.book .btn { min-height: 40px; padding: 8px 16px; }

.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 22px; padding-bottom: 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Pages with a header and footer fill the screen, footer at the bottom. */
.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.page main { flex: 1; }

/* Short screens (small laptops): smaller covers so a book fits without scrolling. */
@media (min-width: 541px) and (max-height: 900px) {
  .page-head { padding-top: 1.5rem; padding-bottom: 1rem; }
  .books { grid-template-columns: repeat(auto-fill, minmax(10rem, 11rem)); padding-top: 1.5rem; }
  .cover-ph .ph-title { font-size: 1.6rem; }
}

/* Phones: same cards as desktop, two per row. */
@media (max-width: 540px) {
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 0.9rem; padding-top: 1.25rem; }
  .book-info { padding-top: 10px; gap: 4px; }
  .book h2 { font-size: 1.3rem; }
  .book .series-sm, .book .tagline-sm { font-size: 0.85rem; }
  .meta { padding-top: 0.6rem; gap: 8px; }
  .status { font-size: 0.62rem; padding: 5px 6px; letter-spacing: 0.1em; }
  .book .btn { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
  .cover-ph { padding: 0.8rem; gap: 0.35rem; }
  .cover-ph .ph-mark { top: 0.8rem; left: 0.8rem; font-size: 0.55rem; letter-spacing: 0.18em; }
  .cover-ph .ph-title { font-size: 1.5rem; }
  .cover-ph .ph-series { font-size: 0.6rem; letter-spacing: 0.1em; }
}

/* Header nav: room for more than one link. */
.site-nav { display: flex; gap: 18px; }

/* Text pages (Ethics) */
.prose { max-width: 46rem; padding-top: clamp(1.5rem, 3vw, 2.25rem); padding-bottom: clamp(3rem, 6vw, 4.5rem); color: #dcdce2; font-size: 1.05rem; line-height: 1.7; }
.prose p { margin: 0 0 1.1em; }
.prose .intro { font-size: 1.15rem; color: var(--text); }
.prose section { margin: 2.25rem 0; }
.prose h2 { margin: 0 0 0.9rem; font-size: clamp(1.5rem, 3vw, 1.9rem); padding-right: 0.08em; }
.prose ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.prose li { position: relative; padding-left: 1.4rem; }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.6rem; height: 2px; background: var(--orange); }
.prose .sign { margin-top: 2rem; font: 800 italic 1.8rem/1 var(--head); text-transform: uppercase; color: var(--yellow); padding-right: 0.08em; }

/* Header: Subscribe sits next to the links on every page. */
.hdr-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.sub { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: #ff0000; color: #fff; font: 600 0.88rem/1 "Roboto", var(--body); text-decoration: none; white-space: nowrap; transition: background-color .15s ease; }
.sub svg { width: 18px; height: 13px; }
.sub:hover { color: #fff; background: #cc0000; }

@media (max-width: 640px) {
  .site-nav { gap: 10px; }
  .site-nav a { font-size: 0.86rem; }
  .hdr-right { gap: 10px; }
  .sub { height: 32px; padding: 0 12px; font-size: 0.8rem; }
  .sub svg { display: none; }
}
