/*
 * 7Pyramid AI - Main Stylesheet (single source of truth)
 * Dual Theme Support: Dental (Apple-style black + lavender/purple/teal, default), Black/Gold
 * Version: 3.1 — unified: assets/css/styles.min.css is GENERATED from this file; edit here only.
 * Fonts load via <link> in each page's <head> (no @import — it blocks rendering).
 */

/* ============================================
   CSS VARIABLES - THEME SYSTEM
   ============================================ */

:root {
  /* Theme 1: Dental (Apple-style black + lavender/purple/teal) — Default */
  --primary: #d3bbff;          /* lavender accent: links, eyebrows, nav */
  --primary-variant: #c2a3ff;  /* lavender hover */
  --primary-deep: #6d28d9;     /* deep purple: button / fill backgrounds */
  --secondary: #6bd8cb;        /* teal */
  --secondary-variant: #29a195;
  --accent: #ffba46;           /* amber */
  --background: #000000;
  --bg-soft: #0a0a0a;
  --surface: #1c1c1e;          /* cards */
  --surface-variant: #2c2c2e;  /* elevated tiles */
  --bg-tile: #1d1d1f;
  --error: #CF6679;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-disabled: #8e8e94;    /* ≥4.5:1 on --background and --surface */
  --text-placeholder: #9a9aa0; /* ≥4.5:1 on --surface-variant */
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.5);

  /* Theme-specific gradients */
  --gradient-primary: linear-gradient(135deg, #6d28d9 0%, #3f008d 100%);   /* deep purple — solid fills (buttons, icons) */
  --gradient-accent: linear-gradient(135deg, #d3bbff 0%, #6bd8cb 100%);    /* lavender → teal — gradient text/stats */
  --gradient-heading: linear-gradient(180deg, #ffffff 0%, #b8b8c0 100%);   /* white → grey — hero headings */
  --gradient-overlay: radial-gradient(circle at 50% 0%, rgba(109, 40, 217, 0.18) 0%, transparent 60%);

  /* Theme-aware shadow tokens */
  --shadow-primary: rgba(109, 40, 217, 0.35);
  --shadow-primary-hover: rgba(109, 40, 217, 0.5);
  --focus-ring: rgba(211, 187, 255, 0.25);
  --selected-bg: rgba(211, 187, 255, 0.1);
  --card-hover-border: rgba(211, 187, 255, 0.3);
  --text-on-primary: #ffffff;

  /* Shape tokens (dental) */
  --radius-pill: 980px;
  --radius-card: 18px;
  --radius-tile: 28px;
}

[data-theme="black-gold"] {
  /* Theme 2: Black/Elegant Gold (Light Champagne Gold) */
  --primary: #F1E5B1;
  --primary-variant: #E6D89E;
  --secondary: #D4AF37;
  --secondary-variant: #C19A3C;
  --background: #000000;
  --surface: #0A0A0A;
  --surface-variant: #1A1A1A;
  --error: #FF6B6B;
  --text-primary: #F5F5F5;
  --text-secondary: #C0C0C0;
  --text-disabled: #8C8C8C;
  --border: #2A2A2A;
  --border-soft: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.7);
  --bg-soft: #050505;
  --bg-tile: #111111;
  --accent: #D4AF37;
  --primary-deep: #8a6d1a;

  /* Theme-specific gradients */
  --gradient-primary: linear-gradient(135deg, #F1E5B1 0%, #D4AF37 100%);
  --gradient-accent: linear-gradient(135deg, #F1E5B1 0%, #D4AF37 100%);
  --gradient-heading: linear-gradient(180deg, #ffffff 0%, #cfcfcf 100%);
  --gradient-overlay: linear-gradient(135deg, rgba(241, 229, 177, 0.08) 0%, rgba(212, 175, 55, 0.08) 100%);

  /* Theme-aware shadow tokens */
  --shadow-primary: rgba(241, 229, 177, 0.3);
  --shadow-primary-hover: rgba(241, 229, 177, 0.4);
  --focus-ring: rgba(241, 229, 177, 0.25);
  --selected-bg: rgba(241, 229, 177, 0.1);
  --card-hover-border: rgba(241, 229, 177, 0.3);
  --text-on-primary: #121212;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  background-color: var(--background);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fluid media safety net: classed images may override */
img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1, h2, h3 {
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

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

a:hover {
  color: var(--primary-variant);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-large {
  padding: 6rem 0;
}

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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-gap-lg {
  gap: 3rem;
}

.grid-align-center {
  align-items: center;
}

.flex {
  display: flex;
  gap: 1rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--gradient-accent);
  box-shadow: 0 0 12px var(--shadow-primary);
  z-index: 1100;
  pointer-events: none;
  will-change: transform;
}

.header {
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── OKF standard notice (under nav) ── */
.okf-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8125rem;
}
.okf-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.125rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  text-align: center;
}
.okf-bar-icon { color: var(--primary); font-size: 0.75rem; line-height: 1; }
.okf-bar-text strong { color: var(--text-primary); font-weight: 600; }
.okf-bar-link { color: var(--primary); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.25rem; }
.okf-bar-link:hover { color: var(--primary-variant); text-decoration: underline; }
@media (max-width: 480px) {
  .okf-bar { font-size: 0.75rem; }
  .okf-bar-inner { padding: 0.125rem 1rem; gap: 0.35rem; }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo-img {
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.logo-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.125rem;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-accent);
}

/* Theme Switcher */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-variant);
  padding: 0.25rem;
  border-radius: 26px;
  border: 1px solid var(--border);
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 1rem;
  min-height: 44px;
  border-radius: 22px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.theme-btn.active {
  background: var(--primary);
  color: var(--background);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  background: var(--background);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  z-index: 1;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.07;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 140px;
  min-height: 44px;
  text-align: center;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  box-shadow: 0 4px 12px var(--shadow-primary);
}

.btn-primary:hover {
  color: var(--text-on-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-primary-hover);
  text-decoration: none;
}

.btn-primary:visited,
.btn-primary:focus,
.btn-primary:active {
  color: var(--text-on-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--background);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.05s;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px var(--shadow);
  border-color: var(--card-hover-border);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-label-required::after {
  content: ' *';
  color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-input::placeholder,
.form-select::placeholder,
.form-textarea::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-input.error + .form-error,
.form-select.error + .form-error,
.form-textarea.error + .form-error {
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-section p,
.footer-section a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-block;
  padding: 0.5rem 0;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary);
}

.text-gradient {
  color: var(--primary);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.text-secondary {
  color: var(--text-secondary);
}

.text-disabled {
  color: var(--text-disabled);
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ============================================
   SECTION VARIANTS
   ============================================ */

.section-surface {
  background: var(--surface);
}

/* ============================================
   HOMEPAGE SECTIONS
   (services ledger, FAQ accordion, about
   manifesto, contact band)
   ============================================ */

/* Section intro: heading + one-line stance, asymmetric */
.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem 3rem;
  align-items: end;
  margin-bottom: 3.5rem;
}

.section-intro h2 {
  margin-bottom: 0;
}

.section-intro p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 52ch;
}

/* Services: editorial ledger rows — type carries the weight */
.service-ledger {
  border-top: 1px solid var(--border);
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.75rem 3rem;
  align-items: baseline;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

.service-name {
  font-size: clamp(1.6rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  transition: color 0.25s ease;
}

.service-row:hover .service-name {
  color: var(--primary);
}

.service-desc {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 46ch;
}

/* FAQ accordion (reuses .faq-item / .faq-question / .faq-answer) */
.faq-list h3 {
  margin: 0;
}

/* About: manifesto statement + facts */
.about-lead {
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.about-body {
  max-width: 60ch;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem 3rem;
  margin-top: 3rem;
}

.about-facts > div {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.about-facts dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.about-facts dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* Contact: asymmetric band — pitch left, details right */
.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem 5rem;
  align-items: start;
  text-align: left;
}

.contact-band h2 {
  margin-bottom: 1rem;
}

.contact-pitch p {
  max-width: 44ch;
  margin-bottom: 2rem;
}

.contact-details {
  margin: 0;
}

.contact-details > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.contact-details > div:last-child {
  border-bottom: 1px solid var(--border);
}

.contact-details dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding-top: 0.2rem;
}

.contact-details dd {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.7;
}

@media (max-width: 767px) {
  .section-intro {
    grid-template-columns: 1fr;
    align-items: start;
    margin-bottom: 2.5rem;
  }

  .service-row {
    grid-template-columns: 1fr;
    padding: 2rem 0;
  }

  .contact-band {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ============================================
   404 PAGE
   ============================================ */

.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--primary);
  margin-bottom: 1rem;
}

.error-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.error-message {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.error-links {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

/* ============================================
   INLINE FORM MESSAGES
   ============================================ */

.form-success {
  background: rgba(107, 216, 203, 0.1);
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 1.25rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.form-global-error {
  background: rgba(207, 102, 121, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 1.25rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* ============================================
   BLOG
   ============================================ */

.blog-hero {
  padding: 7rem 0 4rem;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  margin-bottom: 1rem;
}

.blog-hero p {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.125rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0;
}

@media (max-width: 1023px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px var(--shadow);
  border-color: var(--primary);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--surface-variant);
}

.post-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.post-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--gradient-overlay);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-disabled);
}

.post-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.post-read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.375rem;
  text-decoration: none;
}

.post-read-more::after {
  content: '\2192';
  transition: transform 0.2s;
}

.post-card:hover .post-read-more::after {
  transform: translateX(4px);
}

/* Featured post */
.post-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

.post-card-featured > a {
  width: 42%;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  border-radius: 16px 0 0 16px;
}

.post-card-featured .post-card-image,
.post-card-featured .post-card-image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.post-card-featured .post-card-body {
  flex: 1;
  min-width: 0;
}

.post-card-featured .post-card-title {
  font-size: 1.5rem;
}

@media (max-width: 768px) {
  .post-card-featured {
    flex-direction: column;
  }
  .post-card-featured > a {
    width: 100%;
    border-radius: 16px 16px 0 0;
  }
  .post-card-featured .post-card-image,
  .post-card-featured .post-card-image-placeholder {
    height: 220px;
    min-height: unset;
  }
}

/* Blog newsletter CTA */
.blog-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  margin: 3rem 0;
}

.blog-cta h2 {
  margin-bottom: 0.75rem;
}

.blog-cta p {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

/* ============================================
   BLOG POST (article pages) — shared styles
   (formerly duplicated per-post in inline <style> blocks)
   ============================================ */

.post-header { padding: 7rem 0 3rem; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); }
.post-breadcrumb { font-size: 0.85rem; color: var(--text-disabled); margin-bottom: 1.5rem; }
.post-breadcrumb a { color: var(--primary); text-decoration: none; }
.post-breadcrumb a:hover { text-decoration: underline; }
.post-category-badge { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; padding: 0.3rem 1rem; border-radius: 999px; background: var(--gradient-overlay); border: 1px solid var(--primary); color: var(--primary); margin-bottom: 1.25rem; }
.post-header h1 { max-width: 920px; margin: 0 auto 1.25rem; font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.35; }
.post-meta { display: flex; justify-content: center; align-items: center; gap: 1.5rem; flex-wrap: wrap; color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 2rem; }
.post-meta-item { display: flex; align-items: center; gap: 0.375rem; }
.post-hero-image { display: block; width: calc(100% - 3rem); max-width: 720px; height: auto; margin: 2rem auto 0; object-fit: contain; border-radius: 16px; }
.post-layout { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; padding: 3rem 0; }
@media (max-width: 1023px) { .post-layout { grid-template-columns: 1fr; } }
.post-body { max-width: 760px; }
.post-body h2 { font-size: 1.6rem; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--text-primary); line-height: 1.4; }
.post-body p, .post-body li { color: var(--text-secondary); line-height: 1.9; }
.post-body p { margin-bottom: 1.25rem; text-wrap: pretty; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body a { color: var(--primary); text-decoration: underline; }
.post-body strong { color: var(--text-primary); }

.callout { border-radius: 12px; padding: 1.25rem 1.5rem; margin: 1.75rem 0; display: flex; gap: 1rem; align-items: flex-start; background: var(--selected-bg); border: 1px solid var(--card-hover-border); }
.callout-icon { font-size: 1.5rem; flex-shrink: 0; display: flex; align-items: center; }
.callout-icon .material-symbols-outlined { font-size: 24px; color: var(--primary); }
.callout-body h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.375rem; color: var(--primary); }
.callout-body p { font-size: 0.92rem; margin: 0; line-height: 1.7; color: var(--text-secondary); }

.check-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; background: var(--surface); border-radius: 12px; overflow: hidden; }
.check-table th, .check-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.check-table th { background: var(--surface-variant); color: var(--text-primary); font-weight: 600; }
.check-table td:first-child { color: var(--text-primary); }
.check-table tr:last-child td { border-bottom: none; }

.post-faq { margin-top: 3rem; }
.post-faq h2 { margin-bottom: 1.5rem; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.75rem; overflow: hidden; }
.faq-question { width: 100%; background: var(--surface); border: none; padding: 1.25rem 1.5rem; text-align: left; font-size: 1rem; font-weight: 500; color: var(--text-primary); cursor: pointer; font-family: inherit; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-question::after { content: '+'; font-size: 1.25rem; color: var(--primary); transition: transform 0.2s; }
.faq-question[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 1.5rem 1.25rem; color: var(--text-secondary); line-height: 1.8; background: var(--surface); }
.faq-answer.open { display: block; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-tag { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.8rem; padding: 0 0.875rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; }
.post-tag:hover { border-color: var(--primary); color: var(--primary); }

.post-sidebar { position: sticky; top: 90px; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; }
.sidebar-card h3 { font-size: 1rem; margin-bottom: 1rem; }
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 0; }
.toc-list a { display: flex; align-items: center; min-height: 44px; font-size: 0.875rem; color: var(--text-secondary); text-decoration: none; }
.toc-list a:hover { color: var(--primary); }

.post-cta { background: var(--gradient-overlay); border: 1px solid var(--primary); border-radius: 16px; padding: 2rem; text-align: center; margin-top: 3rem; }
.post-cta h3 { margin-bottom: 0.75rem; }
.post-cta p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* ============================================
   VIDEO EMBED (YouTube facade)
   ============================================ */

.video-container { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 100%; overflow: hidden; border-radius: 16px; box-shadow: 0 10px 30px var(--shadow); border: 1px solid var(--border); container-type: inline-size; }
@supports not (aspect-ratio: 16 / 9) { .video-container { padding-bottom: 56.25%; height: 0; } }
.video-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.youtube-facade { position: absolute; inset: 0; cursor: pointer; background-color: #000; }
.youtube-facade picture, .youtube-facade img { width: 100%; height: 100%; }
.youtube-facade img { object-fit: cover; display: block; }
.youtube-facade .play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: clamp(54px, 10cqi, 68px); height: clamp(38px, 7cqi, 48px); background: red; border-radius: clamp(10px, 2cqi, 14px); display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease, background 0.2s ease; }
.youtube-facade:hover .play-btn { transform: translate(-50%, -50%) scale(1.1); background: #c00; }
.youtube-facade .play-btn::after { content: ''; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; margin-left: 4px; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.fade-in-delay-1 {
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.fade-in-delay-2 {
  animation: fadeIn 0.6s ease-out 0.4s both;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet: 600px - 1023px */
@media (max-width: 1023px) {
  .section {
    padding: 3rem 0;
  }

  .section-large {
    padding: 4rem 0;
  }

  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 0 - 599px */
@media (max-width: 599px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .section-large {
    padding: 3rem 0;
  }

  /* Mobile Navigation */
  .mobile-menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 16px var(--shadow);
  }

  .nav.active {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .theme-switcher {
    width: 100%;
    margin-top: 1rem;
  }

  /* Hero: CSS-only on mobile (image not downloaded; gradient overlay carries the mood) */
  .hero {
    min-height: 500px;
    padding: 4rem 1rem;
  }

  .hero-image {
    display: none;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  /* Grid */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
  .container {
    padding: 0 2rem;
  }

  .section-large {
    padding: 8rem 0;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--background);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 10000;
}

.skip-to-main:focus {
  top: 0;
}

/* Keyboard focus indicators */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border: #FFFFFF;
  }

  .card,
  .pricing-card {
    border-width: 2px;
  }
}

/* Print styles */
@media print {
  #scroll-progress,
  .header,
  .okf-bar,
  .footer,
  .btn,
  .theme-switcher,
  .mobile-menu-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
