/* mangasmango.com — clean light redesign
   Type: Inter + JetBrains Mono. One accent, hairline borders, no decoration. */

:root {
  --bg: #fbfaf7;
  --bg-raised: #ffffff;
  --ink: #1a1c20;
  --muted: #6f6a61;
  --border: #e7e4dc;
  --border-strong: #d6d2c8;
  --accent: #a34a24;
  --accent-hover: #7f3a1b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #a34a24; color: #fff; }

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

a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

.container { max-width: 64rem; margin-inline: auto; padding-inline: 1.5rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

/* ── Header ─────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 0.75rem;
  flex-wrap: wrap;
}

.brand { display: block; }

.brand img { height: 2.6rem; width: auto; display: block; }

.site-nav {
  display: flex;
  gap: 1.4rem;
  flex: 1;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover { color: var(--ink); }

.site-header-links { display: flex; gap: 1.4rem; align-items: baseline; }
.site-header-links a { font-size: 0.9rem; }
.site-header-links .mono-link { color: var(--muted); }

/* ── Link styles ────────────────────────────────────────────── */

.link-accent {
  color: var(--accent);
  text-decoration-color: var(--accent);
  font-weight: 500;
}
.link-accent:hover { color: var(--accent-hover); text-decoration-color: var(--accent-hover); }

.quiet-link { color: var(--muted); }
.quiet-link:hover { color: var(--ink); }

.mono-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration-color: var(--border-strong);
}
.mono-link:hover { color: var(--accent); }

/* ── Remix icons ────────────────────────────────────────────── */

a [class^="ri-"], button [class^="ri-"], span [class^="ri-"] {
  font-size: 0.95em;
  vertical-align: -0.12em;
  margin-right: 0.35em;
}

a .trailing { margin-right: 0; margin-left: 0.35em; }

.link-accent i { color: var(--accent); }
.mono-link i, .repo-list .mono-link i { color: var(--muted); }
.quiet-link i, .games-list i { color: var(--muted); }
.games-list i { margin-right: 0.35em; font-size: 0.9em; vertical-align: -0.12em; }
.link-accent:hover i, .mono-link:hover i, .quiet-link:hover i { color: inherit; }

.btn-link {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  border-radius: 2px;
}
.btn-link:hover { border-color: var(--ink); }

/* ── Hero ───────────────────────────────────────────────────── */

.hero { padding-block: 6rem 5.5rem; }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-block: 0.6rem 1.2rem;
  max-width: 24ch;
}

.hero h1 em { font-style: italic; font-weight: 600; }

.lede {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: 58ch;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.6rem;
  margin-top: 1.8rem;
}

.hero-links a { text-decoration: underline; }

.hero-status { margin-top: 1.4rem; }

/* ── Shared meta + sections ─────────────────────────────────── */

.mono-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.section { padding-block: 4.5rem; border-top: 1px solid var(--border); }

.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.section h2 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.page-note {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 1.5rem;
}

/* ── Bound to Rot ───────────────────────────────────────────── */

.btr-hero { margin-block: 2.2rem 0.6rem; }

.btr-hero img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.btr-shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.btr-shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.specs {
  list-style: none;
  margin-block: 2.4rem;
  border-top: 1px solid var(--border);
}

.specs li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.specs span:first-child { color: var(--muted); }
.specs span:last-child { font-size: 0.9rem; }

/* ── Open source ────────────────────────────────────────────── */

.repo-list {
  list-style: none;
  margin-top: 1.8rem;
  border-top: 1px solid var(--border);
}

.repo-list li {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding-block: 1rem;
  border-bottom: 1px solid var(--border);
}

.repo-list span { color: var(--muted); font-size: 0.95rem; max-width: 48ch; }

/* ── Archive ────────────────────────────────────────────────── */

.archive-list { margin-top: 1.2rem; }

