/* R2 Dashboard Website Styles - Bright modern aesthetic inspired by reference */
:root {
  --bg: #fafbff;
  --bg-soft: #ffffff;
  --text: #0b1220;
  --muted: #4b5563;
  --card: #ffffff;
  --border: #e5e7eb;
  --primary: #E87B35; /* new main color */
  --primary-2: #FF9A5C; /* warm lighter orange */
  --accent: #06b6d4; /* cyan */
  --link: #E87B35;
  --shadow: 0 10px 30px rgba(2,6,23,0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(900px 450px at 85% -10%, rgba(232,123,53,0.18), transparent),
    radial-gradient(800px 500px at -10% 90%, rgba(255,183,77,0.16), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.75));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: 0.2px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 0 0 4px rgba(232,123,53,0.12); }
.brand .logo { width: 28px; height: 28px; display: inline-block; }
.nav-links { display: flex; gap: 18px; align-items: center; }
.lang-toggle { border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.btn { display: inline-block; padding: 12px 18px; border-radius: 12px; font-weight: 600; border: 1px solid transparent; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; box-shadow: var(--shadow); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }

/* Ensure sufficient contrast for CTA buttons */
.btn-primary, .btn-primary:visited { color: #ffffff; }
.btn-primary:hover { color: #ffffff; text-decoration: none; }

.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: 46px; line-height: 1.1; margin: 0 0 14px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-art { margin: 28px auto 0; max-width: 1200px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--card); aspect-ratio: 21 / 9; max-height: 420px; }
.hero-art img { width: 100%; height: 100%; display: block; object-fit: cover; }

.badges { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.badge { border: 1px solid var(--border); background: var(--card); color: var(--muted); padding: 6px 10px; border-radius: 999px; font-size: 13px; }

.section { padding: 36px 0; }
.section h2 { font-size: 28px; margin: 0 0 18px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card { background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,0.95));
  border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

footer { border-top: 1px solid var(--border); margin-top: 36px; }
.footer-inner { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px 0; color: var(--muted); }
.footer-links { display: flex; gap: 12px; align-items: center; }

.blog-card { display: flex; flex-direction: column; gap: 8px; }
.blog-card .meta { color: var(--muted); font-size: 13px; }
.blog-card img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--border); }

.prose { color: var(--text); }
.prose h1 { font-size: 36px; margin: 8px 0 10px; }
.prose h2 { font-size: 24px; margin: 22px 0 10px; }
.prose p { margin: 8px 0; color: var(--muted); }
.prose code { background: rgba(2,6,23,0.06); padding: 1px 5px; border-radius: 6px; }
.prose pre { background: #f5f7fb; border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow: auto; }
.prose a { color: var(--link); }

/* Default inline images scale without stretching */
.prose img { display: block; width: 100%; height: auto; margin: 14px 0; }

/* Cropped media wrapper for better composition */
.prose .media { margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; height: clamp(300px, 60vh, 520px); }
.prose .media img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }

.notice { background: linear-gradient(180deg, rgba(232,123,53,0.08), rgba(255,183,77,0.08)); border: 1px solid rgba(232,123,53,0.25); color: #7C2D12; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

.center { text-align: center; }

/* Screenshots gallery */
.screenshots { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 640px) { .screenshots { grid-template-columns: 1fr; } }
.screenshot { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--card); }
.screenshot img { display: block; width: 100%; height: auto; }

/* Blog post hero */
.post-hero { margin: 8px 0 20px; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; height: clamp(260px, 50vh, 420px); }
.post-hero img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }

/* CTA banner on blog articles */
.cta-banner { margin: 28px 0 0; padding: 18px; border: 1px solid rgba(232,123,53,0.25); border-radius: 14px; background: linear-gradient(180deg, rgba(232,123,53,0.06), rgba(255,183,77,0.06)); box-shadow: var(--shadow); }
.cta-banner h3 { margin: 0 0 8px; font-size: 20px; }
.cta-banner p { margin: 6px 0 0; color: var(--muted); }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Lightbox for screenshots */
.screenshot img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox-inner { position: relative; max-width: 95vw; max-height: 90vh; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(2,6,23,0.3); }
.lightbox-close { position: absolute; top: -12px; right: -12px; width: 36px; height: 36px; border: none; border-radius: 999px; background: #ffffff; color: #111827; box-shadow: 0 4px 16px rgba(0,0,0,0.25); cursor: pointer; font-size: 20px; line-height: 36px; display: grid; place-items: center; }

/* Hide bilingual blocks by default; lang.js will reveal the active language */
/* Show content based on html[lang] without JS */
html[lang='en'] [data-lang='zh'] { display: none; }
html[lang='zh'] [data-lang='en'] { display: none; }
