/* ==========================================================================
   Just Fary landing page
   Mobile-first; the desktop layout kicks in at 768px.
   ========================================================================== */

:root {
  --bg: #050505;
  --surface: #121110;
  --line: #2A2623;
  --line-strong: #4A423A;
  --text: #F4EFE8;
  --muted: #A8A097;
  --icon-muted: #8C847B;
  --accent: #F2733A;
  --accent-hover: #F58A58;
  --gold: #F2C45A;
  --on-accent: #120A05;

  --font-serif: Fraunces, Georgia, serif;
  --font-sans: Manrope, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure, ol, ul { margin: 0; }
img, svg, video { display: block; }

a { color: var(--accent); }
a:hover { color: var(--gold); }

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

/* Breakpoint visibility helpers */
@media (max-width: 767.98px) { .desktop-only { display: none !important; } }
@media (min-width: 768px)    { .mobile-only  { display: none !important; } }

/* ---------- Page shell ---------- */

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 34px; object-fit: contain; }
.brand span {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.header-link {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0 8px 8px;
}

/* ---------- Shared type ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.12;
}

.section-lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn-primary {
  min-height: 56px;
  padding: 0 28px;
  border-radius: 28px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn-secondary {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: center;
  padding: 24px 0 8px;
}

.hero-main {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.12;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.hero-browser-link {
  align-self: center;
  padding: 12px;
  font-size: 15px;
}

.hero-android {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.hero-ctas-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.hero-web {
  font-size: 15px;
  color: var(--muted);
}

.qr-card {
  flex: 0 1 300px;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.qr-frame {
  padding: 14px;
  border-radius: 16px;
  background: #FFFFFF;
}
.qr-frame img { width: 168px; height: 168px; }
.qr-card h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
}
.qr-card p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Three steps ---------- */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.step-card {
  flex: 1 1 200px;
  min-width: 0;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}
.step-card h3 { font-size: 21px; }
.step-card p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Demo ----------
   Mobile: eyebrow, title, video, list (text wrapper is flattened so the
   video can slot in between). Desktop: video left, text right. */

.demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.demo-text { display: contents; }
.demo-media { order: 1; display: flex; justify-content: center; }
.demo-list { order: 2; }

.video-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 2160 / 3500; /* matches assets/demo.mp4 */
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(5, 5, 5, 0.25);
  cursor: pointer;
}
.video-frame.is-playing .video-overlay { display: none; }

.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s, background-color .15s;
}
.play-btn:hover { background: var(--accent-hover); transform: scale(1.05); }

.demo-list {
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.demo-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.demo-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-list li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.demo-list strong { font-size: 16px; font-weight: 700; }
.demo-list li span:not(.demo-num) {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Where to tap ---------- */

.device-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.device-card {
  flex: 1 1 260px;
  min-width: 0;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  gap: 20px;
  align-items: center;
}
.device-art { flex-shrink: 0; }
.device-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.device-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
.device-body strong { color: var(--text); }

.pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: .18; }
  50%      { transform: scale(1.25); opacity: .08; }
}

.tap-howto {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tap-grid {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tap-figure {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tap-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: cover;
  background: var(--surface);
  border: 2px solid var(--line-strong);
}
.tap-photo--good { border-color: var(--accent); }
.tap-figure figcaption {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tap-figure figcaption svg { flex-shrink: 0; margin-top: 1px; }
.tap-figure figcaption > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--muted);
}
.tap-figure figcaption strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.callout {
  margin-top: 12px;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.callout p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.callout ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.callout--quiet { border-color: var(--line); }
.callout .callout-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.callout-eyebrow svg { flex-shrink: 0; }
.callout .callout-note { font-size: 13px; }

/* ---------- FAQ ---------- */

.faq-section { gap: 6px; }
.faq-section .section-title { margin-bottom: 8px; }

.faq {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.faq summary::marker { color: var(--accent); }
.faq details p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Help ---------- */

.help-card {
  scroll-margin-top: 20px;
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.help-text {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help-text h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.12;
}
.help-text p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.help-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  transition: border-color .15s;
}
.pill:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding-top: 8px;
  font-size: 14px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold); }

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (min-width: 768px) {
  .page {
    max-width: 1120px;
    padding: 32px 40px 56px;
    gap: 64px;
  }
  .sections { gap: 64px; }

  .eyebrow { font-size: 13px; }
  .section-title { font-size: 38px; }
  .section-lead { font-size: 17px; }
  .stack { gap: 18px; }

  .hero { padding: 40px 0 16px; }
  .hero-main { gap: 20px; }
  .hero h1 { font-size: 64px; }
  .hero-lead { font-size: 19px; }

  .demo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 64px;
    align-items: center;
  }
  .demo-text {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 460px;
    min-width: 0;
  }
  .demo-media { order: -1; min-width: 0; }
  .video-frame { max-width: 300px; }

  .device-cards { gap: 16px; }

  .tap-howto {
    margin-top: 28px;
    align-items: center;
    gap: 22px;
  }
  .tap-howto h3 { text-align: center; }
  .tap-grid { max-width: 720px; gap: 48px; }
  .tap-figure figcaption { justify-content: center; }

  .callout { margin-top: 28px; }

  .faq-section { gap: 18px; }
  .faq-section .section-title { margin-bottom: 0; }
  .faq-section .section-lead { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; }
  .btn, .play-btn, .pill { transition: none; }
}