.archive-entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.5rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.archive-entry h2, .archive-entry h3 { font-size: 1.05rem; font-weight: 600; }
.archive-entry h2 a, .archive-entry h3 a { text-decoration: none; }
.archive-entry h2 a:hover, .archive-entry h3 a:hover { color: var(--accent); }

.archive-body p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 60ch;
  margin-top: 0.25rem;
}

/* ── Games list ─────────────────────────────────────────────── */

.games-list {
  list-style: none;
  margin-top: 1.5rem;
}

.games-list li { padding-block: 0.35rem; color: var(--muted); font-size: 0.95rem; }

/* ── Page header (archive + single pages) ──────────────────── */

.page-header { padding-block: 4rem 2.5rem; }

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header .page-note { margin-block: 0.8rem 0; }

/* ── Single post / article page ─────────────────────────────── */

.post { max-width: 46rem; margin-inline: auto; padding-block: 3.5rem 4rem; }

.post-media { margin-bottom: 2.5rem; }
.post-media img { width: 100%; border: 1px solid var(--border); border-radius: 3px; }

.post-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  max-width: 30ch;
  margin-block: 0.5rem 0.5rem;
}

.post-header .mono-meta { margin-bottom: 2rem; display: block; }

.post-content { display: grid; gap: 1.1rem; max-width: 65ch; }

.post-content h2, .post-content h3, .post-content h4 {
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 1.6rem;
}
.post-content h2 { font-size: 1.4rem; font-weight: 600; }
.post-content h3 { font-size: 1.15rem; font-weight: 600; }
.post-content h4 { font-size: 1rem; font-weight: 600; }

.post-content p, .post-content ul, .post-content ol { color: var(--ink); }

.post-content ul, .post-content ol { padding-left: 1.4rem; }
.post-content li { margin-block: 0.3rem; }

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  color: var(--muted);
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #f0eee8;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.post-content pre {
  background: #1a1c20;
  color: #e8e6e1;
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.post-content img { border-radius: 3px; }

.post-content table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.5rem 0.8rem; text-align: left; }
.post-content th { font-weight: 600; background: #f0eee8; }

.post-content hr { border: none; border-top: 1px solid var(--border); margin-block: 2rem; }

.post-neighbours {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 1.2rem;
  font-size: 0.9rem;
}
.post-neighbours a:last-child { margin-left: auto; text-align: right; }

/* ── Contact form ───────────────────────────────────────────── */

.contact-form { display: grid; gap: 0.4rem; max-width: 34rem; margin-top: 1.5rem; }

.contact-form label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.8rem;
}

.contact-form input, .contact-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0.55rem 0.75rem;
}

.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }

.contact-form .submit { justify-self: start; margin-top: 1rem; }

/* ── Footer ─────────────────────────────────────────────────── */

footer { border-top: 1px solid var(--border); margin-top: 1rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links { display: flex; gap: 1.4rem; }
.footer-links a [class^="ri-"] { margin-right: 0.25em; color: var(--muted); }
.footer-links a:hover [class^="ri-"] { color: var(--ink); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ── Cookie banner ──────────────────────────────────────────── */

#cookie-banner {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(42rem, calc(100vw - 2rem));
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(26, 28, 32, 0.08);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#cookie-banner[hidden] { display: none; }

#cookie-banner p { font-size: 0.85rem; color: var(--muted); flex: 1; }
#cookie-banner a { color: var(--muted); white-space: nowrap; }
#cookie-banner a:hover { color: var(--ink); }

.cookie-actions { display: flex; gap: 0.6rem; white-space: nowrap; }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  .hero { padding-block: 4rem 3.5rem; }

  .btr-shots { grid-template-columns: repeat(2, 1fr); }

  .specs li, .repo-list li { grid-template-columns: 1fr; gap: 0.3rem; padding-block: 0.7rem; }
  .repo-list span { max-width: none; }

  .archive-entry { grid-template-columns: 1fr; gap: 0.4rem; }

  .site-header { gap: 1rem; align-items: center; }
  .brand img { height: 2.2rem; }
  .site-header-links { margin-left: auto; }

  #cookie-banner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
