/* ==========================================================
   Brewed Mechanics — shared styles
   Palette: dark roast, amber ale, crema, brass
   ========================================================== */

:root {
  --roast: #1c1410;        /* page background */
  --roast-2: #261b15;      /* raised surfaces */
  --roast-3: #33251d;      /* borders / hover */
  --crema: #f3e6d3;        /* main text */
  --crema-dim: #c9b8a3;    /* secondary text */
  --amber: #e8a33d;        /* beer */
  --coffee: #b5764a;       /* coffee */
  --brass: #7fb7a4;        /* games / mechanics (oxidized brass) */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232, 163, 61, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(127, 183, 164, 0.07), transparent 60%),
    var(--roast);
  color: var(--crema);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; display: block; }

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffc46b; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crema-dim);
  margin-bottom: 0.75rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(28, 20, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--roast-3);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--crema);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.logo:hover { color: var(--crema); }
.logo svg { width: 30px; height: 30px; color: var(--amber); transition: transform 0.6s ease; }
.logo:hover svg { transform: rotate(90deg); }

.nav-links { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--crema-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--crema); background: var(--roast-2); }
.nav-links a[aria-current="page"] { color: var(--roast); background: var(--crema); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--roast-3);
  color: var(--crema);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.25rem;
    background: var(--roast);
    border-bottom: 1px solid var(--roast-3);
  }
  .nav-links.open { display: flex; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section + .section { padding-top: 0; }
.section-head { max-width: 640px; margin-bottom: 2.25rem; }
.section-head p { color: var(--crema-dim); }

.page-hero { padding: clamp(3.5rem, 8vw, 5.5rem) 0 2rem; }
.page-hero p { max-width: 620px; color: var(--crema-dim); font-size: 1.1rem; }

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}
.hero h1 span { color: var(--amber); font-style: italic; }
.hero p.lead { max-width: 560px; font-size: 1.2rem; color: var(--crema-dim); }
.hero-gears {
  position: absolute;
  right: -60px;
  top: 40px;
  width: min(460px, 55vw);
  opacity: 0.16;
  color: var(--crema);
  pointer-events: none;
}
.hero-gears .g1 { transform-origin: 160px 160px; animation: spin 30s linear infinite; }
.hero-gears .g2 { transform-origin: 330px 300px; animation: spin 20s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .hero-gears .g1, .hero-gears .g2 { animation: none; }
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--roast-3);
  color: var(--crema);
  background: var(--roast-2);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); color: var(--crema); background: var(--roast-3); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--roast); }
.btn.primary:hover { background: #f5b552; color: var(--roast); }

/* ---------- "Three brews" cards ---------- */
.brews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.brew-card {
  --accent: var(--amber);
  position: relative;
  display: block;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--roast-2);
  border: 1px solid var(--roast-3);
  color: var(--crema);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.brew-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
}
.brew-card:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--crema); }
.brew-card .icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.brew-card .icon svg { width: 28px; height: 28px; }
.brew-card p { color: var(--crema-dim); margin-bottom: 1rem; }
.brew-card .more { color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.brew-card.beer { --accent: var(--amber); }
.brew-card.coffee { --accent: var(--coffee); }
.brew-card.games { --accent: var(--brass); }

/* ---------- Game tiles ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.filter-bar button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--roast-3);
  background: transparent;
  color: var(--crema-dim);
  cursor: pointer;
}
.filter-bar button:hover { color: var(--crema); }
.filter-bar button[aria-pressed="true"] { background: var(--crema); color: var(--roast); border-color: var(--crema); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.game-tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--roast-2);
  border: 1px solid var(--roast-3);
  overflow: hidden;
  color: var(--crema);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.game-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brass); color: var(--crema); }

.game-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--roast-3);
  overflow: hidden;
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
a.game-tile:hover .game-cover img { transform: scale(1.04); }

/* Generated cover art for games without a screenshot yet */
.game-cover.generated {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), transparent 45%),
    linear-gradient(135deg, var(--c1), var(--c2));
}
.game-cover.generated .glyph {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.game-cover.generated::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}

.status {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(28, 20, 16, 0.85);
  color: var(--crema);
}
.status.playable { background: var(--brass); color: var(--roast); }
.status.in-progress { background: var(--amber); color: var(--roast); }
.status.prototype { background: var(--coffee); color: var(--roast); }

