/* Home page and catalogue pages (doors, collections, What's new, Labs). Colours come from the
   brand tokens in style.css, so light and dark follow the theme. */

:root {
  --tone-studio: #018662;
  --games-soft: #e0efff;  --games-soft-ink: #00447e;
  --apps-soft: #ffe8d9;   --apps-soft-ink: #693300;
  --fonts-soft: #f5e6ff;  --fonts-soft-ink: #592c71;
  --sun-soft: #fff3d5;    --sun-soft-ink: #785302;
  --studio-soft: #daf4e8; --studio-soft-ink: #00513a;
  --alt: #ffffff;
}
:root[data-theme="dark"] {
  --games-soft: #00315d;  --games-soft-ink: #95c7ff;
  --apps-soft: #4d2400;   --apps-soft-ink: #f6b182;
  --fonts-soft: #401e53;  --fonts-soft-ink: #d9b0f3;
  --sun-soft: #3b2700;    --sun-soft-ink: #ffda7d;
  --studio-soft: #013a29; --studio-soft-ink: #86d6b5;
  --alt: #1b1917;
}

/* ---- Tones ---- */
.tone-games, a.tone-games:hover, a.tone-games:focus, a.tone-games:active, a.tone-games:visited  { background: var(--games); color: #fff; }
.tone-apps, a.tone-apps:hover, a.tone-apps:focus, a.tone-apps:active, a.tone-apps:visited   { background: var(--apps); color: #fff; }
.tone-fonts, a.tone-fonts:hover, a.tone-fonts:focus, a.tone-fonts:active, a.tone-fonts:visited  { background: var(--fonts); color: #fff; }
.tone-studio, a.tone-studio:hover, a.tone-studio:focus, a.tone-studio:active, a.tone-studio:visited { background: var(--tone-studio); color: #fff; }
.tone-sun, a.tone-sun:hover, a.tone-sun:focus, a.tone-sun:active, a.tone-sun:visited    { background: var(--butter); color: #141210; }
.tone-ink, a.tone-ink:hover, a.tone-ink:focus, a.tone-ink:active, a.tone-ink:visited    { background: var(--ink); color: var(--cream); }
.tone-plain, a.tone-plain:hover, a.tone-plain:focus, a.tone-plain:active, a.tone-plain:visited  { background: var(--cream-2); color: var(--ink); }
.tone-games-soft, a.tone-games-soft:hover, a.tone-games-soft:focus, a.tone-games-soft:active, a.tone-games-soft:visited  { background: var(--games-soft); color: var(--games-soft-ink); }
.tone-apps-soft, a.tone-apps-soft:hover, a.tone-apps-soft:focus, a.tone-apps-soft:active, a.tone-apps-soft:visited   { background: var(--apps-soft); color: var(--apps-soft-ink); }
.tone-fonts-soft, a.tone-fonts-soft:hover, a.tone-fonts-soft:focus, a.tone-fonts-soft:active, a.tone-fonts-soft:visited  { background: var(--fonts-soft); color: var(--fonts-soft-ink); }
.tone-sun-soft, a.tone-sun-soft:hover, a.tone-sun-soft:focus, a.tone-sun-soft:active, a.tone-sun-soft:visited    { background: var(--sun-soft); color: var(--sun-soft-ink); }
.tone-studio-soft, a.tone-studio-soft:hover, a.tone-studio-soft:focus, a.tone-studio-soft:active, a.tone-studio-soft:visited { background: var(--studio-soft); color: var(--studio-soft-ink); }

/* ---- Shared ---- */
.cat-section { padding: 72px 0; }
.cat-flush { padding-top: 0; }
.cat-alt { background: var(--alt); }
.cat-band { background: var(--cream-2); }
.cat-kicker { display: inline-block; font: 600 .78rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--terra); }
.cat-note { font: .85rem var(--font-mono); color: var(--ink-3); }
.cat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 24px; }
.cat-head h2, .cat-h2 { margin: .25rem 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.05; letter-spacing: -.01em; }
.cat-h2 { margin: 0 0 20px; }
.cat-head a { font-family: var(--font-ui); font-weight: 600; color: var(--terra); text-decoration: none; }
.cat-head-rule { padding-top: 24px; border-top: 1px solid var(--cream-3); align-items: baseline; }
.btn-sun { background: var(--butter); color: #141210; border: 0; font-family: var(--font-ui); font-weight: 600; border-radius: 999px; padding: .7rem 1.3rem; }
.btn-sun:hover, .btn-sun:focus, .btn-sun:active { background: #f8cb53; color: #141210; }
.btn-sun:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }
.door-icons { display: flex; gap: 6px; margin-top: auto; }
.door-icons img { width: 38px; height: 38px; border-radius: 10px; }

/* ---- Hero ---- */
.home-hero { padding: 72px 0 64px; overflow: hidden; }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.home-hero-copy { display: flex; flex-direction: column; gap: 18px; }
.home-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 6.4vw, 5.4rem); line-height: .98; letter-spacing: -.02em; }
.home-hero .lead { margin: 0; font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-facts { display: flex; flex-wrap: wrap; gap: 28px; margin: 10px 0 0; padding-top: 20px; border-top: 1px solid var(--cream-3); }
.home-facts div { display: grid; }
.home-facts dt { font: 400 2.2rem/1 var(--font-display); }
.home-facts dd { margin: 4px 0 0; font: .8rem var(--font-mono); color: var(--ink-3); }
.icon-wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; transform: rotate(-6deg); margin-right: -40px; }
.icon-wall img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .45); }
.icon-wall img:nth-child(5n+2), .icon-wall img:nth-child(5n+4) { transform: translateY(22px); }
.icon-wall img.faint { opacity: .45; }

