/* ==========================================================================
   Fieldnote Members - Design System (UI-Salon & Award-Grade Editorial Spec)
   Typography: Plus Jakarta Sans (Headings & Display) & Inter (Body & Reading)
   Color Palette: Deep Ink Navy, Entitlement Emerald, Amber Grace, Ruby Danger
   ========================================================================== */

:root {
  /* --- 1. Harmonized Deep Ink Brand Palette --- */
  --color-primary: hsl(222, 47%, 18%);         /* #18253e */
  --color-primary-light: hsl(222, 47%, 26%);   /* #23365a */
  --color-primary-dark: hsl(222, 47%, 10%);    /* #0d1421 */

  /* --- 2. Precision Entitlement Emerald (WCAG AAA High Contrast) --- */
  --color-accent-entitled: hsl(156, 72%, 30%);        /* 5.85:1 contrast */
  --color-accent-entitled-light: hsl(156, 72%, 42%);  /* Hover state */
  --color-accent-entitled-bg: hsl(156, 60%, 96%);     /* Luminous surface tint */
  --color-accent-entitled-border: hsl(156, 50%, 80%); /* Soft boundary */
  --color-accent-glow: rgba(16, 185, 129, 0.22);

  /* --- 3. Accessible Grace Amber & Danger Ruby --- */
  --color-warning-grace: hsl(38, 92%, 28%);           /* WCAG AAA compliant */
  --color-warning-grace-bg: hsl(38, 100%, 96%);
  --color-warning-grace-border: hsl(38, 70%, 78%);

  --color-danger: hsl(354, 70%, 45%);                 /* WCAG AAA compliant */
  --color-danger-bg: hsl(354, 100%, 97%);
  --color-danger-border: hsl(354, 60%, 82%);

  /* --- 4. Calibrated Canvas Surfaces --- */
  --bg-page: hsl(210, 25%, 98%);                      /* Slate canvas snow */
  --bg-card: hsl(0, 0%, 100%);                        /* Pure white card surface */
  --bg-muted: hsl(210, 20%, 95%);
  --bg-hover: hsl(210, 20%, 92%);

  --text-main: hsl(222, 47%, 11%);                    /* Deep Charcoal Ink */
  --text-muted: hsl(215, 20%, 38%);                   /* Upgraded 6.8:1 contrast on white */
  --text-light: hsl(215, 16%, 50%);                   /* 4.5:1 AA contrast */
  --text-inverse: hsl(0, 0%, 100%);

  --border-light: rgba(203, 213, 225, 0.7);           /* Softened sub-pixel borders */
  --border-strong: rgba(148, 163, 184, 0.6);
  --border-color: var(--border-light);

  /* --- 5. Typography --- */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* --- 6. Multi-Layered Optical Shadows (Elena Master Stack) --- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03), 0 10px 15px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.03), 0 20px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04), 0 32px 48px -12px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  --touch-target-min: 44px;
}

/* ==========================================================================
   Reset & Base Typography Scale (Julian & Maya)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Optical Tracking Scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, .h1 {
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
}

h2, .h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.028em;
  margin-bottom: 0.65rem;
}

h3, .h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

h4, .h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Tabular Numerals for Numerical & Financial Data */
.metric-value,
.pricing-amount,
.data-table td,
.tabular-nums {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ==========================================================================
   Navigation Header (Frosted Glass & Balanced Geometry)
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary);
  letter-spacing: -0.03em;
}

.brand-badge {
  background: var(--bg-muted);
  color: var(--color-primary);
  border: 1px solid var(--border-strong);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  background: var(--bg-muted);
}

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

/* Hamburger & Mobile Drawer (GPU Accelerated & 100dvh) */
.btn-hamburger {
  display: none;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.btn-hamburger:hover {
  background: var(--bg-muted);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transform: translateX(100%);
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
}

.drawer-backdrop.open {
  display: block;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
}

#btn-close-drawer {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: none;
  font-size: 1.25rem;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

#btn-close-drawer:hover {
  background: var(--bg-hover);
}

