/* Flipper Cyber theme
 * A dark, terminal-inspired palette built around the Flipper Zero orange.
 * Phosphor cyan/green accents echo the device's monochrome display.
 */

:root {
  /* Brand */
  --fl-orange: #FF8200;
  --fl-orange-hot: #FFA040;
  --fl-orange-deep: #CC5A00;

  /* Surface */
  --fl-bg: #0A0A0F;
  --fl-bg-card: #15151E;
  --fl-bg-elev: #1F1F2A;
  --fl-border: #2A2A38;

  /* Type */
  --fl-text: #E8E8F0;
  --fl-text-mute: #8B8B9A;
  --fl-text-dim: #5A5A6E;

  /* Phosphor accents */
  --fl-cyan: #00E5FF;
  --fl-green: #00FF85;
  --fl-pink: #FF3366;

  /* Type stacks */
  --fl-font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --fl-font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --fl-font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --fl-radius: 8px;
  --fl-shadow-glow: 0 0 40px rgba(255, 130, 0, 0.15);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fl-font-body);
  background: var(--fl-bg);
  color: var(--fl-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scanline overlay — pure CSS, no asset */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 130, 0, 0.015) 0px,
    rgba(255, 130, 0, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

/* Subtle grid background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 130, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 130, 0, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 2; }

a { color: var(--fl-orange); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--fl-orange-hot); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--fl-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { color: var(--fl-text-mute); }

code, pre, .mono {
  font-family: var(--fl-font-mono);
}

code {
  background: var(--fl-bg-elev);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--fl-orange-hot);
  border: 1px solid var(--fl-border);
}

pre {
  background: var(--fl-bg-card);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  position: relative;
}

pre::before {
  content: '$';
  color: var(--fl-green);
  position: absolute;
  left: 0.6rem;
  top: 1.25rem;
  font-family: var(--fl-font-mono);
  opacity: 0.5;
}

pre code {
  background: none;
  border: none;
  color: var(--fl-text);
  padding: 0;
  padding-left: 1rem;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
  border-bottom: 1px solid var(--fl-border);
}

/* Nav */
nav.topbar {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fl-border);
  z-index: 100;
}

nav.topbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

nav.topbar .brand {
  font-family: var(--fl-font-display);
  font-weight: 700;
  color: var(--fl-text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

nav.topbar .brand .dot {
  width: 10px;
  height: 10px;
  background: var(--fl-orange);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--fl-orange);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

nav.topbar ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

nav.topbar a {
  color: var(--fl-text-mute);
  font-size: 0.95rem;
  font-weight: 500;
}

nav.topbar a:hover { color: var(--fl-text); }

nav.topbar .cta {
  background: var(--fl-orange);
  color: var(--fl-bg) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--fl-radius);
  font-weight: 600;
}

nav.topbar .cta:hover {
  background: var(--fl-orange-hot);
}

/* Hero */
.hero {
  padding: 8rem 0 6rem;
  text-align: left;
  position: relative;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
}

.hero .eyebrow {
  font-family: var(--fl-font-mono);
  color: var(--fl-orange);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.hero .eyebrow::before {
  content: '◢';
  color: var(--fl-cyan);
}

.hero h1 {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--fl-text) 0%, var(--fl-orange-hot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .lede {
  font-size: 1.2rem;
  max-width: 540px;
  margin-bottom: 2.5rem;
  color: var(--fl-text);
}

.hero .ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--fl-radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-family: var(--fl-font-body);
  cursor: pointer;
}

.btn-primary {
  background: var(--fl-orange);
  color: var(--fl-bg);
}

.btn-primary:hover {
  background: var(--fl-orange-hot);
  color: var(--fl-bg);
  transform: translateY(-1px);
  box-shadow: var(--fl-shadow-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--fl-text);
  border-color: var(--fl-border);
}

.btn-secondary:hover {
  border-color: var(--fl-orange);
  color: var(--fl-orange);
}

/* Hero terminal mock */
.terminal {
  background: var(--fl-bg-card);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), var(--fl-shadow-glow);
}

.terminal .bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--fl-bg-elev);
  border-bottom: 1px solid var(--fl-border);
}

.terminal .bar .led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fl-border);
}

.terminal .bar .led.r { background: #FF5F56; }
.terminal .bar .led.y { background: #FFBD2E; }
.terminal .bar .led.g { background: #27C93F; }

.terminal .bar .title {
  font-family: var(--fl-font-mono);
  font-size: 0.8rem;
  color: var(--fl-text-mute);
  margin-left: auto;
}

.terminal .body {
  padding: 1.5rem;
  font-family: var(--fl-font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  min-height: 280px;
}

.terminal .body .prompt { color: var(--fl-green); }
.terminal .body .cmd { color: var(--fl-text); }
.terminal .body .out { color: var(--fl-text-mute); }
.terminal .body .ok { color: var(--fl-green); }
.terminal .body .warn { color: var(--fl-orange-hot); }
.terminal .body .info { color: var(--fl-cyan); }
.terminal .body .dim { color: var(--fl-text-dim); }
.terminal .body .cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--fl-orange);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature {
  background: var(--fl-bg-card);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 1.75rem;
  transition: all 0.2s;
}

.feature:hover {
  border-color: var(--fl-orange);
  transform: translateY(-2px);
  box-shadow: var(--fl-shadow-glow);
}

.feature .icon {
  font-family: var(--fl-font-mono);
  color: var(--fl-orange);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature h3 {
  color: var(--fl-text);
}

.feature p {
  font-size: 0.95rem;
}

/* Stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
  text-align: center;
}

.stat .number {
  font-family: var(--fl-font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--fl-orange);
  line-height: 1;
}

.stat .label {
  font-family: var(--fl-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fl-text-mute);
  margin-top: 0.5rem;
}

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Diagram container */
.diagram {
  background: var(--fl-bg-card);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diagram svg { max-width: 100%; height: auto; }

/* Code group */
.code-block {
  margin-top: 1.5rem;
}

.code-block .title {
  font-family: var(--fl-font-mono);
  font-size: 0.8rem;
  color: var(--fl-text-mute);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

/* Footer */
footer {
  padding: 4rem 0 3rem;
  background: var(--fl-bg-card);
  border-top: 1px solid var(--fl-border);
  margin-top: 0;
}

footer .inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 700px) {
  footer .inner { grid-template-columns: 1fr 1fr; }
}

footer h4 {
  font-family: var(--fl-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fl-text-mute);
  margin-bottom: 1rem;
}

footer ul { list-style: none; }
footer li { margin-bottom: 0.5rem; }
footer a { color: var(--fl-text-mute); font-size: 0.95rem; }
footer a:hover { color: var(--fl-orange); }

footer .credit {
  border-top: 1px solid var(--fl-border);
  margin-top: 3rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fl-text-dim);
  font-family: var(--fl-font-mono);
}

/* Tag pills */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tag {
  font-family: var(--fl-font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: var(--fl-bg-elev);
  color: var(--fl-text-mute);
  border: 1px solid var(--fl-border);
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.tag.brand { color: var(--fl-orange); border-color: var(--fl-orange); }
.tag.cyan { color: var(--fl-cyan); border-color: rgba(0, 229, 255, 0.3); }
.tag.green { color: var(--fl-green); border-color: rgba(0, 255, 133, 0.3); }
