/* ==========================================================================
   CipherTile: Sudoku - base styles
   Tokens, reset, layout, header, hero and ticket-stub store buttons.
   Mobile first: base rules target <= 768px, min-width queries enhance.
   ========================================================================== */

:root {
  /* Espresso ground and panels */
  --ground: #17110c;
  --panel: #211811;
  --panel-raised: #2b2017;
  /* Text */
  --ink: #f2e8d8;
  --ink-soft: #cdbfa9;
  /* Antique bronze and amber */
  --bronze: #c99a5b;
  --bronze-light: #e2bd86;
  --bronze-deep: #7c5530;
  --amber: #e3a55c;
  --on-bronze: #1a120b;
  /* Matte silver and smoke (decorative lines only) */
  --silver: #a9aba8;
  --silver-line: rgba(169, 171, 168, 0.22);
  --smoke: #6e6a65;
  /* Parchment download band */
  --band: #e8dcc6;
  --band-ink: #22180f;
  --band-soft: #4e3f2e;
  --footer: #0e0a07;
  /* Disabled App Store button: fixed neutral gray, never brand colored */
  --disabled-bg: #2a2a2a;
  --disabled-ink: #ececec;

  --font-display: Didot, "Bodoni 72", "Bodoni MT", "Bodoni Moda", "Libre Bodoni", Georgia, "Times New Roman", serif;
  --font-numeral: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --header-h: 48px;
  --radius: 6px;
  --container: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--ground);
  /* Smoky vignette over a faint matte-silver 9-column lattice */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(201, 154, 91, 0.12), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(110, 106, 101, 0.14), transparent 55%),
    repeating-linear-gradient(90deg, rgba(169, 171, 168, 0.035) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(169, 171, 168, 0.035) 0 1px, transparent 1px 44px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--bronze-light); text-underline-offset: 3px; }
a:hover,
a:active { color: var(--ink); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: 0.005em; }

p { margin: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--bronze); color: var(--on-bronze); border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow-dark { color: #7a4a1c; }

/* ---------- Sticky header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  background: rgba(23, 17, 12, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--silver-line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--silver-line); }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; }

.site-nav { display: none; }

.header-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bronze); color: var(--on-bronze); text-decoration: none; font-weight: 700;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.header-cta:hover,
.header-cta:active { background: var(--bronze-light); color: var(--on-bronze); }
.header-cta:active { transform: translateY(1px); }
.header-cta-icon { width: 20px; height: 20px; }
.header-cta-label { display: none; }

/* ---------- Hero: stacked centered dossier ---------- */
.hero { padding: calc(var(--header-h) + 36px) 0 56px; text-align: center; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }

.hero-seal {
  width: 88px; height: 88px; border-radius: 22px; margin-bottom: 20px;
  box-shadow: 0 0 0 1px rgba(226, 189, 134, 0.45), 0 0 0 6px var(--ground), 0 0 0 7px var(--silver-line), 0 14px 30px rgba(0, 0, 0, 0.55);
}

.hero-title { margin-top: 12px; font-size: 34px; max-width: 14ch; }
.hero-lead { margin-top: 14px; font-family: var(--font-display); font-size: 20px; font-style: italic; line-height: 1.4; color: var(--bronze-light); max-width: 30ch; }
.hero-sub { margin-top: 14px; color: var(--ink-soft); max-width: 52ch; }

.case-notes {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  font-size: 14px; color: var(--ink-soft);
}
.case-notes li { display: inline-flex; align-items: center; gap: 8px; }
.case-notes li::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: var(--bronze); }

.dossier { position: relative; width: 100%; max-width: 940px; margin: 40px 0 0; padding: 12px 12px 0; background: 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.14), 0 24px 48px rgba(0, 0, 0, 0.5); }
.dossier-tab {
  position: absolute; top: -15px; left: 20px;
  padding: 3px 12px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--panel-raised); color: var(--ink-soft);
  border: 1px solid var(--silver-line); border-bottom: 0; border-radius: 6px 6px 0 0;
}
.dossier-photo { position: relative; overflow: hidden; border-radius: 3px; }
.dossier-photo img { width: 100%; aspect-ratio: 1024 / 500; object-fit: cover; filter: sepia(0.08) contrast(1.03); }
/* Photo corner mounts */
.dossier-photo::before,
.dossier-photo::after { content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid rgba(226, 189, 134, 0.7); }
.dossier-photo::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.dossier-photo::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.dossier-caption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  padding: 12px 4px 14px; font-size: 14px; color: var(--ink-soft); text-align: left;
  font-family: var(--font-numeral); font-style: italic;
}

/* ---------- Ticket-stub store buttons ---------- */
.store-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; margin-top: 28px; }

.store-btn {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; width: 100%; padding: 8px 22px;
  font: inherit; text-align: left; text-decoration: none; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--bronze-light), var(--bronze) 55%, #b5864a);
  color: var(--on-bronze);
  border-radius: 4px;
  /* Notched ticket ends */
  -webkit-mask: radial-gradient(circle 8px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 8px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat;
  transition: transform 0.15s var(--ease), filter 0.2s var(--ease);
}
.store-btn:hover,
.store-btn:active { filter: brightness(1.08); color: var(--on-bronze); }
.store-btn:active { transform: translateY(2px); filter: brightness(0.96); }
/* The notch mask clips outer outlines, so draw the focus ring inside */
.store-btn:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }

/* Perforated stub divider */
.store-btn-icon { display: grid; place-items: center; width: 40px; height: 40px; padding-right: 12px; border-right: 2px dashed rgba(26, 18, 11, 0.4); box-sizing: content-box; }
.store-btn-icon svg { width: 26px; height: 26px; }
.store-btn-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn-text small { font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.store-btn-text strong { font-family: var(--font-display); font-size: 21px; }

/* App Store placeholder: disabled, neutral gray, never clickable */
.store-btn.is-disabled,
.store-btn.is-disabled:hover,
.store-btn.is-disabled:active {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
  transform: none;
}
.store-btn.is-disabled .store-btn-icon { border-right-color: rgba(236, 236, 236, 0.35); }
.soon-tag {
  position: absolute; top: 6px; right: 14px;
  padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--disabled-ink); border: 1px solid rgba(236, 236, 236, 0.6); border-radius: 3px;
}

@media (min-width: 768px) {
  :root { --header-h: 64px; }
  .container { padding: 0 32px; }
  .brand-icon { width: 36px; height: 36px; }
  .brand-name { font-size: 21px; }
  .site-nav { display: flex; gap: 4px; }
  .site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-soft); text-decoration: none; font-size: 15px; border-radius: var(--radius); }
  .site-nav a:hover,
  .site-nav a:active { color: var(--ink); background: rgba(169, 171, 168, 0.08); }
  .header-cta { width: auto; padding: 0 20px; border-radius: 4px; }
  .header-cta-label { display: inline; }
  .hero { padding: calc(var(--header-h) + 56px) 0 80px; }
  .hero-seal { width: 104px; height: 104px; border-radius: 26px; }
  .hero-title { font-size: 52px; }
  .hero-lead { font-size: 24px; }
  .store-buttons { flex-direction: row; justify-content: center; max-width: none; width: auto; }
  .store-btn { width: 248px; }
  .dossier { margin-top: 56px; padding: 16px 16px 0; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 64px; }
}
