/* ==============================================
   style.css — MyCloudSite
   Cloudflare Pages Starter Template
   ============================================== */

/* ── Design Tokens ──────────────────────────── */
:root {
  /* Brand palette */
  --color-bg:          #09111f;       /* deep navy — page background          */
  --color-surface:     #0f1e35;       /* slightly lighter navy — cards         */
  --color-border:      #1a2f50;       /* subtle border                         */
  --color-accent:      #f6821f;       /* Cloudflare orange — primary accent    */
  --color-accent-glow: rgba(246,130,31,0.18);
  --color-text:        #e8edf3;       /* near-white body text                  */
  --color-muted:       #6b8099;       /* secondary / caption text              */
  --color-code-bg:     #060e1a;       /* terminal / code block background      */
  --color-green:       #3ecf8e;       /* online status green                   */

  /* Typography */
  --font-ui:    'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2.5rem;
  --sp-2xl: 4rem;
  --sp-3xl: 6rem;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-ui);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Focus ring (accessibility) ─────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Reduced motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ══════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════ */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 17, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xl);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  white-space: nowrap;
}
.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--color-text); }

/* Nav CTA pill */
.nav-links .nav-cta {
  padding: var(--sp-xs) var(--sp-md);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-accent);
  font-size: 0.85rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-links .nav-cta:hover {
  background: var(--color-accent-glow);
  border-color: var(--color-accent);
}

/* Hamburger toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-sm);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* Mobile nav open state */
.nav-links.open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-lg) var(--sp-xl);
  gap: var(--sp-md);
}


/* ══════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  gap: var(--sp-3xl);
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-3xl) var(--sp-xl);
  overflow: hidden;
}

/* Subtle dot-grid background texture */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 60% 30%, rgba(246,130,31,0.06) 0%, transparent 60%),
    radial-gradient(#1a2f50 1px, transparent 1px);
  background-size: auto, 30px 30px;
  pointer-events: none;
}

/* Hero text column */
.hero-content {
  position: relative;
  flex: 1;
  min-width: 0;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  border: 1px solid rgba(246,130,31,0.3);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: var(--sp-lg);
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-text);
  margin-bottom: var(--sp-lg);
}
.hero-title-accent {
  background: linear-gradient(100deg, var(--color-accent) 0%, #ffa45c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-muted);
  max-width: 42ch;
  margin-bottom: var(--sp-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}

/* Status badge */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-muted);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.status-dot.online {
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
  animation: pulse-green 2s infinite;
}
.status-dot.error {
  background: #ef4444;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 8px var(--color-green); }
  50%       { box-shadow: 0 0 16px var(--color-green); }
}

/* Terminal card */
.hero-terminal {
  position: relative;
  flex: 0 0 380px;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px var(--color-border);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--color-border);
}
.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #ffbd2e; }
.t-dot.green  { background: #28c840; }
.t-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.terminal-body {
  padding: var(--sp-lg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-x: auto;
}

.t-comment { color: #4a6080; }
.t-cmd     { color: var(--color-accent); }
.t-out     { color: var(--color-green); }
.t-url     { color: #93c5fd; }
.t-blink   {
  color: var(--color-text);
  animation: blink 1s step-start infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}


/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.2s var(--ease);
  text-align: center;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(246,130,31,0.3);
}
.btn-primary:hover {
  background: #ff9435;
  box-shadow: 0 6px 28px rgba(246,130,31,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
}
.btn-sm:hover { background: #ff9435; }


/* ══════════════════════════════════════════════
   SECTION SHARED STYLES
   ══════════════════════════════════════════════ */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-3xl) var(--sp-xl);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-sm);
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--sp-xl);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--color-muted);
  max-width: 60ch;
  margin-bottom: var(--sp-xl);
  line-height: 1.7;
}
.section-desc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  padding: 2px 6px;
  border-radius: 4px;
}


/* ══════════════════════════════════════════════
   FEATURES GRID
   ══════════════════════════════════════════════ */
.features {
  border-top: 1px solid var(--color-border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.feature-card:hover {
  border-color: rgba(246,130,31,0.4);
  transform: translateY(-3px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: var(--sp-md);
  line-height: 1;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--sp-sm);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.65;
}


/* ══════════════════════════════════════════════
   DEPLOY STEPS
   ══════════════════════════════════════════════ */
.deploy {
  border-top: 1px solid var(--color-border);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  max-width: 660px;
}

.step {
  display: flex;
  gap: var(--sp-xl);
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--color-accent-glow);
  border: 1px solid rgba(246,130,31,0.35);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent);
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--sp-xs);
}

.step-body p {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.65;
}
.step-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.step-body strong { color: var(--color-text); font-weight: 600; }
.step-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  padding: 2px 6px;
  border-radius: 4px;
}


/* ══════════════════════════════════════════════
   API DEMO
   ══════════════════════════════════════════════ */
.api-demo {
  border-top: 1px solid var(--color-border);
}

.api-widget {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 680px;
}

.api-widget-header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.api-method {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-green);
  background: rgba(62,207,142,0.12);
  border: 1px solid rgba(62,207,142,0.25);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0.05em;
}

.api-endpoint {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
  flex: 1;
}

.api-response {
  padding: var(--sp-lg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.7;
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
  transition: color 0.3s var(--ease);
}
.api-response.success { color: var(--color-green); }
.api-response.error   { color: #ef4444; }


/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--sp-3xl);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.footer-brand {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
}

.footer-note {
  font-size: 0.8rem;
  color: var(--color-muted);
}
.footer-note a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Nav */
  .nav-inner { padding: 0 var(--sp-lg); }
  .nav-links  { display: none; } /* toggled via JS */
  .nav-toggle { display: flex; }

  /* Hero — stack vertically */
  .hero {
    flex-direction: column;
    min-height: auto;
    padding: var(--sp-2xl) var(--sp-lg);
    gap: var(--sp-xl);
    align-items: flex-start;
  }
  .hero-terminal {
    flex: none;
    width: 100%;
    animation: none; /* disable float on mobile */
  }

  /* Sections */
  .section-inner { padding: var(--sp-2xl) var(--sp-lg); }

  /* Features — single column */
  .features-grid { grid-template-columns: 1fr; }

  /* Steps */
  .step { gap: var(--sp-md); }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