/* ==========================================================================
   Buttons & Interactive Primitives (Tactile Physics)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: var(--touch-target-min);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

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

.btn-primary:hover {
  background: var(--color-primary-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  min-height: 36px;
}

/* Luminous Hero Action Button (Liam & Elena) */
.btn-hero-cta {
  background: var(--color-accent-entitled);
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-hero-cta:hover {
  background: var(--color-accent-entitled-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-hero-cta:active {
  transform: translateY(1px) scale(0.985);
}

/* Demo Quick-Fill Pill Chips */
.demo-fill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 38px;
}

.demo-fill-btn:hover {
  background: #fff;
  border-color: var(--color-accent-entitled);
  color: var(--color-accent-entitled);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.demo-fill-btn:active, .demo-fill-btn.is-active {
  background: var(--color-accent-entitled-bg);
  border-color: var(--color-accent-entitled);
  color: var(--color-accent-entitled);
  transform: translateY(0) scale(0.97);
}

/* ==========================================================================
   Cards & Layout Components
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Status Badges */
.badge,
.hero-category,
.category-overline,
.metric-label,
.data-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-entitled, .badge-active, .badge-succeeded {
  background: var(--color-accent-entitled-bg);
  color: var(--color-accent-entitled);
  border: 1px solid var(--color-accent-entitled-border);
}

.badge-grace, .badge-past_due {
  background: var(--color-warning-grace-bg);
  color: var(--color-warning-grace);
  border: 1px solid var(--color-warning-grace-border);
}

.badge-canceled, .badge-expired, .badge-failed {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-locked {
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Member Home & Dominant Hero Dispatch
   ========================================================================== */
.member-hero-card {
  background: 
    radial-gradient(ellipse at 85% 15%, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0) 50%),
    linear-gradient(135deg, hsl(222, 47%, 18%) 0%, hsl(222, 47%, 9%) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.member-hero-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: hsl(215, 20%, 82%);
}

.hero-category-tag {
  background: rgba(16, 185, 129, 0.15);
  color: hsl(156, 72%, 65%);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hero-title {
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 900px;
}

.hero-excerpt {
  color: hsl(215, 20%, 88%);
  font-size: 1.125rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 65ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.article-card-body {
  margin-bottom: 1.5rem;
}

.article-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.article-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.article-card-excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 50ch;
}

/* ==========================================================================
   Pricing & Plans Comparison Table
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.25rem 2rem;
}

.pricing-card.featured {
  border: 1px solid var(--color-accent-entitled-border);
  box-shadow: 0 0 0 2px var(--color-accent-entitled), var(--shadow-xl);
  transform: scale(1.02);
  z-index: 2;
}

.pricing-badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent-entitled);
  color: #fff;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.pricing-amount {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text-main);
  margin: 1.25rem 0;
  display: flex;
  align-items: baseline;
}

.pricing-currency-symbol {
  font-size: 0.55em;
  font-weight: 700;
  vertical-align: super;
  margin-right: 0.15rem;
  color: var(--text-muted);
}

.pricing-interval {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-left: 0.35rem;
}

.benefits-list {
  list-style: none;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

.benefit-icon {
  color: var(--color-accent-entitled);
  font-weight: bold;
  flex-shrink: 0;
}

/* ==========================================================================
   Operator Workspaces (Structured Action Card & Tables)
   ========================================================================== */
.action-queue-banner, .action-queue-card {
  background: linear-gradient(180deg, hsl(38, 100%, 98%) 0%, hsl(38, 100%, 95%) 100%);
  border: 1px solid var(--color-warning-grace-border);
  border-left: 4px solid hsl(38, 92%, 45%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-warning-grace);
  font-weight: 700;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.25rem;
}

.metric-label {
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* Tables & Data Lists with Horizontal Scroll Affordance */
.table-container {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  background: 
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0;
  background-repeat: no-repeat;
  background-color: var(--bg-card);
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-muted);
  padding: 0.85rem 1.25rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-muted);
}

/* ==========================================================================
   Modals & Longform Editorial Reader (Julian & Siddharth)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(15, 23, 42, 0.08);
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-dialog.modal-large {
  max-width: 860px;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  background: var(--bg-muted);
  border: none;
  font-size: 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Longform Reading Typography Measure */
.article-reader-container {
  max-width: 70ch;
  margin: 0 auto;
}

.article-prose {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--text-main);
  border-top: 1px solid var(--border-light);
  padding-top: 1.75rem;
  margin-top: 1.5rem;
}

.article-prose p {
  margin-bottom: 1.4em;
  text-wrap: pretty;
}

.article-prose h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 2.25rem 0 0.85rem;
  color: var(--color-primary-dark);
}

.article-prose blockquote {
  border-left: 3px solid var(--color-accent-entitled);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ==========================================================================
   Forms & Dedicated Auth Layout
   ========================================================================== */
.auth-page-container {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  padding: 2.5rem 2rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.9rem;
}

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

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  min-height: 42px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* ==========================================================================
   Responsive Viewports & Mobile Fluidity (Siddharth)
   ========================================================================== */
@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .btn-hamburger {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1.5rem 1rem 3rem;
  }

  .header-container {
    padding: 0.75rem 1rem;
  }

  .member-hero-card {
    padding: 1.75rem 1.25rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .metrics-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

/* Mobile Bottom-Sheet Modal (<640px) */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog {
    max-width: 100% !important;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 1.25rem 2rem 1.25rem;
    margin: 0;
    transform: translateY(100%);
  }

  .modal-backdrop.open .modal-dialog {
    transform: translateY(0);
  }

  .modal-dialog::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: var(--radius-full);
    margin: -0.5rem auto 1.25rem;
  }

  .modal-close-btn {
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 374px) {
  .brand-logo span:not(.brand-badge) {
    font-size: 1rem;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1.5rem 1rem;
  }
}
