/* PatternsFlow Academy — Self-hosted Stylesheet (Dark-First Technical Bento) */

:root {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.85);
  --bg-footer: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-terminal: #0f172a;
  --bg-terminal-bar: #020617;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0284c7;
  --accent-bright: #0ea5e9;
  --accent-hover: #38bdf8;
  --accent-text: #0284c7;
  --emerald: #059669;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.35);
  --sky-bg: rgba(14, 165, 233, 0.12);
  --sky-border: rgba(14, 165, 233, 0.35);
  --amber: #d97706;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --purple: #7c3aed;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-terminal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html.dark {
  --bg: #090d16;
  --bg-elevated: #111827;
  --bg-header: rgba(9, 13, 22, 0.85);
  --bg-footer: #070a11;
  --bg-subtle: rgba(30, 41, 59, 0.85);
  --bg-input: #0f172a;
  --bg-terminal: #0f172a;
  --bg-terminal-bar: rgba(2, 6, 23, 0.8);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(30, 41, 59, 0.9);
  --border-strong: #334155;
  --accent: #0ea5e9;
  --accent-bright: #38bdf8;
  --accent-hover: #38bdf8;
  --accent-text: #38bdf8;
  --emerald: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);
  --sky-bg: rgba(14, 165, 233, 0.12);
  --sky-border: rgba(14, 165, 233, 0.35);
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --purple: #c084fc;
  --purple-bg: rgba(168, 85, 247, 0.12);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-terminal: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--bg-subtle);
  color: var(--text);
}

::selection {
  background: rgba(14, 165, 233, 0.3);
  color: #e0f2fe;
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: var(--accent-bright);
  color: #020617;
  font-weight: 600;
  font-size: 0.875rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.container-md {
  max-width: 64rem;
}

.container-sm {
  max-width: 56rem;
}

.container-prose {
  max-width: 48rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-accent {
  color: var(--accent-bright);
}

.status-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: #34d399;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-desktop a {
  transition: color 0.15s ease;
}

.nav-desktop a:hover {
  color: var(--accent-text);
}

.nav-desktop a[aria-current="page"],
.nav-mobile a[aria-current="page"] {
  color: var(--accent-text);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--sky-border);
  color: var(--accent-text);
}

.theme-toggle .icon-sun {
  display: none;
  color: #fbbf24;
}

.theme-toggle .icon-moon {
  display: block;
}

html.dark .theme-toggle .icon-sun {
  display: block;
}

html.dark .theme-toggle .icon-moon {
  display: none;
}

.nav-cta {
  display: none;
}

.nav-mobile {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .nav-cta {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
  .nav-mobile {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-sm {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.btn-primary {
  background: #0ea5e9;
  color: #020617;
  box-shadow: 0 8px 20px -6px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  background: #38bdf8;
}

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

.btn-secondary:hover {
  border-color: var(--accent-bright);
  color: var(--accent-text);
}

.btn-dark {
  background: #0f172a;
  color: #ffffff;
}

html.dark .btn-dark {
  background: #1e293b;
}

.btn-dark:hover {
  background: #0ea5e9;
  color: #020617;
}

.btn-outline-sky {
  background: transparent;
  border-color: #0ea5e9;
  color: var(--accent-text);
}

.btn-outline-sky:hover {
  background: #0ea5e9;
  color: #020617;
}

.btn-full {
  width: 100%;
}

/* Icons */
.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: inline-block;
}

.icon-md {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Badges & Eyebrows */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--emerald-border);
  background: var(--emerald-bg);
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.pill-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  margin-bottom: 0.5rem;
}

.eyebrow-emerald {
  color: var(--emerald);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.badge-sky {
  background: var(--sky-bg);
  color: var(--accent-text);
}

.badge-emerald {
  background: var(--emerald-bg);
  color: var(--emerald);
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple);
}

/* Hero Section */
.hero {
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 7fr 5fr;
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.hero-title {
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 40rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.text-emerald { color: var(--emerald); }
.text-sky { color: var(--accent-text); }
.text-amber { color: var(--amber); }
.text-purple { color: var(--purple); }
.text-muted { color: var(--text-muted); }

/* Terminal Card */
.terminal-card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-terminal);
  color: #e2e8f0;
  box-shadow: var(--shadow-terminal);
  overflow: hidden;
}

.terminal-bar {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  background: var(--bg-terminal-bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

.dot-red { background: rgba(244, 63, 94, 0.85); }
.dot-amber { background: rgba(245, 158, 11, 0.85); }
.dot-green { background: rgba(16, 185, 129, 0.85); }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
}

.terminal-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-x: auto;
}

.terminal-body pre {
  font-family: inherit;
  white-space: pre;
  margin: 0;
}

.t-comment { color: #94a3b8; }
.t-prompt { color: #34d399; }
.t-out { color: #7dd3fc; }
.t-dim { color: #cbd5e1; }

.terminal-footer {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #34d399;
}

.terminal-footer a {
  text-decoration: underline;
}

.terminal-footer a:hover {
  color: #38bdf8;
}

/* Sections & Grids */
.section {
  padding-block: 4rem;
}

.section-bottom {
  padding-bottom: 6rem;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .section-header-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.page-title {
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-lead {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.7;
}

.link-accent {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-text);
}

.link-accent:hover {
  text-decoration: underline;
}

/* Cards & Bento Grid */
.bento-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .span-7 { grid-column: span 7; }
  .span-5 { grid-column: span 5; }
}

.grid-2 {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-booking {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .grid-booking {
    grid-template-columns: 5fr 7fr;
  }
}

.card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.card-hover:hover {
  border-color: var(--sky-border);
}

.card-featured {
  border-color: rgba(14, 165, 233, 0.55);
}

.card-flex {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.icon-box {
  display: inline-flex;
  padding: 0.625rem;
  border-radius: 0.75rem;
}

.icon-box-sky { background: var(--sky-bg); color: var(--accent-text); }
.icon-box-emerald { background: var(--emerald-bg); color: var(--emerald); }
.icon-box-amber { background: var(--amber-bg); color: var(--amber); }
.icon-box-purple { background: var(--purple-bg); color: var(--purple); }

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.price {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.check-list .icon {
  margin-top: 0.2rem;
  color: var(--emerald);
}

/* Custom Hourly / Banner Card */
.banner-card {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .banner-card {
    flex-direction: row;
    align-items: center;
  }
}

/* Labs Code Block */
.lab-stack {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.lab-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.code-block {
  border-radius: 0.75rem;
  background: #020617;
  border: 1px solid #1e293b;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.75);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.code-block pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.callout {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--sky-bg);
  border: 1px solid var(--sky-border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.cta-box {
  border-radius: 1rem;
  border: 1px solid var(--sky-border);
  background: var(--sky-bg);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Info Cards & Forms */
.info-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.info-card h2 {
  font-size: 0.875rem;
  font-weight: 700;
}

.info-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.cal-banner {
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px dashed var(--sky-border);
  background: var(--sky-bg);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 0.2rem;
  accent-color: #0ea5e9;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.form-status {
  font-size: 0.8125rem;
  color: var(--emerald);
  min-height: 1.25rem;
}

/* Legal / Prose Pages */
.prose {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.prose h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.125rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.prose a {
  color: var(--accent-text);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-footer);
  padding-block: 2.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

.footer-brand {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent-text);
}
