/* ==========================================================================
   EASY THEME SWITCHER
   To change the entire site palette, either:
   1. Edit the 5 hex swatches (--swatch-1 through --swatch-5, darkest to lightest), OR
   2. Change <html data-theme="slate"> in index.html to "navy", "charcoal", or "forest"
   ========================================================================== */
:root,
[data-theme="slate"] {
  --swatch-1: #2C3E50; /* Deepest base */
  --swatch-2: #34495E; /* Card & elevated surface */
  --swatch-3: #5D6D7E; /* Primary interactive / buttons */
  --swatch-4: #85929E; /* Muted text / secondary accents */
  --swatch-5: #AAB7B8; /* Highlights / borders / badges */
}

[data-theme="navy"] {
  --swatch-1: #0B192C;
  --swatch-2: #1E3E62;
  --swatch-3: #2E5A88;
  --swatch-4: #6888A8;
  --swatch-5: #A8C0D8;
}

[data-theme="charcoal"] {
  --swatch-1: #1F2428;
  --swatch-2: #2D333B;
  --swatch-3: #484F58;
  --swatch-4: #8B949E;
  --swatch-5: #C9D1D9;
}

[data-theme="forest"] {
  --swatch-1: #1E2F2B;
  --swatch-2: #2C423D;
  --swatch-3: #4A6B63;
  --swatch-4: #7E9C94;
  --swatch-5: #B2C7C1;
}

:root {
  /* All UI tokens automatically compute from --swatch-1 .. --swatch-5 */
  --bg-deep: color-mix(in srgb, var(--swatch-1) 72%, #000000);
  --bg-navy: var(--swatch-1);
  --bg-card: color-mix(in srgb, var(--swatch-1) 80%, transparent);
  --bg-card-hover: color-mix(in srgb, var(--swatch-2) 90%, transparent);
  --bg-card-elevated: color-mix(in srgb, var(--swatch-2) 85%, transparent);
  --bg-glass-subtle: color-mix(in srgb, var(--swatch-3) 26%, transparent);

  --blue-900: color-mix(in srgb, var(--swatch-1) 85%, #000000);
  --blue-800: var(--swatch-1);
  --blue-700: var(--swatch-2);
  --blue-600: color-mix(in srgb, var(--swatch-2) 50%, var(--swatch-3));
  --blue-500: var(--swatch-3);
  --blue-400: color-mix(in srgb, var(--swatch-3) 50%, var(--swatch-4));
  --blue-300: var(--swatch-4);
  --blue-200: var(--swatch-5);
  --blue-100: color-mix(in srgb, var(--swatch-5) 65%, #ffffff);
  --cyan-400: var(--swatch-4);
  --cyan-300: var(--swatch-5);

  --text-primary: color-mix(in srgb, var(--swatch-5) 18%, #ffffff);
  --text-secondary: color-mix(in srgb, var(--swatch-5) 62%, #ffffff);
  --text-muted: var(--swatch-4);

  --border-subtle: color-mix(in srgb, var(--swatch-5) 20%, transparent);
  --border-bright: color-mix(in srgb, var(--swatch-5) 38%, transparent);
  --border-glow: color-mix(in srgb, var(--swatch-5) 55%, transparent);

  --btn-gradient: linear-gradient(135deg, var(--swatch-3) 0%, var(--swatch-2) 100%);
  --card-gradient: linear-gradient(
    180deg,
    color-mix(in srgb, var(--swatch-2) 86%, transparent) 0%,
    color-mix(in srgb, var(--swatch-1) 93%, transparent) 100%
  );

  --shadow-card: 0 18px 40px -14px rgba(10, 15, 22, 0.72), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 10px 28px -6px color-mix(in srgb, var(--bg-deep) 75%, transparent);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 0%, var(--swatch-2) 0%, var(--swatch-1) 52%, var(--bg-deep) 100%);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.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;
}

/* ==========================================
   AMBIENT SLATE BACKGROUND
   ========================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.42;
}

.orb-1 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, var(--swatch-3) 0%, transparent 70%);
  top: -90px;
  left: 50%;
  transform: translateX(-60%);
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--swatch-4) 0%, transparent 70%);
  top: 36%;
  right: -120px;
  opacity: 0.25;
}

.orb-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--swatch-2) 0%, transparent 70%);
  bottom: 5%;
  left: -130px;
  opacity: 0.35;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(170, 183, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(170, 183, 184, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.75) 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.75) 20%, transparent 80%);
}

/* ==========================================
   STICKY MINI TOPBAR (SCROLL)
   ========================================== */
.sticky-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 10px 16px;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}

.sticky-topbar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card-hover);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 32px rgba(15, 22, 30, 0.75);
}

.mini-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--blue-200);
}

