/* =========================================================
   Cloudflare Fan (unofficial) - styles
   Light, clean theme · Cloudflare orange (#F38020) accent
   ========================================================= */

/* ---------- 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;
  --maxw: 1100px;
  --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 { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -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; }
code { font-family: var(--mono); background: var(--bg-alt); padding: 0.15em 0.45em; border-radius: 6px; font-size: 0.92em; }

.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; }

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

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  height: var(--topbar-h);
  max-width: 1180px; margin: 0 auto; padding: 0 24px;   /* same as slides edition */
}
.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; }
.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;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.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); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 80px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 80% -10%, var(--orange-soft) 0%, transparent 70%),
    radial-gradient(50% 40% at 0% 0%, #f3f0ff 0%, transparent 60%);
}
.hero__inner { text-align: center; max-width: 760px; }
.eyebrow {
  color: var(--orange-dark); font-weight: 700; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.8rem;
}
.hero__title { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 0.9rem; }
.hero__sub { font-size: 1.15rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 1.8rem; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero__note { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section__head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.section__head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.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: 24px; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #f0d9bf; }
.card h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

.card--product .card__tag {
  display: inline-block; font-size: 0.7rem; 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: 12px;
}

/* ---------- DX list ---------- */
.dx-list { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.dx-list li {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm); padding: 18px 22px; color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.dx-list strong { color: var(--text); }

/* ---------- Disclaimer ---------- */
.disclaimer {
  max-width: 760px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 36px 32px;
}
.disclaimer h2 { font-size: 1.4rem; }
.disclaimer p { color: var(--text-muted); }
.disclaimer__links { font-size: 0.95rem; }
.disclaimer__links a { font-weight: 600; }

/* ---------- Footer ---------- */
/* Same rules as the slides edition (only difference: in-flow here, fixed there) */
.page-footer {
  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; }

/* 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; }
}
.page-footer a { color: #e8e8e8; }

/* ---------- 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; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid--why, .grid--products { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .hero { padding: 72px 0 56px; }
  .hero__title { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .hero__sub { font-size: 1.05rem; }
  .section__head h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
}
@media (max-width: 560px) {
  .section { padding: 48px 0; }
  .hero { padding: 52px 0 44px; }
  .grid--why, .grid--products { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
  .topbar__inner { gap: 10px; }
  .brand__name { font-size: 0.98rem; }
  .hero__title { font-size: 1.75rem; }
  .hero__sub { font-size: 0.98rem; max-width: 100%; }
  .hero__cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; }
  .card { padding: 18px; }
  .card h3 { font-size: 1.05rem; }
  .card p { font-size: 0.93rem; }
  .section__head { margin-bottom: 32px; }
  .section__head p { font-size: 0.97rem; }
  .dx-list li { padding: 14px 16px; }
  .disclaimer { padding: 24px 18px; }
  .badge { font-size: 0.68rem; padding: 2px 7px; }
  .topbar { height: 56px; }
  .topbar__inner { height: 56px; }
  .brand__mark { width: 22px; height: 22px; }
  .page-footer__disclaimer { font-size: 0.7rem; }
  .page-footer__meta { font-size: 0.66rem; }
  .footer__switch { font-size: 0.74rem; }
}
@media (max-width: 400px) {
  .hero { padding: 40px 0 36px; }
  .hero__title { font-size: 1.55rem; }
  .hero__sub { font-size: 0.92rem; }
  .eyebrow { font-size: 0.76rem; }
  .section { padding: 40px 0; }
  .container { padding: 0 14px; }
  .section__head h2 { font-size: 1.4rem; }
  .card { padding: 14px; border-radius: 10px; }
  .card h3 { font-size: 0.98rem; }
  .card p { font-size: 0.88rem; }
  .btn { font-size: 0.9rem; padding: 0.6rem 1.1rem; }
}
