/* WordLantern site — built on gramof design (gramofdesign/gramof.css).
   Only site-scoped classes live here; shared components are not restyled. */

/* ── Accent: lantern brass ───────────────────────────────────────────────────
   Light: white text on accent is AA (5.4:1). Dark: near-black text is AA (11.9:1). */
:root[data-accent='wordlantern'] { --accent: #9a5b0d; --accent-hover: #7f4a09; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light):not(.theme-dark)[data-accent='wordlantern'] { --accent: #f2c46d; --accent-hover: #f7d898; }
}
html.theme-dark[data-accent='wordlantern'] { --accent: #f2c46d; --accent-hover: #f7d898; }

/* Popup surface, modelled on the macOS word popup */
:root, html.theme-light {
  --pop-bg: rgba(250, 250, 252, 0.72);
  --pop-edge: rgba(0, 0, 0, 0.10);
  --pop-text: #1d1d1f;
  --pop-dim: #6e6e73;
  --doc-bg: #fffdf8;
}
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light):not(.theme-dark) {
    --pop-bg: rgba(44, 44, 48, 0.72);
    --pop-edge: rgba(255, 255, 255, 0.12);
    --pop-text: #f5f5f7;
    --pop-dim: #a1a1a6;
    --doc-bg: #1b1d24;
  }
}
html.theme-dark {
  --pop-bg: rgba(44, 44, 48, 0.72);
  --pop-edge: rgba(255, 255, 255, 0.12);
  --pop-text: #f5f5f7;
  --pop-dim: #a1a1a6;
  --doc-bg: #1b1d24;
}