.mini-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mini-name {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-handle {
  font-size: 0.7rem;
  color: var(--cyan-300);
}

.mini-ama-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--btn-gradient);
  color: #fff;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 38, 49, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mini-ama-btn:active {
  transform: scale(0.96);
}

/* ==========================================
   MAIN MOBILE CONTAINER
   ========================================== */
.bio-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px calc(98px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-promoted {
  animation: sectionPromoteIn 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sectionPromoteIn {
  0% {
    opacity: 0.35;
    transform: translateY(10px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   HERO PROFILE CARD & AMA (COMPACT)
   ========================================== */
.hero-card {
  position: relative;
  background: var(--card-gradient);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -70px;
  left: 30%;
  transform: translateX(-50%);
  width: 220px;
  height: 130px;
  background: radial-gradient(circle, var(--border-subtle) 0%, transparent 70%);
  pointer-events: none;
}

.hero-profile-row {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
}

.avatar-ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}

.avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--swatch-5) 0%, var(--swatch-4) 50%, var(--swatch-3) 100%);
  box-shadow: 0 6px 18px rgba(27, 38, 49, 0.5);
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background-color: var(--blue-900);
  border: 2px solid var(--bg-navy);
}

.verified-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--swatch-4), var(--swatch-3));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-navy);
  box-shadow: 0 2px 6px rgba(27, 38, 49, 0.55);
}

.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hero-name-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.15;
}

.hero-handle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan-300);
}

.hero-bio {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.42;
}

.hero-bio strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Ask Me Anything Feature Box */
.ama-feature-box {
  text-align: left;
  background: linear-gradient(145deg, var(--bg-glass-subtle), var(--bg-card));
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 20px -8px rgba(20, 30, 40, 0.45);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ama-feature-box.open {
  border-color: var(--swatch-5);
  box-shadow: 0 12px 28px -6px rgba(20, 30, 40, 0.65);
}

.ama-cta-button {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}

.ama-cta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ama-icon-bubble {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--swatch-4) 0%, var(--swatch-3) 100%);
  border: 1px solid var(--border-bright);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(27, 38, 49, 0.45);
}

.ama-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ama-cta-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.2;
}

.ama-cta-sub {
  font-size: 0.72rem;
  color: var(--blue-200);
  line-height: 1.25;
}

.ama-chevron {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(133, 146, 158, 0.22);
  color: var(--cyan-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.2s ease;
}

.ama-feature-box.open .ama-chevron {
  transform: rotate(180deg);
  background: rgba(170, 183, 184, 0.3);
}

.ama-drawer {
  padding: 2px 16px 16px;
  border-top: 1px solid rgba(170, 183, 184, 0.18);
  animation: slideDown 0.24s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ama-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 12px;
}

.ama-prompt-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.ama-prompt-chips::-webkit-scrollbar {
  display: none;
}

.topic-chip {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: rgba(8, 22, 48, 0.65);
  color: var(--blue-200);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topic-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.45));
  border-color: var(--cyan-400);
  color: #ffffff;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: rgba(27, 38, 49, 0.78);
  border: 1px solid rgba(170, 183, 184, 0.28);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.86rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #AAB7B8;
  box-shadow: 0 0 0 3px rgba(170, 183, 184, 0.18);
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 390px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

.ama-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--btn-gradient);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(20, 30, 40, 0.6);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.ama-submit-btn:hover {
  filter: brightness(1.07);
}

.ama-submit-btn:active {
  transform: scale(0.98);
}

.ama-submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ama-form-status {
  font-size: 0.78rem;
  text-align: center;
  min-height: 1.1em;
  color: var(--cyan-300);
}

.ama-form-status.success {
  color: #6ee7b7;
  font-weight: 600;
}

.ama-form-status.error {
  color: #fca5a5;
}

.form-confirm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 12px 16px 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: color-mix(in srgb, var(--swatch-1) 55%, transparent);
}

.form-confirm[hidden],
.ama-form[hidden] {
  display: none !important;
}