/* ---- Doors ---- */
.door-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.door-tile { display: flex; flex-direction: column; gap: 8px; min-height: 230px; padding: 22px; border-radius: 22px; text-decoration: none; transition: transform .15s; }
.door-tile:hover, .door-tile:focus-visible { transform: translateY(-3px); }
.door-tile:focus-visible, .collection-tile:focus-visible, .loved-card:focus-visible, .product-tile:focus-visible, .release-row:focus-visible, .post-tile:focus-visible { outline: 3px solid var(--games); outline-offset: 3px; }
.door-count { font: 600 .75rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.door-name { font: 400 1.9rem/1.05 var(--font-display); }
.door-line { font-size: .95rem; line-height: 1.45; }
.door-grid-small .door-tile { min-height: 150px; }
.door-grid-small .door-name { font-size: 1.5rem; }

/* ---- Most played ---- */
.loved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.loved-card { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--cream); color: var(--ink); text-decoration: none; box-shadow: 0 18px 36px -26px rgba(0, 0, 0, .4); transition: transform .15s; }
.loved-card:hover { transform: translateY(-3px); color: var(--ink); }
.loved-card > img { width: 100%; height: auto; aspect-ratio: 1024 / 500; object-fit: cover; }
.loved-plain { display: flex; align-items: center; justify-content: center; gap: 14px; aspect-ratio: 1024 / 500; }
.loved-plain img { border-radius: 18px; }
.loved-plain b { font: 400 1.8rem var(--font-display); }
.loved-body { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px 20px; }
.loved-body > span { display: grid; gap: 4px; }
.loved-body b { font-family: var(--font-ui); font-weight: 600; font-size: 1.1rem; }
.loved-body span span { font-size: .95rem; line-height: 1.45; color: var(--ink-2); }
.loved-rank { font: 400 2.2rem/1 var(--font-display) !important; color: var(--ink-3); }
:root[data-theme="dark"] .loved-card { box-shadow: inset 0 0 0 1px var(--cream-3); }

