/*
  One theme for the whole site: the home page, /websites/ and the /apps/ hub
  (built in the separate `apps` repo, which links this file as /theme.css).
  Warm dark palette, the same amber accent the app pages use.
*/

:root {
  --bg: #0e1013;
  --panel: #161a1f;
  --panel-2: #1c2128;
  --line: #2a3039;
  --text: #efe9dd;
  --dim: #a7a091;
  --accent: #e0a36a;
  --accent-ink: #1a0f07;
  --accent-soft: rgba(224, 163, 106, .12);
  --radius: 18px;
  --wrap: 1180px;
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
.dim { color: var(--dim); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Top bar, the same on every page */
.site-bar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(14, 16, 19, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.site-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--dim); text-decoration: none; padding: 6px 12px; border-radius: 99px; font-size: .95rem; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
@media (max-width: 520px) {
  .site-name .full { display: none; }
  .site-nav a { padding: 6px 9px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-quiet { background: transparent; color: var(--text); border: 1px solid var(--line); }

/* Section heads */
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.sec { padding: 72px 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-top: 6px; }
.more { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.more:hover { color: var(--accent); }

/* List pages (/apps/, /websites/) */
.page-head { padding: 56px 0 32px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 8px 0 12px; }
.page-head p { color: var(--dim); max-width: 60ch; font-size: 1.05rem; }

/* Card grid: as many columns as fit, one on a phone */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }

.tile {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
.tile:hover { border-color: color-mix(in srgb, var(--tile-accent, var(--accent)) 60%, var(--line)); transform: translateY(-2px); }
.tile-media { aspect-ratio: 16 / 10; background: var(--panel-2); overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* App tiles: the icon sits on a wash of the app's own colour */
.tile-media.icon {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tile-accent, var(--accent)) 38%, transparent), transparent 70%),
    var(--panel-2);
}
.tile-media.icon img { width: 34%; height: auto; aspect-ratio: 1; border-radius: 22%; object-fit: cover; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.tile-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tile-title b { font-family: var(--display); font-size: 1.2rem; }
.tile-tagline { color: var(--text); }
.tile-about { color: var(--dim); font-size: .95rem; }
.tile-link { margin-top: auto; padding-top: 10px; color: var(--tile-accent, var(--accent)); font-weight: 600; font-size: .95rem; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }

.note { margin-top: 28px; padding: 18px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--dim); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--dim); font-size: .92rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .tile { transition: none; }
  .btn:hover, .tile:hover { transform: none; }
}