.form-confirm-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.form-confirm-copy {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.form-confirm-again {
  margin-top: 6px;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--blue-200);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.form-confirm-again:hover {
  color: #ffffff;
}

/* ==========================================
   SECTION HEADERS
   ========================================== */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4px;
}

.section-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-header-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-200);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(93, 109, 126, 0.26);
  border: 1px solid rgba(170, 183, 184, 0.26);
  transition: all 0.18s ease;
}

.section-header-link:hover {
  background: rgba(93, 109, 126, 0.45);
  color: #ffffff;
}

/* ==========================================
   SECTION 1: COURSES (2-PER-ROW COMPACT GRID)
   ========================================== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
  box-shadow: 0 18px 36px -14px rgba(20, 30, 40, 0.55);
}

.course-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: var(--blue-900);
}

.course-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-card:hover .course-thumb {
  transform: scale(1.04);
}

.course-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.course-meta-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cyan-300);
}

.course-title {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.25;
}

.course-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.38;
}

.course-cta-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(170, 183, 184, 0.16);
}

.course-cta-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cyan-300);
}

.course-arrow {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(93, 109, 126, 0.35);
  border: 1px solid rgba(170, 183, 184, 0.35);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.course-card:hover .course-arrow {
  transform: translate(2px, -2px);
  background: var(--blue-500);
}

/* See All Courses Button */
.see-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--btn-gradient);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px -8px rgba(20, 30, 40, 0.45);
  transition: all 0.2s ease;
}

.see-all-btn:hover {
  filter: brightness(1.08);
  border-color: var(--swatch-5);
  transform: translateY(-1px);
}

.see-all-btn:active {
  transform: scale(0.99);
}

/* ==========================================
   SECTION 2: SUBSTACK ARTICLE PREVIEW
   ========================================== */
.substack-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.substack-card:hover {
  transform: translateY(-2px);
  border-color: var(--swatch-5);
}

.substack-card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.substack-pub-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.substack-cover {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(170, 183, 184, 0.35);
  background: var(--blue-900);
}

.substack-pub-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.substack-pub-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan-300);
}

.substack-pub-author {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.substack-headline {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.substack-Dek {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.read-article-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--btn-gradient);
  border: 1px solid var(--border-bright);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(20, 30, 40, 0.45);
}

.read-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================
   SECTION 3: DISCOUNTS (KENETIK — COMPACT)
   ========================================== */
.discount-card {
  position: relative;
  background: var(--card-gradient);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.discount-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--border-subtle) 0%, transparent 70%);
  pointer-events: none;
}

.discount-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kinetik-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.kinetik-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--swatch-4) 0%, var(--swatch-3) 100%);
  border: 1px solid var(--border-bright);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(20, 30, 40, 0.45);
}

.kinetik-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kinetik-name {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
  line-height: 1.15;
}

.discount-badge {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(133, 146, 158, 0.25);
  border: 1px solid rgba(170, 183, 184, 0.5);
  color: var(--cyan-300);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.kinetik-tagline {
  font-size: 0.72rem;
  color: var(--blue-200);
  margin-top: 1px;
  line-height: 1.25;
}

.discount-description {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.38;
}

.discount-bottom-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
  gap: 8px;
}

.coupon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(27, 38, 49, 0.72);
  border: 1.5px dashed rgba(170, 183, 184, 0.48);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 11px;
}

.coupon-code-area {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.coupon-label {
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.coupon-code {
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cyan-300);
  font-variant-numeric: tabular-nums;
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(170, 183, 184, 0.38);
  background: rgba(93, 109, 126, 0.35);
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.copy-code-btn:hover {
  background: var(--blue-500);
  border-color: var(--cyan-300);
}

.copy-code-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #a7f3d0;
}

.shop-kinetik-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--btn-gradient);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 18px -6px rgba(20, 30, 40, 0.55);
  transition: filter 0.18s ease, transform 0.15s ease;
  white-space: nowrap;
}

.shop-kinetik-btn:hover {
  filter: brightness(1.07);
}

.shop-kinetik-btn:active {
  transform: scale(0.99);
}

/* ==========================================
   SECTION 4: YOUTUBE CAROUSEL
   ========================================== */
.carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(44, 62, 80, 0.8);
  color: var(--blue-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.carousel-nav-btn:hover {
  background: rgba(93, 109, 126, 0.55);
  border-color: var(--cyan-300);
  color: #ffffff;
}

.carousel-nav-btn:active {
  transform: scale(0.93);
}

.video-carousel-viewport {
  width: 100%;
  overflow: hidden;
  margin: 0 -4px;
  padding: 0 4px;
}

.video-carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.video-carousel-track::-webkit-scrollbar {
  display: none;
}

.video-slide {
  flex: 0 0 88%;
  max-width: 88%;
  scroll-snap-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s ease, transform 0.22s ease;
}

.video-slide.is-active {
  border-color: var(--border-bright);
}

.video-player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #1b2631;
  overflow: hidden;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-slide:hover .video-thumb {
  transform: scale(1.04);
}

.video-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 38, 49, 0.35) 0%, rgba(27, 38, 49, 0.15) 45%, rgba(27, 38, 49, 0.82) 100%);
  pointer-events: none;
}

.video-tag {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(44, 62, 80, 0.88);
  border: 1px solid rgba(170, 183, 184, 0.4);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--cyan-300);
  backdrop-filter: blur(6px);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.08) 55%,
    rgba(255, 255, 255, 0.2) 100%
  );
  backdrop-filter: blur(18px) saturate(185%) brightness(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(185%) brightness(1.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(8, 13, 20, 0.48),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.75),
    inset 0 -2px 6px rgba(255, 255, 255, 0.18),
    inset 0 0 14px rgba(255, 255, 255, 0.1);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, background 0.22s ease;
  overflow: hidden;
}

.video-play-btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 14%;
  right: 14%;
  height: 42%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.video-play-btn svg {
  margin-left: 3px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.14) 55%,
    rgba(255, 255, 255, 0.26) 100%
  );
  box-shadow:
    0 16px 36px rgba(8, 13, 20, 0.58),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.85),
    inset 0 -2px 8px rgba(255, 255, 255, 0.24),
    inset 0 0 18px rgba(255, 255, 255, 0.16);
}

.video-player-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-info {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.video-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan-400);
}

.video-number {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.video-title {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.32;
}

.video-caption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.48;
  margin-bottom: 4px;
}

.video-ext-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-200);
  padding-top: 8px;
  border-top: 1px solid rgba(170, 183, 184, 0.16);
  transition: color 0.15s ease;
}

.video-ext-link:hover {
  color: #ffffff;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(170, 183, 184, 0.28);
  cursor: pointer;
  transition: all 0.25s ease;
}

