/* =====================================================================
   CARD FORGE — HOMEPAGE
   Loaded after style.css, which supplies the colour variables, .btn,
   .input and the account widget. This file is only the landing page's
   own layout, so the two never fight over a shared class.
   ===================================================================== */

body.home {
  display: block;
  overflow-y: auto;
  min-height: 100vh;
  background:
    radial-gradient(900px 620px at 76% -8%, rgba(143, 155, 255, .20), transparent 62%),
    radial-gradient(760px 520px at 8% 4%, rgba(56, 225, 255, .13), transparent 60%),
    var(--ui-bg);
  /* The body is one viewport tall (style.css) and the page scrolls past it,
     so repeating glows came back as a hard-edged band every screenful. */
  background-repeat: no-repeat;
}

/* ---------- Header ---------- */
.home-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 22px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: color-mix(in srgb, var(--ui-bg-2) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ui-line);
}
.home-header .brand { text-decoration: none; }
.home-nav { display: flex; gap: 20px; margin-left: auto; }
.home-nav a {
  font-size: 13px; font-weight: 600; color: var(--ui-dim);
  text-decoration: none; padding: 6px 2px;
}
.home-nav a:hover { color: var(--ui-text); }
.home-actions { display: flex; align-items: center; gap: 10px; }
.home-actions .btn { text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 44px) clamp(32px, 5vw, 72px);
}
.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ui-accent);
}
.hero-text h1 {
  margin: 0 0 18px; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.1;
  font-weight: 800; letter-spacing: -.02em; color: var(--ui-strong);
}
.lede { margin: 0 0 28px; font-size: clamp(15px, 1.5vw, 17px); line-height: 1.65; color: var(--ui-dim); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14px; }
.hero-cta .btn { text-decoration: none; }
.hero-note { margin: 18px 0 0; font-size: 12.5px; color: var(--ui-faint); }

.hero-art { position: relative; min-height: 460px; display: grid; place-items: center; }
.hero-card {
  width: min(84%, 400px); height: auto; border-radius: 18px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .62);
}
.hero-card-back {
  position: absolute; transform: rotate(-9deg) translate(-16%, 4%) scale(.9);
  opacity: .72; filter: saturate(.85);
}
.hero-card-front { position: relative; transform: rotate(4deg); }

/* ---------- Sections ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: clamp(46px, 6vw, 86px) clamp(16px, 4vw, 44px); }
.section-narrow { max-width: 820px; }
.section-head { margin-bottom: clamp(26px, 3vw, 40px); }
.section-head h2 {
  margin: 0 0 12px; font-size: clamp(23px, 2.7vw, 32px); font-weight: 750;
  letter-spacing: -.015em; color: var(--ui-strong);
}
.section-head p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ui-dim); max-width: 64ch; }

/* ---------- Template strip ---------- */
.tpl-strip {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(10px, 1.3vw, 18px); row-gap: 36px;
  list-style: none; margin: 0; padding: 0;
}
.tpl-strip li { margin: 0; }
.tpl-strip img {
  width: 100%; height: auto; display: block; border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  transition: transform .25s ease;
}
.tpl-strip li:hover img { transform: translateY(-6px); }
.tpl-strip h3 { margin: 16px 0 5px; font-size: 14.5px; font-weight: 700; color: var(--ui-text); }
.tpl-strip p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ui-faint); }

/* ---------- Feature grid ---------- */
.feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; list-style: none; margin: 0; padding: 0;
}
.feat-grid li {
  margin: 0; padding: 20px;
  border: 1px solid var(--ui-line); border-radius: 14px;
  background: var(--ui-panel);
}
.feat-grid h3 { margin: 0 0 9px; font-size: 15px; font-weight: 700; color: var(--ui-strong); }
.feat-grid p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ui-dim); }

