/* Landing page: Guy's front door. Builds on styles.css: white rooms, near-black accents, soft shadows. */
.home { display: flex; flex-direction: column; }
.home main { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 0 24px; }
.home a { color: inherit; }
.home .btn { text-decoration: none; }

/* ---------- masthead: header and hero over one backdrop of commander art ---------- */
/* The art sits in its own layer, .masthead-art, which crops the blurred, scaled-up image. The masthead itself
   doesn't crop, so the account menu can hang below it, over the page. */
.masthead { position: relative; z-index: 10; isolation: isolate; color: #fbf5eb; background: #141414; }
.masthead-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.masthead-art::before { /* the art, faded in once it loads */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--hero-art, none) center 22% / cover no-repeat;
  opacity: 0; transform: scale(1.08); filter: blur(3px) saturate(1.1); transition: opacity 0.9s ease, transform 1.6s ease;
}
.masthead.has-art .masthead-art::before { opacity: 1; transform: scale(1.04); } /* scaled a little so the blur never shows an edge */
.masthead-art::after { /* a soft black veil, darker at the top for the header and at the bottom edge */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14, 14, 14, 0.82) 0%, rgba(14, 14, 14, 0.58) 32%, rgba(14, 14, 14, 0.66) 70%, rgba(14, 14, 14, 0.9) 100%),
    radial-gradient(ellipse at 50% 55%, transparent 30%, rgba(14, 14, 14, 0.35) 100%);
}

/* the header has no bar of its own here: it sits on the art */
.masthead .home-bar { position: relative; z-index: 2; justify-content: space-between; background: transparent; box-shadow: none; border: 0; }
.home-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.narrow-only { display: none; }
.home-bar .brand { order: 0; } /* styles.css reorders the builder's header on small screens */

.btn.big { min-height: 50px; padding: 0.6em 1.6em; font-size: 1.07rem; }