.game-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.game-body h3 { margin-bottom: 0.35rem; }
.game-body p { color: var(--crema-dim); font-size: 0.95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--roast-3);
  color: var(--crema-dim);
}

/* Placeholder tiles for early ideas */
.game-tile.placeholder {
  background: transparent;
  border: 2px dashed var(--roast-3);
}
.game-tile.placeholder .game-cover {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(243, 230, 211, 0.03) 14px 28px);
}
.game-tile.placeholder .game-cover svg { width: 64px; height: 64px; color: var(--roast-3); }
.game-tile.placeholder h3 { color: var(--crema-dim); }

/* ---------- Brewing ---------- */
.subnav { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.log-card {
  --accent: var(--amber);
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--roast-2);
  border: 1px solid var(--roast-3);
  border-left: 4px solid var(--accent);
}
.log-card.coffee { --accent: var(--coffee); }
.log-card h3 { margin-bottom: 0.25rem; }
.log-card .meta { font-size: 0.85rem; color: var(--crema-dim); margin-bottom: 1rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
}
.stats div { background: var(--roast); border-radius: 8px; padding: 0.5rem 0.6rem; }
.stats dt { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--crema-dim); }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.log-card p { color: var(--crema-dim); font-size: 0.95rem; margin: 0; }

.brew-section-title { display: flex; align-items: center; gap: 0.75rem; }
.brew-section-title svg { width: 34px; height: 34px; }
#beer .brew-section-title svg { color: var(--amber); }
#coffee .brew-section-title svg { color: var(--coffee); }

.setup-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.setup-list li { padding: 0.85rem 1rem; border-radius: 10px; background: var(--roast-2); border: 1px solid var(--roast-3); font-size: 0.95rem; }
.setup-list li strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--crema-dim); font-weight: 600; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 38%, var(--roast-3) 0 22%, transparent 23%),
    radial-gradient(ellipse at 50% 100%, var(--roast-3) 0 42%, transparent 43%),
    var(--roast-2);
  border: 1px solid var(--roast-3);
  display: grid;
  place-items: end center;
  padding: 1rem;
  color: var(--crema-dim);
  font-size: 0.85rem;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait:has(img) { padding: 0; }
.about-body p { font-size: 1.05rem; }
.fact-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.6rem; }
.fact-list li { display: flex; gap: 0.75rem; align-items: baseline; }
.fact-list li span:first-child { min-width: 1.5rem; }

/* ---------- Single game page ---------- */
.game-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 860px) { .game-hero { grid-template-columns: 1fr; } .key-art { order: -1; } }
.game-hero .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--amber);
  max-width: 34ch;
}
.fine-print { font-size: 0.88rem; color: var(--crema-dim); margin-top: 0.9rem; }
.key-art {
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #ffe3c2;
  background:
    radial-gradient(circle at 60% 70%, rgba(255, 170, 60, 0.55), transparent 50%),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(150deg, #f2762e, #4a160a);
  box-shadow: var(--shadow), inset 0 0 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.key-art svg { width: 55%; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35)); }
.key-art img { width: 100%; height: 100%; object-fit: cover; }
.key-art.has-icon { max-width: 420px; justify-self: center; width: 100%; border-radius: 22.5%; background: #ede0c2; box-shadow: var(--shadow); }

.shot-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(170px, 22vw, 230px);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem;
  scrollbar-color: var(--roast-3) transparent;
}
.shot-strip img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--roast-3);
  scroll-snap-align: start;
  box-shadow: var(--shadow);
}

.prose > * { max-width: 760px; }
.prose p { font-size: 1.08rem; }
.lead-in { font-family: var(--font-display); font-size: 1.6rem !important; line-height: 1.35; margin-bottom: 2.5rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.feature {
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--roast-2);
  border: 1px solid var(--roast-3);
}
.feature p:last-child { color: var(--crema-dim); margin: 0; }

/* ---------- Legal / support pages ---------- */
.legal > * { max-width: 720px; }
.legal h2 { font-size: 1.35rem; margin-top: 2.25rem; }
.legal p, .legal li { color: var(--crema-dim); }
.legal b { color: var(--crema); font-weight: 600; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--roast-3);
  padding: 2rem 0;
  color: var(--crema-dim);
  font-size: 0.9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--crema-dim); }
.site-footer a:hover { color: var(--crema); }
