/* Shared styles for the standalone pages (projects index).
   Hand-written (not part of the Tailwind build) so these pages never need a rebuild.
   Colours mirror the theme tokens in src/tailwind.css and follow the same
   light / dark / data-theme rules as the home page. */
:root {
  color-scheme: light;
  --bg: #fdf8fb; --bg2: #f9eff5; --card: #fff; --line: #f0dde8;
  --fg: #23111d; --muted: #6f5a68; --accent: #be185d;
  --grad: linear-gradient(135deg, #ec4899, #c026d3 55%, #a855f7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0912; --bg2: #110d1b; --card: #151120; --line: #2c2340;
    --fg: #f5eef4; --muted: #b4a3b2; --accent: #f472b6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0912; --bg2: #110d1b; --card: #151120; --line: #2c2340;
  --fg: #f5eef4; --muted: #b4a3b2; --accent: #f472b6;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font: 16px/1.6 "IBM Plex Sans Thai", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .wrap { padding: 0 2rem; } }

.bar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.bar .wrap { display: flex; align-items: center; gap: .75rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand b { font: 700 1.25rem "JetBrains Mono", monospace; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.langs { margin-left: auto; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.langs button { border: 0; border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); background: transparent; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--grad); color: #fff; }

main { flex: 1; padding: 3rem 0 4rem; }
.badge { display: inline-block; font: 600 .78rem "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: .4rem 0 .5rem; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; }
.lead { margin: 0 0 2rem; color: var(--muted); max-width: 42rem; }

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card img, .card .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--bg2); }
.card .ph { display: grid; place-items: center; font: 700 1.6rem "JetBrains Mono", monospace; color: var(--accent); }
.card .body { display: flex; flex: 1; flex-direction: column; padding: 1.1rem 1.3rem 1.2rem; }
.card h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.card p { margin: 0; flex: 1; color: var(--muted); font-size: .93rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.tags li { padding: .1rem .6rem; border-radius: 999px; background: rgba(236, 72, 153, .13); color: var(--accent); font-size: .75rem; font-weight: 600; }
.links { display: flex; gap: 1rem; margin-top: 1rem; font-size: .9rem; font-weight: 600; }
.empty, .err { padding: 2rem; border: 1px dashed var(--line); border-radius: 1rem; color: var(--muted); text-align: center; }

footer { padding: 1.2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
