/* 2048 Super — components for the home, FAQ, feedback and contact pages.
   Depends on /theme.css (tokens, chrome, panels, buttons, forms, launch panel). */

@layer components {

  /* ============================== home ============================== */
  .home-hero { position: relative; padding-block: clamp(2rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4.5rem); overflow: clip; }
  .home-hero .wrap { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; position: relative; }
  @media (min-width: 56rem) { .home-hero .wrap { grid-template-columns: minmax(0, 13fr) minmax(0, 10fr); } }
  .torch {
    position: absolute; top: -6rem; width: 44rem; aspect-ratio: 1; pointer-events: none; mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(255, 170, 60, .34), rgba(255, 120, 40, .12) 35%, transparent 62%);
    animation: flicker 3.2s ease-in-out infinite alternate;
  }
  .torch-l { left: -22rem; } .torch-r { right: -22rem; animation-delay: -1.7s; }
  @keyframes flicker { from { opacity: .6; scale: .97; } to { opacity: 1; scale: 1.03; } }
  /* the emblem hangs from the header's stone beam: no top padding, chains tucked 3px under it */
  .home-hero { padding-top: 0; }
  .home-hero .wrap { align-items: start; }
  .hero-copy { display: grid; justify-items: center; text-align: center; }
  .emblem { width: min(100%, 33rem); height: auto; margin-top: -3px; filter: drop-shadow(0 24px 30px rgba(0,0,0,.6)); transform-origin: 50% 0; }
  @media (prefers-reduced-motion: no-preference) { .emblem { animation: sway 6s ease-in-out infinite alternate; } }
  @keyframes sway { from { rotate: -0.8deg; } to { rotate: 0.8deg; } }
  .home-hero .lead { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.1; color: var(--gold); text-shadow: var(--title-shadow); margin-top: .25rem; max-width: 18ch; text-wrap: balance; }
  .home-hero .twist { color: var(--ink-2); font-size: var(--t-0); margin-top: .6rem; max-width: 40ch; }
  .home-hero .launch-form { margin-top: 1.4rem; width: min(100%, 30rem); text-align: left; }
  .home-hero .also { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: center; }
  .home-hero .playground { justify-self: center; width: min(100%, 34rem); margin-top: clamp(1rem, 4vw, 3.5rem); }
  .langs { display: flex; flex-wrap: wrap; gap: .4rem; }
  .langs span { font-size: .8rem; color: var(--ink-2); background: rgba(0,0,0,.35); border: 1px solid var(--gold-3); padding: .2rem .6rem; border-radius: 999px; }

  /* a phone screenshot on the stone: rounded, gold-rimmed */
  .shot {
    display: block; width: 100%; max-width: 300px; height: auto; margin-inline: auto; border-radius: 28px;
    box-shadow: 0 0 0 3px var(--gold-3), 0 0 0 5px #1d130b, 0 30px 60px -20px rgba(0,0,0,.95);
  }
  .shots { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .shots figure { margin: 0; display: grid; gap: .75rem; justify-items: center; }
  .shots figcaption { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; color: var(--gold); text-shadow: 0 1px 0 var(--gold-4); }

  .feature-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .feature { display: grid; gap: .6rem; padding: .75rem 1rem 1rem; align-content: start; justify-items: center; text-align: center; }
  .feature img { width: 4.25rem; height: 4.25rem; object-fit: contain; object-position: center; filter: drop-shadow(0 4px 6px rgba(0,0,0,.7)); margin-bottom: .2rem; }   /* one square box for every icon, so tall and round art match */
  .feature h3 { font-size: var(--t-1); font-weight: 800; }
  .feature p { color: var(--ink-2); font-size: var(--t--1); max-width: 30ch; text-wrap: pretty; }

  .facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
  .fact { padding: .9rem 1rem; border-left: 3px solid var(--gold-3); background: rgba(0,0,0,.3); border-radius: 0 .5rem .5rem 0; }
  .fact b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--gold); text-shadow: 0 1px 0 var(--gold-4); }
  .fact span { font-size: var(--t--1); color: var(--ink-2); }

  .chapter { padding-block: clamp(3rem, 8vw, 6rem); }
  .chapter-head { display: grid; justify-items: center; text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
  .sub { color: var(--ink-2); font-size: var(--t-1); margin-top: .8rem; line-height: 1.45; max-width: 44rem; }

  /* ============================== FAQ ============================== */
  .faq-group { padding: .5rem 1rem; margin-bottom: 1.75rem; }
  .faq-group h2 { font-size: var(--t-2); margin-bottom: .5rem; display: flex; align-items: center; gap: .6rem; }
  .faq-group h2 img { width: 2rem; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
  details { border-top: 1px solid rgba(255,255,255,.08); }
  summary {
    cursor: pointer; list-style: none; padding: .85rem 2.4rem .85rem 1.7rem; position: relative;
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: var(--ink);
  }
  summary::-webkit-details-marker { display: none; }
  summary::before { content: ""; position: absolute; left: 0; top: 1rem; width: 1.05rem; aspect-ratio: 96 / 149; background: url("/assets/game/diamond.webp") center / contain no-repeat; }
  summary::after { content: "+"; position: absolute; right: .6rem; top: 50%; translate: 0 -50%; font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); line-height: 1; }
  details[open] summary::after { content: "–"; }
  details[open] summary { color: var(--gold); text-shadow: 0 1px 0 var(--gold-4); }
  summary:hover { color: var(--gold-2); }
  details .body { padding: 0 1.7rem 1rem; color: var(--ink-2); font-size: var(--t-0); }
  details .body p { margin-bottom: .6rem; } details .body p:last-child { margin-bottom: 0; }
  .list { padding-left: 1.2rem; margin: .4rem 0 .6rem; }
  .list li { margin: .35rem 0; } .list li b { color: var(--gold); font-family: var(--font-display); font-size: 1.1em; }

  /* ============================== feedback + contact ============================== */
  .form-panel form { display: grid; gap: 1rem; padding: .5rem .75rem; }
  .form-panel .btn-red { justify-self: start; }
  .after { margin-top: 1.25rem; color: var(--ink-2); font-size: var(--t--1); text-align: center; }
  .mail-panel { text-align: center; padding: 1rem 1rem 1.25rem; margin-bottom: 1.5rem; }
  .mail { display: block; width: fit-content; margin-inline: auto; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 4vw, 2.1rem); letter-spacing: .02em; text-decoration: none; word-break: break-all; color: var(--gold); text-shadow: var(--title-shadow); }
  .mail-panel p { color: var(--ink-2); font-size: var(--t--1); margin-top: .6rem; max-width: 46ch; margin-inline: auto; }
  .cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
  .cards .panel { padding: .4rem .75rem; }
  .cards h3 { font-size: var(--t-1); font-weight: 800; margin-bottom: .35rem; }
  .cards p { color: var(--ink-2); font-size: var(--t--1); }
  .kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin-top: 1.75rem; font-size: var(--t-0); }
  .kv dt { color: var(--gold); font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }
  .kv dd { margin: 0; color: var(--ink); }
  .todo { color: #ffb3a3; border: 1px dashed var(--red-2); border-radius: .3rem; padding: 0 .4rem; font-size: .9em; font-weight: 700; }

  @media (prefers-reduced-motion: reduce) { .torch { animation: none; } }
}

@layer components {
  /* the wheel loop on the home page */
  .video-card { display: grid; gap: 1.25rem; align-items: center; margin-top: 2rem; padding: .5rem .75rem; }
  @media (min-width: 48rem) { .video-card { grid-template-columns: minmax(14rem, 20rem) 1fr; gap: 2rem; } }
  .loop { width: 100%; height: auto; border-radius: .75rem; box-shadow: 0 0 0 3px var(--gold-3), 0 0 0 5px #1d130b, 0 20px 40px -16px rgba(0,0,0,.9); background: #000; }
  .video-card h3 { font-size: var(--t-2); }
  .video-card p { color: var(--ink-2); margin-top: .4rem; max-width: 46ch; }
  /* phone: the screenshot strip swipes sideways (the only thing on the site allowed to) */
  @media (max-width: 47.99rem) {
    .shots { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 68%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .75rem; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
    .shots::-webkit-scrollbar { display: none; }
    .shots figure { scroll-snap-align: center; }
  }
}
