/* ==========================================================================
   CipherTile: Sudoku - section styles
   Features, method board, download band, about, footer, sticky bar, motion.
   ========================================================================== */

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-title { margin-top: 10px; font-size: 28px; }
.section-lead { margin-top: 14px; color: var(--ink-soft); }

/* ---------- Case-file cards ---------- */
.case-card {
  position: relative;
  padding: 26px 22px;
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--silver-line);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 5px rgba(169, 171, 168, 0.12), 0 12px 28px rgba(0, 0, 0, 0.35);
}
/* Engraved corner brackets */
.case-card::before,
.case-card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--bronze); opacity: 0.7; }
.case-card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.case-card::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.case-card h3 { margin-top: 18px; font-size: 21px; }
.case-card p { margin-top: 8px; color: var(--ink-soft); }

/* Raised bronze number tile with engraved numeral */
.num-tile {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 6px;
  font-family: var(--font-numeral); font-size: 24px; font-weight: 700;
  color: var(--on-bronze);
  background: linear-gradient(145deg, var(--bronze-light), var(--bronze) 50%, #a77a43);
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, 0.6), inset 0 -2px 0 rgba(60, 38, 18, 0.45), 0 3px 0 var(--bronze-deep), 0 6px 14px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 236, 200, 0.55);
}

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* ---------- Method and demo board ---------- */
.method { background: linear-gradient(180deg, transparent, rgba(110, 106, 101, 0.08), transparent); }
.method-inner { display: grid; gap: 36px; }

.method-steps { list-style: none; margin: 24px 0 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.method-steps li { position: relative; padding-left: 52px; counter-increment: step; }
.method-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 36px; height: 36px;
  font-family: var(--font-numeral); font-weight: 700; color: var(--bronze-light);
  border: 1px solid var(--bronze); border-radius: 4px;
}
.method-steps h3 { font-size: 20px; }
.method-steps p { margin-top: 4px; color: var(--ink-soft); }

.board-figure { margin: 0; }
.board {
  display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr);
  width: 100%; max-width: 460px; margin: 0 auto; aspect-ratio: 1;
  padding: 6px;
  background: var(--panel);
  border: 2px solid var(--silver);
  border-radius: 4px;
  box-shadow: 0 0 0 5px var(--panel-raised), 0 0 0 6px var(--silver-line), 0 22px 44px rgba(0, 0, 0, 0.5);
}
.cell {
  display: grid; place-items: center;
  font-family: var(--font-numeral); font-size: clamp(15px, 4.6vw, 24px); font-weight: 700;
  color: var(--ink);
  border-right: 1px solid var(--silver-line);
  border-bottom: 1px solid var(--silver-line);
  transition: background-color 0.35s var(--ease);
}
.cell[data-c="2"], .cell[data-c="5"] { border-right: 2px solid var(--silver); }
.cell[data-r="2"], .cell[data-r="5"] { border-bottom: 2px solid var(--silver); }
.cell[data-c="8"] { border-right: 0; }
.cell[data-r="8"] { border-bottom: 0; }
.cell.is-given { color: var(--ink-soft); }
.cell.is-scan { background: rgba(201, 154, 91, 0.1); }
.cell.is-target { background: rgba(201, 154, 91, 0.22); }
.cell.is-placed { color: var(--on-bronze); background: linear-gradient(145deg, var(--bronze-light), var(--bronze)); box-shadow: inset 0 1px 0 rgba(255, 240, 210, 0.55), inset 0 -2px 0 rgba(60, 38, 18, 0.4); animation: tile-set 0.4s var(--ease); }
@keyframes tile-set { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.board-caption { margin-top: 18px; text-align: center; font-size: 14px; font-style: italic; color: var(--ink-soft); }

/* ---------- Download band (parchment) ---------- */
.download {
  padding: 64px 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 238, 0.6), transparent 70%),
    var(--band);
  color: var(--band-ink);
  border-top: 1px solid var(--bronze-deep);
  border-bottom: 1px solid var(--bronze-deep);
}
.download-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.download-icon { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(34, 24, 15, 0.35); }
.download-title { margin-top: 10px; font-size: 30px; max-width: 18ch; }
.download-lead { margin-top: 12px; color: var(--band-soft); font-size: 17px; }

.store-btn-dark { background: linear-gradient(180deg, #33261a, var(--band-ink)); color: var(--ink); }
.store-btn-dark .store-btn-icon { border-right-color: rgba(242, 232, 216, 0.35); }
.store-btn-dark:hover,
.store-btn-dark:active { color: var(--ink); }

/* ---------- About ---------- */
.about-inner { max-width: 820px; }
.about-card { padding: 34px 24px; }
.about-card p { margin-top: 14px; }
.about-card .about-contact { color: var(--ink); }
.about-card a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 calc(96px + env(safe-area-inset-bottom)); background: var(--footer); border-top: 1px solid var(--silver-line); font-size: 14px; color: var(--ink-soft); }
.footer-inner { display: grid; gap: 14px; text-align: center; justify-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); }
.footer-brand img { width: 40px; height: 40px; border-radius: 10px; }
.footer-contact a { overflow-wrap: anywhere; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
.footer-copy { color: var(--ink-soft); }

/* ---------- Mobile sticky download bar ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(33, 24, 17, 0.96);
  border-top: 1px solid var(--bronze-deep);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(110%);
  transition: transform 0.35s var(--ease);
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.sticky-cta-name { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta-btn {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  background: var(--bronze); color: var(--on-bronze); border-radius: 4px;
}
.sticky-cta-btn:hover,
.sticky-cta-btn:active { background: var(--bronze-light); color: var(--on-bronze); }

/* ---------- Scroll reveal (enabled by JS only) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (min-width: 768px) {
  .section { padding: 96px 0; }
  .section-title { font-size: 38px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .download { padding: 96px 0; }
  .download-title { font-size: 44px; }
  .about-card { padding: 48px 52px; }
  .site-footer { padding-bottom: 40px; }
  .footer-inner { grid-template-columns: 1fr auto; text-align: left; justify-items: start; align-items: center; }
  .footer-legal, .footer-copy { justify-self: end; }
  .sticky-cta { display: none; }
}

@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .method-inner { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
  .cell { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
