/* Modern CSS with Flexbox Layout - Inspired by Zed.dev */

:root {
  /* Colors */
  --color-background: #0d0e0f;
  --color-surface: #1a1d20;
  --color-surface-elevated: #2a2e32;
  --color-border: #3a3f44;
  --color-border-focus: #5a6570;

  --color-text-primary: #f4f4f5;
  --color-text-secondary: #a1a8b0;
  --color-text-tertiary: #6b737d;

  --color-accent: #0ea5e9;
  --color-accent-hover: #0284c7;
  --color-success: #10b981;
  --color-success-hover: #059669;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  --gradient-surface: linear-gradient(135deg, #1a1d20 0%, #2a2e32 100%);

  /* Typography */
  --font-mono: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: var(--font-sans);
  background: var(--color-background);
  color: var(--color-text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.875rem;
  margin-bottom: var(--space-md);
}

h4 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  text-align: center;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover:not(.btn) {
  color: var(--color-accent-hover);
}

/* Fix button link hover colors */
.btn a:hover,
a.btn:hover {
  color: white;
}

.btn-secondary a:hover,
a.btn-secondary:hover {
  color: var(--color-text-primary);
}

/* Main Layout - Flexbox Container */
.main-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Dotted background pattern */
.has-dotted-background {
  background-image: linear-gradient(
      to bottom,
      var(--color-background),
      transparent
    ),
    url("./dotted-background.png");
  background-position: center top;
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, auto;
  position: relative;
}

.has-dotted-background::after {
  content: "";
  position: absolute;
  top: calc(50% + 2px);
  bottom: 0;
  left: 0;
  right: 0;
  background-image: linear-gradient(
    to bottom,
    transparent,
    var(--color-background)
  );
  z-index: 1;
}

.has-dotted-background .hero-content {
  position: relative;
  z-index: 2;
}

/* Hero Section - Flexbox Layout */
.hero-section {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-md);
}

.hero-content {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
}

/* Stats Highlight - Block Element with Flexbox */
.stats-highlight {
  width: 100%;
  background: var(--gradient-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.stats-highlight h4 {
  color: var(--color-text-primary);
  margin: 0;
}

.stats-highlight p {
  color: var(--color-text-secondary);
  margin: 0;
}

/* Pricing Info - Block Element with Flexbox */
.pricing-info {
  width: 100%;
  max-width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pricing-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

/* Logo Stripe - Inline Flex */
.logo-stripe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-stripe img {
  height: 30px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.logo-stripe:hover img {
  opacity: 1;
}

/* Section Layout - Flexbox */
.section {
  width: 100%;
  padding: var(--space-3xl) var(--space-md);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-content {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

/* Buttons - Flexbox */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
  border-color: var(--color-border-focus);
}

/* Form Demo - Flexbox Layout */
.form-demo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-group {
  width: 100%;
  max-width: 600px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease;
  display: flex;
  align-items: stretch;
}

.input-group:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-group input {
  flex: 1;
  padding: var(--space-lg);
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 1rem;
  outline: none;
}

.input-group input::placeholder {
  color: var(--color-text-tertiary);
}

.input-group button {
  padding: var(--space-lg) var(--space-xl);
  border: none;
  background: var(--color-accent);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-group button:hover {
  background: var(--color-accent-hover);
}

/* Field - Form field container */
.field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.field label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  padding: var(--space-md) var(--space-lg);
}

.field input {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-primary);
  font-size: 1rem;
  outline: none;

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field label + input {
  margin-top: calc(var(--space-sm) * -1);
}

.field input::placeholder {
  color: var(--color-text-tertiary);
}

/* Notifications - Flexbox */
.notification {
  width: 100%;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 0.85rem;
}

.notification--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.notification--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.notification--info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.notification::before {
  content: "";
  width: 4px;
  height: 100%;
  border-radius: 2px;
  flex-shrink: 0;
}

.notification--success::before {
  background: var(--color-success);
}

.notification--error::before {
  background: var(--color-error);
}

.notification--info::before {
  background: #60a5fa;
}

.notification p {
  margin: 0;
  width: 100%;

  + p {
    margin-top: var(--space-sm);
  }
}

/* Code blocks - Enhanced with syntax highlighting */
.code-block {
  width: 100%;
  max-width: 100%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: var(--space-md) 0;
}

.code-block__header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-block__content {
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  color: var(--color-text-primary);
}

/* Shell/Bash syntax highlighting */
.code-block--shell .code-block__header {
  color: #10b981;
}

.code-block--shell .code-block__content {
  color: #a1a8b0;
}

.code-block--shell .shell-method {
  color: #3b82f6;
  font-weight: 600;
}

.code-block--shell .shell-url {
  color: #10b981;
}

.code-block--shell .shell-param {
  color: #f59e0b;
}

/* JSON syntax highlighting */
.code-block--json .code-block__header {
  color: #8b5cf6;
}

.code-block--json .code-block__content {
  color: #a1a8b0;
}

.code-block--json .json-key {
  color: #3b82f6;
}

.code-block--json .json-string {
  color: #10b981;
}

.code-block--json .json-value {
  color: #f59e0b;
}

.code-block--json .json-brace {
  color: #6b737d;
  font-weight: 600;
}

/* Legacy pre tag fallback */
pre {
  width: 100%;
  max-width: 100%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  color: var(--color-text-primary);
  text-align: left;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* How it works section - Flexbox */
.demo,
.how-it-works {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.how-it-works h3 {
  margin: 0;
}

.how-it-works p {
  margin: 0;
}

/* Footer - Flexbox */
footer {
  width: 100%;
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) var(--space-md);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

footer p {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  margin: 0;
  text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .hero-section {
    padding: var(--space-2xl) var(--space-md);
  }

  .input-group {
    flex-direction: column;
  }

  .input-group button {
    border-top: 1px solid var(--color-border);
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .section {
    padding: var(--space-xl) var(--space-md);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .hero-section {
    padding: var(--space-xl) var(--space-md);
  }

  .stats-highlight,
  .pricing-info {
    padding: var(--space-lg);
  }
}

/* Animation utilities */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Focus styles for accessibility */
.btn:focus,
.input-group:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

hgroup {
  margin-bottom: var(--space-lg);

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    margin: 0;
  }
}