/* ---------- Plain prose ---------- */
.plain p, .plain li { font-size: 14.5px; line-height: 1.72; color: var(--ui-dim); }
.plain p { margin: 0 0 16px; }
.plain ul { margin: 0 0 16px; padding-left: 20px; }
.plain li { margin-bottom: 11px; }
.plain strong { color: var(--ui-text); font-weight: 650; }
.plain a, .home-footer a { color: var(--ui-accent); }

/* ---------- Closing call to action ---------- */
.cta {
  max-width: 1240px; margin: 0 auto clamp(40px, 6vw, 80px);
  padding: clamp(36px, 5vw, 60px) clamp(20px, 4vw, 44px); text-align: center;
  border: 1px solid var(--ui-line); border-radius: 20px;
  background:
    radial-gradient(600px 220px at 50% 0%, rgba(143, 155, 255, .20), transparent 70%),
    var(--ui-panel);
}
.cta h2 { margin: 0 0 10px; font-size: clamp(22px, 2.6vw, 30px); font-weight: 750; color: var(--ui-strong); }
.cta p { margin: 0 0 22px; font-size: 14.5px; color: var(--ui-dim); }
.cta .btn { text-decoration: none; }

/* ---------- Footer ---------- */
.home-footer { border-top: 1px solid var(--ui-line); background: var(--ui-bg-2); }
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px;
  max-width: 1240px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 44px);
}
.foot-cols h5, .foot-cols .foot-h { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-text); }
.foot-cols p { margin: 0 0 9px; font-size: 12.5px; line-height: 1.6; color: var(--ui-faint); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 340px; }
  .hero-card { width: min(70%, 320px); }
  .tpl-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 720px) {
  .home-nav { display: none; }
  .home-header { gap: 12px; flex-wrap: wrap; }
  .home-actions { margin-left: auto; flex-basis: 100%; justify-content: flex-end; min-height: 40px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .acct-name { max-width: 84px; }
}

/* style.css sets this too, but .home's own overflow rule outranks it here. */
body.home.has-overlay { overflow: hidden; }

/* Light theme: softer glows, and shadows that suit a pale page. */
:root[data-theme="light"] body.home {
  background:
    radial-gradient(900px 620px at 76% -8%, rgba(85, 97, 230, .12), transparent 62%),
    radial-gradient(760px 520px at 8% 4%, rgba(10, 143, 176, .08), transparent 60%),
    var(--ui-bg);
  background-repeat: no-repeat;
}
:root[data-theme="light"] .hero-card { box-shadow: 0 30px 70px rgba(20, 26, 48, .28); }

/* Sections an admin added (api/site.php, index.php writes them in) */
.home-text .plain p, .home-faq .plain p { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--ui-dim); }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.faq-list details { border: 1px solid var(--ui-line-2); border-radius: 12px; background: var(--ui-bg-2); padding: 0 16px; }
.faq-list summary { cursor: pointer; padding: 14px 0; font-weight: 650; color: var(--ui-strong); list-style-position: inside; }
.faq-list details p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.65; color: var(--ui-dim); }
.foot-note { max-width: 1240px; margin: 18px auto 0; padding: 0 clamp(16px, 4vw, 44px); font-size: 12.5px; color: var(--ui-faint); }

/* The gallery challenge strip above the hero (index.php, api/community.php). */
.home-challenge { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; max-width: 1180px; margin: 18px auto 0;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--ui-warn-line); background: var(--ui-warn-bg); color: var(--ui-text); font-size: 14.5px; text-align: center; }
.home-challenge a { color: var(--ui-accent-text); font-weight: 600; }
.home-challenge .hc-kind { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-warn-text); }
.home-challenge .hc-meta { color: var(--ui-dim); }
.home-challenge .hc-sep { width: 1px; height: 16px; background: var(--ui-warn-line); margin: 0 4px; }
@media (max-width: 760px) { .home-challenge { margin: 12px 16px 0; font-size: 13.5px; } .home-challenge .hc-sep { display: none; } }