/* ---- Releases and Labs ---- */
.week-grid { display: flex; flex-wrap: wrap; gap: 40px; }
.week-log { flex: 999 1 560px; min-width: 0; }
.release-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--cream-3); color: var(--ink); text-decoration: none; }
.release-row:hover { color: var(--ink); background: rgba(var(--ink-rgb), .03); }
.release-row img, .release-row .product-mark { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.release-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.release-text b { font-family: var(--font-ui); font-weight: 600; }
.release-text span { font-size: .95rem; color: var(--ink-2); }
.release-meta { display: grid; justify-items: end; gap: 4px; flex: none; }
.release-meta time { font: .78rem var(--font-mono); color: var(--ink-3); }
.badge-new, .badge-updated { font: 700 .68rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.badge-new { background: var(--butter); color: #141210; }
.badge-updated { background: var(--cream-2); color: var(--ink-2); }
.labs-card { flex: 1 1 300px; align-self: flex-start; display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 24px; background: var(--night); color: var(--night-ink); }
.labs-card .cat-kicker { color: var(--butter); }
.labs-card h3 { margin: 0; font: 400 1.9rem/1.1 var(--font-display); color: var(--night-ink); }
.labs-card p { margin: 0; color: #cccac8; }
.labs-card .btn { align-self: flex-start; }
:root[data-theme="dark"] .labs-card { background: #22201d; box-shadow: inset 0 0 0 1px var(--cream-3); }
.release-page { max-width: 820px; }
.release-page .cat-h2 { margin-top: 32px; }

/* ---- Collections ---- */
.collection-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.collection-row .collection-tile { flex: 0 0 250px; scroll-snap-align: start; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.collection-tile { display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 20px; border-radius: 20px; text-decoration: none; }
.collection-tile:hover { filter: brightness(.97); }
.collection-tile b { font: 400 1.6rem/1.1 var(--font-display); }
.collection-tile span { font-size: .92rem; line-height: 1.4; }
.collection-tile .door-icons img { width: 34px; height: 34px; border-radius: 9px; }

/* ---- How we work ---- */
.how-grid { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.how-copy { flex: 1 1 340px; display: flex; flex-direction: column; gap: 12px; }
.how-copy h2 { margin: 0; font: 400 clamp(2rem, 3.4vw, 2.6rem)/1.08 var(--font-display); }
.how-copy p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }
.how-copy a { font-family: var(--font-ui); font-weight: 600; color: var(--terra); }
.post-grid { flex: 2 1 560px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.post-tile { display: flex; flex-direction: column; gap: 10px; min-height: 160px; padding: 22px; border-radius: 20px; background: var(--paper); border: 1px solid var(--cream-3); color: var(--ink); text-decoration: none; }
.post-tile:hover { color: var(--ink); border-color: var(--ink-3); }
.post-tile time { font: .78rem var(--font-mono); color: var(--ink-3); }
.post-tile b { font-family: var(--font-ui); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }

/* ---- Door, collection, Labs pages ---- */
.door-hero { padding: 56px 0 60px; }
.door-hero-grid { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; }
.door-hero-grid > div { flex: 999 1 520px; }
.door-hero h1 { margin: 6px 0 12px; font: 400 clamp(3rem, 6vw, 4.6rem)/1 var(--font-display); letter-spacing: -.02em; color: inherit; }
.door-hero .lead { margin: 0; max-width: 52ch; font-size: 1.25rem; line-height: 1.5; color: inherit; }
.door-back { font: .85rem var(--font-mono); color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.door-back:hover { color: inherit; }
.door-promises { flex: 1 1 320px; margin: 0; padding: 20px 24px; list-style: none; display: grid; gap: 10px; border-radius: 20px; background: rgba(255, 255, 255, .35); font-size: 1.05rem; }
.door-promises li::before { content: "✓ "; font-weight: 700; }
.door-picked { margin-bottom: 18px; }
.pick-list { display: grid; gap: 20px; }
.pick-card { display: flex; flex-wrap: wrap; border-radius: 24px; overflow: hidden; background: var(--paper); border: 1px solid var(--cream-3); }
.pick-shot { flex: 0 0 260px; display: flex; align-items: flex-end; justify-content: center; padding: 30px 30px 0; background: var(--sun-soft); }
.pick-shot img { width: 180px; height: 340px; object-fit: cover; object-position: top; border: 7px solid #141210; border-bottom: 0; border-radius: 22px 22px 0 0; display: block; }
.pick-body { flex: 1 1 420px; min-width: 0; padding: 30px 32px; display: flex; flex-direction: column; gap: 14px; }
.pick-head { display: flex; align-items: center; gap: 14px; }
.pick-head img { border-radius: 14px; }
.pick-head h2 { margin: 0; font: 400 2rem/1.1 var(--font-display); }
.pick-where { font: .8rem var(--font-mono); color: var(--ink-3); }
.pick-body p { margin: 0; font-size: 1.1rem; color: var(--ink-2); }
.pick-body ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 1.05rem; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.product-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--cream-3); color: var(--ink); text-decoration: none; transition: transform .15s; }
.product-tile:hover { transform: translateY(-2px); color: var(--ink); }
.product-tile img, .product-mark { width: 60px; height: 60px; border-radius: 15px; flex: none; }
.product-mark { display: grid; place-items: center; background: var(--apps); color: #fff; font: 400 1.8rem var(--font-display); }
.product-text { display: grid; gap: 4px; min-width: 0; }
.product-text b { font-family: var(--font-ui); font-weight: 600; font-size: 1.1rem; }
.product-text span { font-size: .95rem; line-height: 1.4; color: var(--ink-2); }
.product-text small { font: .78rem var(--font-mono); color: var(--terra); }

@media (max-width: 860px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .icon-wall { margin: 0 -30px; }
  .cat-section { padding: 52px 0; }
}
@media (max-width: 520px) {
  .door-grid { grid-template-columns: 1fr; }
  .door-tile { min-height: 0; }
  .door-icons { display: none; }
  .pick-shot { flex-basis: 100%; }
}
