/* garlic.lol — "midnight kitchen" theme. Tokens + rules live in DESIGN.md (repo root):
   warm charcoal, parchment ink, garlic-gold accent, sprout-green secondary, serif display
   headings. Three hues only; extend with tints/shades, never new colors. */
:root {
  --bg: #141110;
  --panel: #1c1917;
  --panel-2: #26211d;
  --ink: #ece5d8;
  --muted: #a1968a;
  --accent: #d9a827;      /* garlic-gold */
  --accent-ink: #211700;  /* text on gold */
  --accent2: #5c7d43;     /* sprout-green */
  --ok: #86b86b;
  --err: #e06c5b;
  --line: #2b2620;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  font: 16px/1.6 var(--font-body);
  background: radial-gradient(1100px 520px at 70% -12%, #1d1814, var(--bg));
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .page-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .1px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { background: #00000040; padding: 1px 5px; border-radius: 5px; font-size: .9em; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px; min-height: 56px;
  background: rgba(18, 15, 13, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.22rem; color: var(--ink);
  letter-spacing: .2px; display: inline-flex; align-items: center; gap: .45rem;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 1.25rem; filter: drop-shadow(0 0 6px rgba(217,168,39,.35)); }
.brand-dot { color: var(--accent); }
.brand-moon { font-size: .85rem; opacity: .7; margin-left: 2px; cursor: help; }
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  margin: 0; padding: 8px 12px; border-radius: 9px;
  color: var(--muted); font-size: .92rem; font-weight: 500; line-height: 1;
  transition: background .15s, color .15s;
}
.site-nav a:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: rgba(217, 168, 39, 0.12); }
.site-nav .nav-util { color: #6f665b; font-size: .86rem; }
.site-nav .nav-util:hover { color: var(--muted); }
.site-nav .nav-util.active { color: var(--accent); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 24px; }
footer { text-align: center; color: var(--muted); padding: 16px; font-size: .85rem; font-family: var(--font-display); font-style: italic; }

.hero h1 { margin: 0 0 .2em; font-size: 2.1rem; }
.sub { color: var(--muted); margin-top: 0; }
.warn { color: var(--accent); background: #00000033; padding: 8px 12px; border-radius: 8px; }
.hint { color: var(--muted); font-size: .9rem; }

/* chat */
.chat { margin-top: 24px; }
.log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.bubble {
  padding: 10px 14px; border-radius: 14px; max-width: 85%; white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.user { align-self: flex-end; background: var(--accent2); color: #f2f5ec; }
.bubble.ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.bubble.pending { opacity: .6; font-style: italic; }
.bubble.err { border-color: var(--err); color: var(--err); }
.activity { align-self: flex-start; font-size: .82rem; color: var(--muted); }
.activity summary { cursor: pointer; }
.activity .tool { font-family: ui-monospace, monospace; padding: 2px 0; }
.activity .tool.err { color: var(--err); }

#chat-form { display: flex; gap: 8px; }
#chat-form input { flex: 1; }
input, select, textarea {
  font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
button {
  font: inherit; padding: 11px 14px; border-radius: 10px; border: none;
  cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: default; filter: none; }
button.big { font-size: 1.1rem; padding: 12px 24px; }

/* tic-tac-toe */
.board {
  display: grid; grid-template-columns: repeat(3, 92px); gap: 8px; margin: 16px 0;
}
.cell {
  width: 92px; height: 92px; font-size: 2.6rem; font-weight: 700;
  background: var(--panel); color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.cell.clickable {
  cursor: pointer;
  border-color: var(--accent2);
}
.cell.clickable:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}
.cell.filled { color: var(--accent); cursor: default; }
.cell:disabled { opacity: 0.7; cursor: default; }
.status { font-size: 1.2rem; min-height: 1.4em; }
.invite-link { width: 100%; margin-top: 6px; }
.recent ul { list-style: none; padding: 0; }
.recent li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* change log */
.change { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--panel); }
.change-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tool-tag { background: var(--accent2); color: #f2f5ec; padding: 1px 8px; border-radius: 6px; font-size: .8rem; }
.change .when { color: var(--muted); font-size: .8rem; margin-left: auto; }
.change .detail { background: #00000055; padding: 10px; border-radius: 8px; overflow-x: auto; max-height: 240px; font-size: .8rem; }

/* resume link + uploads */
.resume { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.resume summary { cursor: pointer; }
.upload-form { margin-top: 16px; }
.upload-form p { margin: 8px 0; }
.upload-form input[type=text], .upload-form textarea { width: 100%; }
.gallery .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.asset { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.asset img { width: 100%; height: 160px; object-fit: cover; display: block; }
.asset figcaption { padding: 8px; font-size: .82rem; color: var(--muted); }

/* ── MTG section sub-navigation (tabs) ──────────────────────────── */
.mtg-subnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.6rem; padding-bottom: 0;
}
.mtg-subnav a {
  color: var(--muted);
  padding: 0.55rem 1.05rem;
  font-size: 0.92rem; font-weight: 600; margin: 0;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 9px 9px 0 0;
  position: relative; bottom: -1px;
  transition: background .15s, color .15s;
}
.mtg-subnav a:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.mtg-subnav a.active {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--line);
  border-bottom: 1px solid var(--panel);   /* connect the tab to the content */
  box-shadow: inset 0 2px 0 var(--accent);  /* gold cap on the active tab */
}

/* ── Shared themed buttons ──────────────────────────────────────── */
.ui-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: var(--accent-ink); border: none;
  padding: .5rem 1rem; border-radius: 9px; cursor: pointer;
  font-size: .9rem; font-weight: 600; line-height: 1.1; text-decoration: none;
  transition: filter .15s, background .15s, border-color .15s;
}
.ui-btn:hover { filter: brightness(1.08); text-decoration: none; }
.ui-btn.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.ui-btn.secondary:hover { background: var(--panel-2); filter: none; }
.ui-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ui-btn.ghost:hover { color: var(--ink); background: var(--panel-2); filter: none; }
.ui-btn.danger { background: #6a2d24; color: #ffe0d9; }
.ui-btn.danger:hover { background: #7e352b; filter: none; }
.ui-btn.sm { padding: .28rem .65rem; font-size: .8rem; border-radius: 7px; }

/* ── Card-ish surfaces ──────────────────────────────────────────── */
.ui-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; }
.page-title { font-size: 1.7rem; margin: 0 0 .25rem; letter-spacing: .2px; }
.page-sub { color: var(--muted); margin: 0 0 1.5rem; }

/* ── hamburger toggle (hidden on desktop) ──────────────────────────── */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 8px 10px;
  background: none; border: 1px solid transparent; border-radius: 9px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; border-radius: 2px;
  background: var(--muted); transition: transform .2s, opacity .2s, background .2s;
}
.nav-toggle:hover span { background: var(--ink); }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── mobile header: hamburger menu ─────────────────────────────────── */
@media (max-width: 700px) {
  .site-header { padding: 8px 12px; gap: 8px; position: relative; }
  .brand { font-size: 1rem; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px 10px 12px;
    background: rgba(18, 15, 13, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: 11px 13px; font-size: .95rem; }
  .site-nav a:not(.nav-min) + a.nav-min {
    border-top: 1px dashed var(--line); border-radius: 0;
    margin-top: 4px; padding-top: 13px;
  }
}