/* ---------- hero ---------- */
.hero {
  display: grid; place-items: center; text-align: center;
  min-height: min(620px, calc(88vh - 70px)); padding: 48px 24px 72px;
}
.hero-text { display: flex; flex-direction: column; align-items: center; max-width: 820px; }
.hero h1 { font: 700 clamp(2.5rem, 6vw, 4.6rem)/1.02 var(--serif); letter-spacing: -0.025em; text-wrap: balance; color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.hero-brand { white-space: nowrap; }
.tagline { margin-top: 14px; font: italic 500 clamp(1.2rem, 2.3vw, 1.6rem)/1.3 var(--serif); color: rgba(247, 245, 240, 0.9); }
.lead { max-width: 34em; margin-top: 18px; font-size: 1.1rem; line-height: 1.65; color: rgba(247, 245, 240, 0.74); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.hero .btn.primary { background: #fbf5eb; color: #141414; border-color: #fbf5eb; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.hero .btn.primary:hover { background: #fff; border-color: #fff; }
.hero .btn.ghost { background: rgba(247, 245, 240, 0.06); color: #fbf5eb; border-color: rgba(247, 245, 240, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero .btn.ghost:hover { background: rgba(247, 245, 240, 0.14); border-color: #fbf5eb; }
/* search shared decks, under the main buttons */
.hero-search {
  display: flex; align-items: center; gap: 8px; width: min(560px, 100%); margin-top: 28px; padding: 5px 5px 5px 16px;
  border-radius: 99px; background: rgba(247, 245, 240, 0.1); border: 1px solid rgba(247, 245, 240, 0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color 0.15s, background-color 0.15s;
}
.hero-search:focus-within { border-color: #fbf5eb; background: rgba(247, 245, 240, 0.16); }
.hero-search svg { flex: none; width: 18px; height: 18px; fill: none; stroke: rgba(247, 245, 240, 0.75); stroke-width: 2; stroke-linecap: round; }
.hero-search input { flex: 1; min-width: 0; height: 40px; padding: 0; background: transparent; border: 0; color: #fbf5eb; font-size: 1rem; }
.hero-search input::placeholder { color: rgba(247, 245, 240, 0.6); }
.hero-search input:focus { outline: none; }
.hero-search button {
  flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 99px; cursor: pointer;
  background: #fbf5eb; color: #141414; font: 600 0.92rem var(--sans);
}
.hero-search button:hover { background: #fff; }
/* Colors and Bracket under the deck search: small toggles that go with the search into Browse decks */
.hero-filters { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 20px; margin-top: 12px; }
.hf-colors { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; border: 0; }
.hf-colors legend, .hf-bracket > span { float: left; margin-right: 8px; font: 700 0.68rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(247, 245, 240, 0.65); }
.hf-colors label { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.hf-colors input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
/* a thin light outline so the black pip stays visible on the dark backdrop */
.hf-colors .pip { width: 22px; height: 22px; min-width: 0; padding: 0; font-size: 0.8rem; opacity: 0.6; transition: opacity 0.15s; box-shadow: inset 0 0 0 1px rgba(247, 245, 240, 0.45); }
.hf-colors label:hover .pip { opacity: 0.9; }
.hf-colors input:checked + .pip { opacity: 1; box-shadow: inset 0 0 0 1px rgba(247, 245, 240, 0.45), 0 0 0 2px #1b1a18, 0 0 0 4px #fbf5eb; }
.hf-colors input:focus-visible + .pip { outline: 2px solid #fbf5eb; outline-offset: 4px; }
.hf-bracket { display: flex; align-items: center; }
.hf-bracket select {
  height: 32px; padding: 0 10px; border-radius: 10px; font: inherit; font-size: 0.88rem;
  background: rgba(247, 245, 240, 0.08); color: #fbf5eb; border: 1px solid rgba(247, 245, 240, 0.35);
}
.hf-bracket select option { color: #141414; }
.hero-browse { margin-top: 10px; font-size: 0.88rem; color: rgba(247, 245, 240, 0.65); }
.hero-browse a { color: #fbf5eb; }
.draft-note { margin-top: 14px; font-size: 0.92rem; color: rgba(247, 245, 240, 0.7); }
.hero-credit { position: absolute; right: 18px; bottom: 12px; margin: 0; font-size: 0.72rem; color: rgba(247, 245, 240, 0.5); }
/* ---------- features ---------- */
.home h2 { font: 700 clamp(1.6rem, 3vw, 2.2rem)/1.15 var(--serif); letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
/* The sign-in dialog (account.js) looks the same as in the builder. */
.home dialog .dlg h2 { font: 600 var(--s2)/1.2 var(--serif); letter-spacing: -0.015em; text-align: left; }
.section-sub { max-width: 34em; margin: 8px auto 0; text-align: center; color: var(--ink-soft); font-size: 1.05rem; }
.features { padding: 40px 0 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
.feature {
  padding: 24px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.feature:hover { border-color: #141414; transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08); }
.feature-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #f2e9db; }
.feature svg { width: 24px; height: 24px; fill: #141414; stroke: #141414; stroke-width: 0; }
.feature:last-child svg { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-top: 14px; font: 700 1.15rem/1.3 var(--serif); }
.feature p { margin-top: 6px; color: var(--ink-soft); }

/* ---------- steps ---------- */
.steps { padding: 56px 0 24px; }
.step-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 30px 0 0; padding: 0; list-style: none; }
.step-list li {
  position: relative; padding: 22px 22px 22px 78px; border-radius: 20px;
  background: #f7f0e5; border: 1px solid var(--line);
}
.step-n {
  position: absolute; left: 20px; top: 20px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: #141414; color: #fff; font: 700 1.15rem/1 var(--serif);
}
.step-list h3 { font: 700 1.1rem/1.3 var(--serif); }
.step-list p { margin-top: 4px; color: var(--ink-soft); }

/* ---------- closing call to action ---------- */
.cta-band {
  margin: 56px 0 64px; padding: 46px 24px; border-radius: 28px; text-align: center; color: var(--cream);
  background: radial-gradient(600px 240px at 50% 0%, rgba(255, 255, 255, 0.1), transparent 70%), #141414;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.home .cta-band h2 { color: var(--cream); }
.cta-band p { max-width: 36em; margin: 10px auto 24px; color: rgba(255, 255, 255, 0.72); }

.home-foot { padding: 22px 24px 28px; text-align: center; font-size: 0.82rem; color: var(--ink-soft); border-top: 1px solid var(--line); }
.home-foot p + p { margin-top: 4px; }
.home-foot a { color: var(--ink); }

@media (max-width: 900px) {
  .hero { min-height: 0; padding: 56px 20px 72px; }
  .feature-grid, .step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .home main { padding: 0 16px; }
  .home-bar { flex-wrap: nowrap; padding: 10px 16px; }
  .home-bar .brand { font-size: 1.08rem; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .home-nav .btn:not(.primary):not(.home-signin) { display: none; }
  .home-nav { flex-wrap: nowrap; gap: 6px; }
  .home-nav .btn { min-height: 32px; padding: 0.3em 0.75em; font-size: 0.82rem; white-space: nowrap; }
  .home-bar .brand { gap: 6px; }
  .home-bar .brand-mark { width: 24px; height: 24px; }
  .hero-brand { white-space: normal; }
  .feature-grid, .step-list { grid-template-columns: 1fr; }
  .btn.big { width: 100%; }
}
/* Narrow phones: the account button shows just its initial (the name stays for screen readers), so the brand,
   the account button and Deck builder fit on one line. */
@media (max-width: 420px) {
  .home-nav .acct-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead-art::before, .feature { transition: none; }
}

/* the closing invite: white button on the black panel */
.cta-band .btn.primary { background: #fbf5eb; color: #141414; border-color: #fbf5eb; }
.cta-band .btn.primary:hover { background: #efe6d8; }
