/* Shared look for the hub and each project's landing page.
   Matches Trace: warm paper background, rounded chunky tiles. */
:root {
  --bg: #fff7ec;
  --paper: #ffffff;
  --ink: #3a3f4b;
  --muted: #7b8291;
  --soft: #f1e6d6;
  --accent: #ff9f1c;
  --radius: 32px;
  --shadow: 0 6px 0 rgba(58, 63, 75, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

a, button { font: inherit; color: inherit; touch-action: manipulation; }
svg { display: block; }
[hidden] { display: none !important; }

.page {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Header with the Home button ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}
.bar h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.01em; }

.round {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
}
.round svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.round:active, .tile:active, .go:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(58, 63, 75, 0.12); }

/* ---------- Hub tiles ---------- */

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.tile {
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
}
.tile .art {
  flex: 1;
  min-height: clamp(200px, 26vh, 320px);
  display: grid;
  place-items: center;
  background: var(--tint, var(--soft));
}
.tile .art svg { width: min(78%, 260px); height: auto; }
.tile .words { padding: 18px 24px 22px; }
.tile h2, .tile h3 { margin: 0 0 4px; font-size: 28px; font-weight: 800; }
.tile p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.35; }

/* ---------- Home page: one section per category ---------- */

.home #sections { display: flex; flex-direction: column; gap: 40px; }
.category h2 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.home .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 20px; }
.home .tile { min-height: 0; }
.home .tile .art { flex: none; min-height: 0; height: clamp(140px, 17vh, 180px); position: relative; }
.home .tile .art svg { width: min(72%, 190px); }
.home .tile h3 { font-size: 23px; }
.home .tile p { font-size: 16px; }
.home .tile .words { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.home .tile .words p { flex: 1; }

.age {
  align-self: flex-start;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.hero .age { margin-bottom: 12px; background: rgba(255, 255, 255, 0.7); color: #3a3f4b; }

.tile.is-soon { cursor: default; box-shadow: none; border: 2px dashed #e6d8c4; background: transparent; }
.tile.is-soon .art svg { opacity: 0.55; filter: saturate(0.6); }
.tile.is-soon .words { opacity: 0.75; }
.tile.is-soon:active { transform: none; }
.soon {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

/* ---------- Project landing pages ---------- */

.hero {
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: 1fr;
  background: var(--tint, var(--paper));
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}
@media (min-width: 760px) { .hero { grid-template-columns: 1.1fr 1fr; } }
.hero .art svg { width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.hero h2 { margin: 0 0 12px; font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; line-height: 1.1; }
.hero p { margin: 0 0 24px; font-size: 20px; line-height: 1.45; }

.go {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 34px 0 30px;
  border-radius: 999px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.go svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.look h3 { margin: 4px 0 14px; font-size: 24px; }
.look ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.look li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 18px;
  line-height: 1.3;
}
.look li svg { width: 56px; height: 56px; flex: none; }
.look b { display: block; font-size: 20px; }

.credits {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  -webkit-user-select: text;
  user-select: text;
}
.credits p { margin: 0 0 6px; }
.credits a { color: var(--ink); }

/* ---------- Sign-in panel (shared/account.js) and small app pieces ---------- */

.signin-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}
.signin-card {
  max-width: 420px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.signin-card h2 { margin: 0 0 8px; font-size: 28px; }
.signin-note { margin: 0 0 20px; color: var(--muted); font-size: 17px; line-height: 1.4; }
.signin-google { display: flex; justify-content: center; min-height: 44px; }
.signin-apple { display: flex; justify-content: center; margin-top: 10px; }
.signin-apple:empty { display: none; }
.apple-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font: 500 15px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}
.apple-btn svg { width: 15px; height: 18px; margin-top: -2px; }
.signin-dev, .pillbtn {
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.signin-dev { margin-top: 12px; }
.pillbtn.dark { background: var(--ink); color: #fff; }
.pillbtn:active { transform: translateY(2px); }