/* ── Page frame ──────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.for-touch { display: none; }
@media (hover: none) { .for-hover { display: none; } .for-touch { display: inline; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.top {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-5) var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.top__brand { color: var(--text); font-family: var(--font-display); font-size: var(--text-lg); }
.top__brand:hover { color: var(--text); text-decoration: none; }
.top__brand img { border-radius: 7px; }

main {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: var(--space-12);
  align-items: center;
  padding: 72px 0 64px;
}
.hero__icon {
  display: block;
  width: 112px; height: 112px;
  margin-bottom: var(--space-6);
  filter: drop-shadow(0 14px 28px rgba(42, 28, 24, 0.28));
}
.hero .eyebrow { color: var(--accent); margin-bottom: var(--space-3); }
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.2vw, 58px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: var(--space-5);
}
.hero__intro {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 34em;
  margin-bottom: var(--space-6);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.cta { min-height: 44px; padding: 10px 20px; font-size: var(--text-lg); border-radius: var(--radius-md); }
.cta[aria-disabled='true'] {
  background: var(--surface-sunk);
  color: var(--text-secondary);
  border-color: var(--line-strong);
  cursor: default;
}
.cta[aria-disabled='true']:hover { text-decoration: none; }
.btn.cta:hover { text-decoration: none; }

/* ── Try it ──────────────────────────────────────────────────────────────── */
.try { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.try__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.try__head .eyebrow { color: var(--accent); margin-bottom: var(--space-1); }
.try__hint { color: var(--text-secondary); max-width: 28em; }
kbd {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.35em;
  margin: 0 1px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  line-height: 1.5;
}
.doc {
  background: var(--doc-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  font-family: 'New York', ui-serif, Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
  min-height: 248px;
}
.doc__source {
  margin-top: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.doc__source::before { content: '— '; }

/* Every word is live, as on a real screen: no highlight, like the app.
   Only keyboard use shows which word is current. */
.doc .w { border-radius: 3px; cursor: text; }
.doc:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.doc:focus-visible .w.is-active { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-ring); }
.doc__text { margin: 0; }
.sample { margin: 0; }
.sample .doc__source { margin: var(--space-2) 0 0; }
.try__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* The popup — same anatomy as the app: caption source, semibold rounded answer */
.wl-popup {
  position: fixed;
  z-index: 500;
  min-width: 180px;
  max-width: 340px;
  padding: 14px;
  border-radius: 16px;
  background: var(--pop-bg);
  border: 0.5px solid var(--pop-edge);
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  color: var(--pop-text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px) scale(0.98);
  transform-origin: top left;
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.wl-popup.is-shown { opacity: 1; transform: none; }
.wl-popup__source {
  font-family: -apple-system, BlinkMacSystemFont, var(--font-sans);
  font-size: 11px;
  line-height: 1.3;
  color: var(--pop-dim);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-popup__answer {
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.wl-popup__answer.is-pending { color: var(--pop-dim); }
.wl-popup__answer.is-filled { animation: wl-fill 160ms var(--ease-out); }
@keyframes wl-fill { from { opacity: 0; } to { opacity: 1; } }

/* ── Roster: a slow, endless strip of the App Store screenshots ──────────── */
.roster { margin: 0 calc(50% - 50vw); padding: var(--space-4) 0 var(--space-12); }
.roster__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.roster__track {
  list-style: none;
  display: flex;
  gap: var(--roster-gap, 24px);
  width: max-content;
  padding: var(--space-4) 0 var(--space-8);
  animation: roster-roll var(--roster-duration, 72s) linear infinite;
}
.roster__track { will-change: transform; }
.roster__viewport:hover .roster__track,
.roster__viewport:focus-within .roster__track { animation-play-state: paused; } /* no-JS fallback */
@keyframes roster-roll { to { transform: translateX(calc(-50% - var(--roster-gap, 24px) / 2)); } }

.shot {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.shot:hover { box-shadow: 0 0 0 2px var(--accent-ring), var(--shadow-lg); }
.shot:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-lg); }
.shot img {
  display: block;
  width: 576px;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
}

@media (prefers-reduced-motion: reduce) {
  .roster__viewport { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-mask-image: none; mask-image: none; }
  .roster__track { animation: none; padding-inline: var(--space-6); }
  .roster__track > [aria-hidden='true'] { display: none; }
  .roster__track > li { scroll-snap-align: center; }
}

/* ── Features & providers ────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.feature { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.feature .tag { align-self: flex-start; }
.feature h2 { margin-top: var(--space-1); }
.feature p { color: var(--text-secondary); }

.providers { padding: var(--space-10) 0 var(--space-8); text-align: center; }
.providers .eyebrow { margin-bottom: var(--space-3); }
.providers__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  max-width: 820px;
  margin: 0 auto var(--space-3);
}
.providers__list .tag { font-size: var(--text-sm); padding: 0.3em 0.7em; }

/* ── Support & privacy ───────────────────────────────────────────────────── */
.info { padding: var(--space-2); margin-bottom: var(--space-8); }
.info .acc__body { max-width: 760px; color: var(--text-secondary); gap: var(--space-2); }
.info .acc__body h3 { color: var(--text); margin-top: var(--space-2); }
.info .contact { font-weight: 500; }

.foot {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.foot nav { display: flex; gap: var(--space-5); }

/* ── Lightbox ────────────────────────────────────────────────────────────── */
dialog.lightbox {
  margin: auto;
  max-width: min(1440px, 94vw);
  width: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(10, 8, 6, 0.72); backdrop-filter: blur(6px); }
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.lightbox__bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.lightbox__count { color: #e8eaf0; font-size: var(--text-sm); min-width: 4em; text-align: center; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding-top: 48px; }
  .features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top { padding: var(--space-3) var(--space-4) 0; }
  main { padding: 0 var(--space-4); }
  .hero { padding: 36px 0 40px; }
  .hero__icon { width: 88px; height: 88px; }
  .hero__title { font-size: 38px; }
  .try { padding: var(--space-4); }
  .doc { padding: var(--space-4); font-size: 18px; min-height: 0; }
  .shot img { width: 80vw; }
  .roster__track { --roster-gap: 16px; }
  .foot { flex-direction: column; padding: 0 var(--space-4) var(--space-6); }
}

/* ── Copy additions: clearer preview framing ─────────────────────────────── */
.try__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.try__head .eyebrow + .try__title { margin-top: 0; }

/* The sample text sits in a small macOS-style document window */
.doc { padding-top: 0; overflow: hidden; }
.doc__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 calc(-1 * var(--space-6)) var(--space-4);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunk);
  font-family: -apple-system, BlinkMacSystemFont, var(--font-sans);
  font-size: 12px;
  line-height: 1;
}
.doc__lights { display: inline-flex; gap: 7px; flex: none; }
.doc__lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.doc__lights i:nth-child(2) { background: #febc2e; }
.doc__lights i:nth-child(3) { background: #28c840; }
.doc__bar b { flex: 1; text-align: center; font-weight: 600; color: var(--text-secondary); margin-right: 47px; }
.doc__bar b .w { cursor: default; }

.roster__head {
  max-width: var(--content-wide);
  margin: 0 auto var(--space-2);
  padding: 0 var(--space-6);
}
.roster__head h2 { margin-bottom: var(--space-1); }

.steps { padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--space-1); }
.steps li::marker { color: var(--accent); font-family: var(--font-mono); font-weight: 500; }
.caution { color: var(--text); font-weight: 500; }

@media (max-width: 640px) {
  .doc__bar { margin: 0 calc(-1 * var(--space-4)) var(--space-3); }
  .roster__head { padding: 0 var(--space-4); }
}
