/* =========================================================
   Cloudflare Fan (unofficial) - SLIDES edition
   One screen per slide, horizontal navigation
   Independent of style.css (the scrolling edition)
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --orange: #f38020;
  --orange-dark: #da6d0f;
  --orange-soft: #fff3e8;

  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --surface: #ffffff;
  --border: #e5e5e5;

  --text: #1d1d1d;
  --text-muted: #5a5a5a;
  --text-faint: #8a8a8a;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04), 0 2px 6px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 6px 20px rgba(20, 20, 20, 0.08);

  --radius: 14px;
  --radius-sm: 9px;
  --topbar-h: 64px;
  --footer-h: 96px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow: hidden;                 /* vertical scroll disabled - we slide horizontally */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
ol, ul { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--orange); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.accent { color: var(--orange); }

/* ---------- Top bar (fixed - body overflow hidden breaks sticky) ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 18px; height: 100%;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: 26px; color: var(--orange); }
.brand__name { font-size: 1.05rem; letter-spacing: -0.02em; }

.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; cursor: pointer; }
.nav a:hover { color: var(--text); text-decoration: none; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--orange-dark); background: var(--orange-soft); border: 1px solid #f6cda6;
  padding: 3px 9px; border-radius: 999px; cursor: default;
}
.lang {
  font-size: 0.8rem; font-weight: 600; color: var(--text-faint);
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 8px;
  cursor: not-allowed;
}

/* ---------- Slides container (sits between fixed topbar and footer) ---------- */
.slides {
  display: flex;
  width: 100vw;
  height: calc(100vh - var(--topbar-h) - var(--footer-h));
  margin-top: var(--topbar-h);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.slides::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  overflow-y: auto;                 /* per-slide fallback if content is too tall */
}
.slide--alt { background: var(--bg-alt); }

.slide__inner {
  width: 100%; max-width: 980px; margin: auto;
  text-align: center;
}
.slide__head { max-width: 680px; margin: 0 auto 32px; }
.slide__head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.slide__head p { color: var(--text-muted); font-size: 1.02rem; }

/* ---------- Slide 1: Hero ---------- */
.hero__title { font-size: clamp(2rem, 4.8vw, 3.2rem); margin-bottom: 0.8rem; }
.hero__sub { font-size: 1.12rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 1.6rem; }
.eyebrow {
  color: var(--orange-dark); font-weight: 700; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.8rem;
}
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 1.3rem; }
.hero__note { font-size: 0.85rem; color: var(--text-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.68rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: 0.97rem;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-dark); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text-muted); }

/* ---------- Slide 2: Why (5 cards) ---------- */
/* ---------- Slide 3: Products (6 cards) ---------- */
.grid { display: grid; gap: 14px; }
.grid--why { grid-template-columns: repeat(3, 1fr); }
.grid--products { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); text-align: left;
}
.card h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.93rem; line-height: 1.45; }
.card--product .card__tag {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--orange-dark); background: var(--orange-soft);
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
}
.card--product h3 { font-size: 1.02rem; margin: 0 0 0.3rem; }
.card--product p { font-size: 0.88rem; }

/* ---------- Slide 4: DX list + terminal ---------- */
.slide__inner--dev-dx {
  display: flex; flex-direction: column; gap: 24px;
  text-align: left; max-width: 860px; margin: 0 auto;
}
.dx-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.dx-list li {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm); padding: 12px 16px; color: var(--text-muted); font-size: 0.93rem;
}
.dx-list strong { color: var(--text); }
.dx-list code {
  font-family: var(--mono); background: var(--bg-alt); padding: 0.12em 0.4em; border-radius: 5px; font-size: 0.9em;
}

/* ---------- Terminal (purely visual) ---------- */
.terminal {
  max-width: 620px; margin: 0 auto;
  background: #1d1d1d; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); text-align: left;
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: #2a2a2a;
}
.tdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tdot--red { background: #ff5f56; }
.tdot--yellow { background: #ffbd2e; }
.tdot--green { background: #27c93f; }
.terminal__title { margin-left: 10px; color: #8a8a8a; font-size: 0.8rem; font-family: var(--mono); }
.terminal__body { margin: 0; padding: 20px 22px; overflow-x: auto; }
.terminal__body code {
  font-family: var(--mono); font-size: 0.92rem; line-height: 1.85; color: #e8e8e8;
  white-space: pre;
}
.c-comment { color: #6a9955; }
.c-prompt { color: var(--orange); }
.c-cmd { color: #569cd6; }
.c-ok { color: #4ec9b0; }
.c-muted { color: #8a8a8a; }

/* ---------- Slide 4: disclaimer ---------- */
.disclaimer {
  max-width: 720px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 30px 30px;
}
.disclaimer h2 { font-size: 1.35rem; }
.disclaimer p { color: var(--text-muted); }
.disclaimer__links a { font-weight: 600; }

/* ---------- Persistent page footer (always visible, fixed at bottom) ---------- */
.page-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--footer-h);
  background: #1d1d1d; color: #d6d6d6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 24px; text-align: center;
}
.page-footer__inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 1180px;
}
.page-footer p { margin: 0; }
.page-footer__disclaimer { font-size: 0.8rem; color: #b0b0b0; }
.page-footer__disclaimer strong { color: var(--orange); }
.page-footer__meta { font-size: 0.74rem; color: #8a8a8a; margin-top: 2px; }
.page-footer a { color: #e8e8e8; }

/* Keep the long disclaimer on one line at desktop widths so both editions
   render identically regardless of scrollbar width differences. */
@media (min-width: 900px) {
  .page-footer__disclaimer { white-space: nowrap; }
}

/* Footer switch link - same style as the scrolling edition (.footer__switch in style.css) */
a.footer__switch {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 6px; font-size: 0.8rem; font-weight: 600;
  color: var(--orange); transition: color 0.15s ease;
}
a.footer__switch:hover { color: #fff; text-decoration: underline; }

/* ---------- Navigation arrows ---------- */
.nav-arrow {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.2s ease;
}
.nav-arrow:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.nav-arrow:disabled { opacity: 0; cursor: default; pointer-events: none; }
.nav-arrow svg { width: 22px; height: 22px; }
.nav-arrow--prev { left: 20px; }
.nav-arrow--next { right: 20px; }

/* ---------- Dots ---------- */
.dots {
  position: fixed; bottom: calc(var(--footer-h) + 22px); left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; gap: 10px;
  background: rgba(255, 255, 255, 0.85); padding: 8px 14px; border-radius: 999px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.dot-btn {
  width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: #d4d4d4; padding: 0; transition: background 0.2s ease, width 0.2s ease;
}
.dot-btn:hover { background: var(--orange-dark); }
.dot-btn.is-active { background: var(--orange); width: 22px; border-radius: 999px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slides { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .nav-arrow:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .grid--why, .grid--products { grid-template-columns: repeat(2, 1fr); }
  .slide__inner--dev-dx { max-width: 640px; }
}
@media (max-width: 560px) {
  .slide { padding: 16px 18px; }
  .grid--why, .grid--products { grid-template-columns: 1fr; }
  .nav-arrow { width: 40px; height: 40px; }
  .nav-arrow--prev { left: 12px; }
  .nav-arrow--next { right: 12px; }
  .terminal__body code { font-size: 0.82rem; }
  .slide__inner--dev-dx { gap: 16px; }
  .dx-list li { font-size: 0.88rem; padding: 10px 12px; }
  .page-footer__disclaimer { font-size: 0.7rem; }
  .page-footer__meta { font-size: 0.66rem; }
  .footer__switch { font-size: 0.74rem; }
}