.carousel-dot.active {
  width: 26px;
  background: linear-gradient(90deg, #AAB7B8, #5D6D7E);
  box-shadow: 0 0 10px rgba(170, 183, 184, 0.4);
}

/* ==========================================
   ANIMATED BLUE SAFARI TYPEWRITER
   ========================================== */
.typewriter-showcase {
  padding: 2px 0 4px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.safari-typewriter {
  position: relative;
  width: 100%;
  max-width: 376px;
  margin: 0 auto;
  /* Compact top space for paper + side space for lever & knob */
  padding: 58px 16px 0 18px;
  user-select: none;
  filter: drop-shadow(0 14px 24px rgba(2, 8, 23, 0.8));
}

/* Carriage Assembly (Paper) */
.tw-carriage-assembly {
  position: absolute;
  top: 0;
  left: 18px;
  right: 16px;
  height: 98px;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.11s cubic-bezier(0.22, 1, 0.36, 1);
}

.tw-carriage-assembly.returning {
  transition: transform 0.55s cubic-bezier(0.25, 1, 0.35, 1);
}

/* Chrome Carriage Return Lever on Left (anchored to housing) */
.tw-return-lever {
  position: absolute;
  top: 4px;
  left: -16px;
  width: 24px;
  height: 38px;
  z-index: 4;
  transform-origin: top right;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.safari-typewriter.carriage-return .tw-return-lever {
  transform: rotate(22deg) translateX(3px);
}

.lever-arm {
  position: absolute;
  top: 5px;
  right: 0;
  width: 17px;
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e2e8f0, #64748b);
  transform: rotate(-28deg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.lever-paddle {
  position: absolute;
  top: 10px;
  left: 0;
  width: 9px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 60%, #475569 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform: rotate(16deg);
  box-shadow: 0 4px 8px rgba(2, 8, 23, 0.6);
}

/* Right Platen Roller Knob (anchored flush to housing side — grayscale) */
.tw-platen-knob {
  position: absolute;
  top: 22px;
  right: -13px;
  width: 12px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(
    180deg,
    #f3f4f6 0px,
    #f3f4f6 2px,
    #9ca3af 2px,
    #9ca3af 4px
  );
  border: 1px solid #6b7280;
  border-left: 2px solid #4b5563;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.6);
}

/* Paper Sheet Feeding Up From Roller — Compact height, natural archival paper */
.tw-paper-stage {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(170px, 64%, 224px);
  height: 74px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.tw-paper {
  width: 100%;
  height: 72px;
  background: linear-gradient(180deg, #fcfcfd 0%, #f1f3f5 70%, #dcdfe4 100%);
  border: 1.5px solid #cbd0d6;
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  padding: 7px 10px 12px;
  box-shadow:
    0 -6px 18px rgba(0, 0, 0, 0.35),
    0 3px 10px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  position: relative;
  transform-origin: bottom center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tw-paper.paper-bump {
  transform: translateY(-2px);
}

.tw-paper.paper-feed-reset {
  transform: translateY(8px);
}

.tw-paper-line {
  font-family: 'Special Elite', 'Courier New', Courier, monospace;
  font-size: clamp(0.95rem, 3.8vw, 1.16rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #111827;
  min-height: 1.25em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.tw-typed-text {
  white-space: pre;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.tw-paper-subline {
  font-family: var(--font-sans);
  font-size: clamp(0.56rem, 2.2vw, 0.66rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #4b5563;
  opacity: 0.9;
  text-align: center;
  white-space: nowrap;
  z-index: 2;
}

.tw-char {
  display: inline-block;
  animation: inkStamp 0.09s ease-out;
}

@keyframes inkStamp {
  0% {
    opacity: 0.25;
    transform: scale(1.18) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tw-caret {
  display: inline-block;
  width: 2.5px;
  height: 1.05em;
  background: #374151;
  margin-left: 2px;
  vertical-align: middle;
  animation: caretBlink 0.75s infinite;
}

.tw-paper-rule {
  height: 2px;
  width: 88%;
  margin: 0 auto;
  border-radius: 2px;
  background: rgba(107, 114, 128, 0.22);
}

.tw-paper-rule.short {
  width: 62%;
  margin-left: 14px;
  background: rgba(107, 114, 128, 0.16);
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Upper Brushed Gunmetal / Slate Metallic Body */
.tw-upper-housing {
  position: relative;
  z-index: 3;
  background: linear-gradient(180deg, #4b525c 0%, #323740 48%, #21252c 100%);
  border: 1.5px solid #6b7280;
  border-bottom: 2px solid #14171c;
  border-radius: 18px 18px 5px 5px;
  padding: 7px 12px 8px;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.28),
    inset 0 -6px 14px rgba(0, 0, 0, 0.65);
}

/* Top bar with blank margin buttons and scale slider */
.tw-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.tw-magic-margin {
  width: 32px;
  height: 13px;
  background: linear-gradient(180deg, #f3f4f6 0%, #cfd4dc 100%);
  border: 1px solid #9ca3af;
  border-radius: 4px;
  box-shadow: 0 2px 0 #1f242b, 0 3px 5px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.tw-margin-scale {
  position: relative;
  flex: 1;
  height: 10px;
  background: rgba(15, 17, 21, 0.78);
  border-radius: 4px;
  border: 1px solid rgba(156, 163, 175, 0.32);
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
}

.tw-margin-ticks {
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(209, 213, 219, 0.72) 0px,
    rgba(209, 213, 219, 0.72) 1px,
    transparent 1px,
    transparent 5px
  );
}

.tw-margin-slider {
  position: absolute;
  top: 1px;
  left: 55%;
  width: 22px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f9fafb 0%, #9ca3af 100%);
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: left 0.14s ease;
}

/* Platen Roller Slot & Clear Plastic Alignment Wings */
.tw-roller-well {
  position: relative;
  height: 26px;
  background: #0b0d10;
  border-radius: 6px;
  border: 1px solid rgba(156, 163, 175, 0.3);
  margin-bottom: 6px;
  overflow: hidden;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.9);
}

.tw-metal-bail {
  position: absolute;
  top: 3px;
  left: 8px;
  right: 8px;
  height: 2.5px;
  background: linear-gradient(90deg, #9ca3af, #f9fafb 50%, #6b7280);
  border-radius: 2px;
  z-index: 3;
}

.tw-platen-roller {
  position: absolute;
  top: 5px;
  left: 10px;
  right: 10px;
  height: 17px;
  border-radius: 4px;
  background: linear-gradient(180deg, #272b33 0%, #16191e 55%, #090a0d 100%);
  border-top: 1px solid rgba(156, 163, 175, 0.28);
  overflow: hidden;
}

.tw-roller-paper-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(64%, 210px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.72) 0%, rgba(156, 163, 175, 0.32) 65%, transparent 100%);
  border-left: 1px solid rgba(209, 213, 219, 0.4);
  border-right: 1px solid rgba(209, 213, 219, 0.4);
  transition: transform 0.11s cubic-bezier(0.22, 1, 0.36, 1);
}

.tw-clear-guides {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 5px;
  z-index: 4;
}

.tw-guide-wing {
  width: clamp(42px, 15vw, 62px);
  height: 11px;
  background: linear-gradient(180deg, rgba(229, 231, 235, 0.28), rgba(156, 163, 175, 0.12));
  border: 1px solid rgba(209, 213, 219, 0.42);
  border-radius: 3px 3px 0 0;
  backdrop-filter: blur(2px);
}

.tw-type-guide-center {
  width: 12px;
  height: 14px;
  border: 1.5px solid #cbd5e1;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  background: rgba(209, 213, 219, 0.18);
  transition: background 0.06s ease, box-shadow 0.06s ease, transform 0.06s ease;
}

.tw-type-guide-center.strike {
  background: #f3f4f6;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.75);
  transform: scale(1.06);
}

.tw-ribbon-strip {
  position: absolute;
  bottom: 0;
  left: 18%;
  right: 18%;
  height: 2.5px;
  background: linear-gradient(90deg, #1f2937, #6b7280, #1f2937);
  transition: transform 0.06s ease;
}

.tw-ribbon-strip.lift {
  transform: translateY(-2px);
}

/* Iconic Safari V-Cut Hood + Crisp SVG Typebar Basket */
.tw-hood-deck {
  position: relative;
  height: 46px;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
  background: #090b0e;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.tw-hood-panel {
  background: linear-gradient(165deg, #525965 0%, #343942 55%, #1f2329 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25);
  position: relative;
}

.tw-hood-left {
  clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);
  border-right: 2px solid #9ca3af;
}

.tw-hood-right {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 32% 100%);
  border-left: 2px solid #9ca3af;
}

.tw-typebasket-v {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 95%, #23272f 0%, #090b0e 85%);
}

.tw-basket-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tw-hammer-group {
  opacity: 0;
  transform-origin: 100px 84px;
  transform: scaleY(0.35);
  transition: opacity 0.05s ease-out, transform 0.06s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.55));
}

.tw-hammer-group.striking {
  opacity: 1;
  transform: scaleY(1);
}

/* Lower Brushed Silver / Platinum Keyboard Bezel */
.tw-lower-bezel {
  position: relative;
  z-index: 3;
  margin-top: -3px;
  background: linear-gradient(180deg, #e5e7eb 0%, #cfd4dc 52%, #adb4bf 100%);
  border: 1.5px solid #f3f4f6;
  border-top: 2px solid #f9fafb;
  border-radius: 7px 7px 22px 22px;
  padding: 8px 18px 10px;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.85),
    inset 0 -6px 12px rgba(31, 41, 55, 0.28),
    0 7px 0 #262b33;
}

/* Side Switches (Touch Control & Twin Pak) */
.tw-side-switch {
  position: absolute;
  top: 26px;
  width: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.tw-switch-left {
  left: 1px;
}

.tw-switch-right {
  right: 1px;
}

.tw-switch-label {
  font-size: 0.23rem;
  font-weight: 800;
  line-height: 1.02;
  text-align: center;
  color: #374151;
  letter-spacing: 0.01em;
}

.tw-switch-slot {
  width: 5px;
  height: 18px;
  background: #1f242b;
  border-radius: 3px;
  padding: 2px 1px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.tw-switch-nub {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: #9ca3af;
}

/* Recessed Matte Obsidian Keybed Well */
.tw-keyboard-well {
  width: 100%;
  background: linear-gradient(180deg, #0d0f12 0%, #181b20 100%);
  border-radius: 12px;
  padding: 6px 5px 7px;
  border: 1.5px solid #2d323b;
  box-shadow: inset 0 5px 12px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 3.5px;
  overflow: hidden;
}

.tw-key-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.75vw, 3.5px);
  width: 100%;
}

.tw-key {
  flex: 0 1 20px;
  width: clamp(15px, 5vw, 20px);
  height: clamp(14px, 4.3vw, 17px);
  min-width: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e5e7eb 65%, #c4c9d2 100%);
  border: 1px solid #d1d5db;
  color: #181b20;
  font-size: clamp(0.4rem, 1.45vw, 0.5rem);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 0 #262b33,
    0 3px 4px rgba(0, 0, 0, 0.7);
  transition: transform 0.06s ease, background 0.06s ease, box-shadow 0.06s ease;
}

.tw-key-fn {
  flex: 0 1 23px;
  width: clamp(17px, 5.6vw, 23px);
  height: clamp(14px, 4.3vw, 17px);
  font-size: clamp(0.26rem, 0.98vw, 0.33rem);
  letter-spacing: -0.02em;
  border-radius: 5px;
}

.tw-key-shift {
  flex: 0 1 28px;
  width: clamp(20px, 6.6vw, 28px);
  height: clamp(14px, 4.3vw, 17px);
  border-radius: 6px;
  font-size: clamp(0.28rem, 1.05vw, 0.35rem);
}

.tw-key.pressed {
  transform: translateY(2px) scale(0.95);
  background: linear-gradient(135deg, #6b7280, #374151);
  color: #ffffff;
  border-color: #9ca3af;
  box-shadow:
    0 0 0 #1f242b,
    0 0 8px rgba(209, 213, 219, 0.5);
}

.tw-row-space {
  margin-top: 1px;
}

.tw-spacebar {
  width: 54%;
  height: clamp(11px, 3.2vw, 13px);
  border-radius: 5px;
  background: linear-gradient(180deg, #ffffff 0%, #e5e7eb 65%, #c4c9d2 100%);
  border: 1px solid #d1d5db;
  box-shadow:
    0 2px 0 #262b33,
    0 3px 5px rgba(0, 0, 0, 0.7);
  transition: transform 0.06s ease, background 0.06s ease, box-shadow 0.06s ease;
}

.tw-spacebar.pressed {
  transform: translateY(2px);
  background: linear-gradient(135deg, #6b7280, #374151);
  border-color: #9ca3af;
  box-shadow: 0 0 8px rgba(209, 213, 219, 0.5);
}

/* ==========================================
   FOOTER & TOAST
   ========================================== */
.bio-footer {
  text-align: center;
  padding: 16px 12px 6px;
  border-top: 1px solid rgba(170, 183, 184, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.footer-copy {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-legal-links a {
  color: var(--blue-200);
  transition: color 0.18s ease;
}

.footer-legal-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-sep {
  opacity: 0.5;
}

/* ==========================================
   STICKY NATIVE-APP BOTTOM TAB BAR
   ========================================== */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 8px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.bottom-tab-inner {
  position: relative;
  pointer-events: auto;
  max-width: 452px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 26px;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--swatch-2) 38%, rgba(255, 255, 255, 0.16)) 0%,
    color-mix(in srgb, var(--bg-deep) 46%, rgba(255, 255, 255, 0.05)) 100%
  );
  backdrop-filter: blur(28px) saturate(190%) brightness(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(190%) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 20px 44px rgba(6, 10, 16, 0.62),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    inset 0 -1.5px 3px rgba(255, 255, 255, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.bottom-tab-item {
  position: relative;
  border: none;
  background: transparent;
  border-radius: 19px;
  padding: 10px 6px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, background 0.2s ease, transform 0.14s ease, box-shadow 0.2s ease;
}

.bottom-tab-item:hover {
  color: #ffffff;
}

.bottom-tab-item:active {
  transform: scale(0.94);
}

.bottom-tab-item.active {
  color: #ffffff;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.26) 0%,
    rgba(255, 255, 255, 0.07) 58%,
    rgba(255, 255, 255, 0.16) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.36),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.58),
    inset 0 -2px 5px rgba(255, 255, 255, 0.12),
    0 8px 20px -4px rgba(6, 10, 16, 0.42);
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-tab-item.active .tab-icon {
  transform: translateY(-1px) scale(1.06);
  color: #ffffff;
  filter: drop-shadow(0 1px 6px rgba(255, 255, 255, 0.35));
}

.tab-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.toast {
  position: fixed;
  bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 100;
  background: rgba(44, 62, 80, 0.96);
  border: 1px solid #AAB7B8;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(15, 22, 30, 0.8);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
