@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,800&display=swap");

/* ---- variables ---- */

:root {
  /* --- warm paperback palette --- */
  --bg: #1e1a17;
  --bg-alt: #2a2520;
  --bg-card: #26221e;
  --fg: #ede4d0;
  --fg-dim: #b8ac96;
  --muted: #7d7160;
  --accent: #e08e6d;
  --accent-alt: #b78bbf;
  --green: #8faf75;
  --orange: #e89f5a;
  --yellow: #d4b862;
  --red: #cf6969;
  --border: #3d362f;

  /* --- editorial type stack --- */
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

/* ---- body: full-width w/ tiled pattern behind everything ---- */

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: url("../bg-pattern.svg");
  background-repeat: repeat;
  background-size: 260px 260px;
  color: var(--fg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.7;
  font-size: 1rem;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

/* content wrapper: opaque bg to hide pattern behind text */
.page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.75rem 2rem 3.5rem;
  background-color: var(--bg);
  min-height: 100vh;
  box-shadow: 0 0 0 1px rgba(59, 66, 97, 0.35);
}

/* ---- typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--fg);
  line-height: 1.2;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "kern", "liga";
}
h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0.85rem 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-alt); }

code {
  background: var(--bg-alt);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--green);
}

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.1rem;
  color: var(--fg-dim);
  background: rgba(224, 142, 109, 0.05);
  border-radius: 4px;
}

/* No italics anywhere — book/game titles get subtle weight emphasis instead. */
em, i, cite, blockquote { font-style: normal; }
em, i, cite { font-weight: 600; color: var(--fg); }

hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 2rem 0;
}

ul, ol { padding-left: 1.5rem; }
li { margin: 0.3rem 0; }

/* highlighted key words */
/* All keyword highlights share one restrained accent — no rainbow. */
.hl-green,
.hl-blue,
.hl-pink,
.hl-purple,
.hl-orange { color: var(--accent); font-weight: 700; }

/* ---- header ---- */

.site-header {
  padding: 0.5rem 0 1.5rem;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header .logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.site-header .logo img { display: block; height: 52px; width: auto; }

.site-header nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

/* All nav pills share one calm accent. Only the active one is filled. */
.site-header nav a {
  color: var(--fg-dim);
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.site-header nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.site-header nav a.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

/* ---- hero card w/ avatar ---- */

.hero {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.hero .avatar-frame {
  padding: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--border);
}
.hero .avatar-frame img {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
}

.hero .intro p { margin: 0.5rem 0; }
.hero .intro p:first-child { margin-top: 0; }

.now-widget {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--fg-dim);
}
.now-widget strong { color: var(--fg); }

/* ---- about page hero (photo centered on top, intro below) ---- */

.about-hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}
.about-photo {
  align-self: center;      /* photo centered horizontally */
  padding: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--border);
  width: 220px;
}
.about-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}
.about-intro {
  /* heading + prose stay left-aligned, block spans full width */
  text-align: left;
}
.about-intro p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .about-photo { width: 180px; }
}

/* ---- cover grid (books.html and games.html) ---- */

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem 1.25rem;
  margin: 1.5rem 0 1.75rem;
}

.cover-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cover-link {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-alt);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 0 0 1px rgba(61, 54, 47, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
}
.cover-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.5), 0 0 0 1px var(--accent);
}
.cover-link--empty {
  cursor: default;
  opacity: 0.75;
}
.cover-link--empty:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 0 0 1px rgba(61, 54, 47, 0.6);
}

.cover-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0.7rem 0 0.15rem;
  line-height: 1.25;
}
.cover-card h3 a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cover-card h3 a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cover-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.01em;
}
.cover-status {
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0.35rem 0 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.85;
}

/* ---- card grid for recent reviews on the homepage ---- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.review-card {
  position: relative;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--bg-card);
  /* border shorthand + var() can fall back to currentColor in some renderers;
     splitting the properties keeps the warm-brown border intact. */
  border-width: 1px;
  border-style: solid;
  border-color: var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.review-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.review-card .card-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 22px;
  height: 22px;
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
}

.review-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.3;
  padding-right: 2rem;
}
.review-card h3 a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.review-card h3 a:hover {
  color: var(--fg);
  text-decoration: underline;
}
.review-card p {
  color: var(--fg-dim);
  margin: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}
.review-card .card-date {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.75rem 0 0;
  letter-spacing: 0.01em;
  flex: none;
}

/* ---- prose-style recent list (unused now, kept for reference) ---- */

.recent-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 1.25rem;
}
.recent-list li {
  padding: 0.15rem 0;
  margin: 0.75rem 0;
  line-height: 1.55;
  color: var(--fg-dim);
}
.recent-list li a {
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.recent-list li a:hover {
  color: var(--accent);
}

/* ---- post list (used on books, games, archive) ---- */

.post-list {
  list-style: none;
  padding: 0;
}
.post-list li {
  display: flex;
  gap: 0.9rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px dotted var(--border);
  align-items: baseline;
  flex-wrap: wrap;
  border-radius: 4px;
  transition: background 0.1s ease;
}
.post-list li:hover { background: var(--bg-alt); }
.post-list .date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 6.5rem;
  font-variant-numeric: tabular-nums;
}
.post-list .tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.post-list .tag.book,
.post-list .tag.game {
  background: var(--bg-alt);
  color: var(--fg-dim);
  border: 1px solid var(--border);
}
.post-list a { text-decoration: none; color: var(--fg); }
.post-list a:hover { color: var(--accent); text-decoration: underline; }

/* ---- review meta ---- */

.review-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -0.25rem 0 1.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-alt);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
}
.review-meta .rating    { color: var(--yellow);     font-weight: 700; }
.review-meta .kind-book,
.review-meta .kind-game { color: var(--fg-dim); font-weight: 700; }

/* ---- footer ---- */

.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}
.site-footer a { color: var(--fg-dim); }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--fg-dim);
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.72rem;
  height: 24px;
}
.badge:hover { color: var(--accent); border-color: var(--accent); }
.badge .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.badge.pink   .dot { background: var(--red); }
.badge.blue   .dot { background: var(--accent); }
.badge.purple .dot { background: var(--accent-alt); }
.badge.orange .dot { background: var(--orange); }

img { max-width: 100%; height: auto; }

/* ---- responsive ---- */

@media (max-width: 720px) {
  .page { padding: 1.25rem 1rem 3rem; }
  .site-header { gap: 0.6rem; }
  .site-header .logo img { height: 40px; }
  .site-header nav { margin-left: 0; width: 100%; gap: 0.35rem; }
  .site-header nav a { padding: 0.25rem 0.6rem; font-size: 0.82rem; }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .avatar-frame { justify-self: center; }
  .hero .avatar-frame img { width: 128px; height: 128px; }
  body { background-size: 200px 200px; }
}

@media (max-width: 420px) {
  .site-header .logo img { height: 34px; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.2rem; }
}
