/* ============================================
   MOKH AI — Soft Tech Playground
   A premium-playful design system
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Brand colors */
  --primary: #765FFF;
  --primary-light: #9B89FF;
  --primary-dark: #5E48E6;
  --primary-glow: rgba(118, 95, 255, 0.25);
  --accent: #1ED6B3;
  --accent-dark: #16B89A;
  --accent-glow: rgba(30, 214, 179, 0.2);
  --sky: #31C8FD;
  --sky-light: #7FDDFE;
  --cyan: #21D0D8;
  --cyan-light: #6FE0E6;

  /* Neutrals (text + surfaces) */
  --ink: #1F1B3A;
  --ink-light: #4A4566;
  --ink-dark: #0F0B2A;
  --ink-muted: rgba(31, 27, 58, 0.06);
  --bg: #FFFFFF;
  --bg-soft: #F7F6FF;
  --white: #FFFFFF;
  --off-white: #FAFAF8;

  /* Borders */
  --border: rgba(31, 27, 58, 0.08);
  --border-hover: rgba(118, 95, 255, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(31, 27, 58, 0.06);
  --shadow-md: 0 8px 30px rgba(31, 27, 58, 0.08);
  --shadow-lg: 0 20px 60px rgba(31, 27, 58, 0.1);
  --shadow-glow: 0 8px 40px var(--primary-glow);

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-full: 9999px;

  /* Typography */
  --font-body: 'Montserrat', -apple-system, sans-serif;
  --font-heading: 'Montserrat', -apple-system, sans-serif;

  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container: 1140px;
  --header-h: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }

/* --- Grain Overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { max-width: 65ch; }

.text-center { text-align: center; }
.text-muted { color: var(--ink-light); opacity: 0.7; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Section Spacing --- */
.section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header p {
  margin: 16px auto 0;
  font-size: 1.1rem;
  color: var(--ink-light);
  max-width: 500px;
}

/* --- Floating Blobs (Background decoration) --- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.blob-salmon {
  background: var(--primary);
  width: 400px;
  height: 400px;
}

.blob-mint {
  background: var(--accent);
  width: 350px;
  height: 350px;
}

.blob-lavender {
  background: var(--sky);
  width: 300px;
  height: 300px;
}

.blob-cyan {
  background: var(--cyan);
  width: 320px;
  height: 320px;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: all 0.4s var(--ease-out);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

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

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--ink);
  z-index: 1001;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.footer .logo-img {
  height: 44px;
}

/* Desktop Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-light);
  transition: all 0.25s var(--ease-out);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--ink-muted);
}

.nav-links a.active {
  font-weight: 600;
}

.nav-cta {
  margin-left: 8px;
  padding: 10px 24px !important;
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%) !important;
  background-size: 200% 200% !important;
  background-position: 0% 0% !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 4px 14px rgba(118, 95, 255, 0.30) !important;
  transition: background-position 0.5s var(--ease-out), box-shadow 0.3s ease, transform 0.3s var(--ease-spring) !important;
}

.nav-cta:hover {
  background-position: 100% 100% !important;
  box-shadow: 0 8px 24px rgba(30, 214, 179, 0.35) !important;
  transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
  transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255, 253, 245, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-nav.open {
  display: flex;
  opacity: 1;
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  transition: all 0.25s var(--ease-out);
  opacity: 0;
  transform: translateY(20px);
}

.mobile-nav.open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav a:hover {
  background: var(--ink-muted);
  color: var(--primary);
}

/* Stagger mobile links */
.mobile-nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav a:nth-child(2) { transition-delay: 0.1s; }
.mobile-nav a:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav a:nth-child(4) { transition-delay: 0.2s; }
.mobile-nav a:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav a:nth-child(6) { transition-delay: 0.3s; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-dark {
  background: var(--ink);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--ink-dark);
}

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

.btn-outline:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-ghost {
  background: var(--ink-muted);
  color: var(--ink);
}

.btn-ghost:hover {
  background: rgba(31,27,58,0.12);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--cyan) 100%);
  background-size: 200% 200%;
  background-position: 0% 0%;
  color: var(--white);
  box-shadow: 0 6px 20px rgba(118, 95, 255, 0.30);
  transition: background-position 0.5s var(--ease-out), box-shadow 0.3s ease, transform 0.3s var(--ease-spring);
}

.btn-gradient:hover {
  background-position: 100% 100%;
  box-shadow: 0 10px 28px rgba(30, 214, 179, 0.35);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.1rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 36px;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.card-icon.salmon   { background: rgba(118, 95, 255, 0.12); color: var(--primary); }
.card-icon.mint     { background: rgba(30, 214, 179, 0.15); color: var(--accent-dark); }
.card-icon.lavender { background: rgba(49, 200, 253, 0.15); color: var(--sky); }
.card-icon.cream    { background: rgba(33, 208, 216, 0.15); color: var(--cyan); }

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(118, 95, 255, 0.12);
  color: var(--primary);
}

.card-badge.accent { background: rgba(30, 214, 179, 0.15); color: var(--accent-dark); }
.card-badge.sky    { background: rgba(49, 200, 253, 0.15); color: var(--sky); }
.card-badge.cyan   { background: rgba(33, 208, 216, 0.15); color: var(--cyan); }

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: var(--ink-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary);
  transition: gap 0.3s var(--ease-out);
}

.card-link:hover {
  gap: 12px;
}

.card-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out);
}

.card-link:hover svg {
  transform: translateX(4px);
}

/* ============================================
   BADGE / PILL
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--ink-muted);
  color: var(--ink);
  margin-bottom: 20px;
}

.badge-glow {
  background: rgba(118, 95, 255, 0.12);
  color: var(--primary);
  animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 8px rgba(118,95,255,0); }
}

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-light);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
  animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   HERO SECTION (Homepage)
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  position: relative;
  overflow: hidden;
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero h1 {
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--ink-light);
  margin-bottom: 36px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 420px;
}

/* Glow halo behind the image */
.hero-visual::before {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    var(--primary) 0%,
    var(--accent) 35%,
    transparent 70%);
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  animation: hero-glow 6s ease-in-out infinite;
}

.hero-image {
  position: relative;
  z-index: 1;
  width: 80%;
  max-width: 520px;
  height: auto;
  display: block;
  filter: drop-shadow(0 30px 60px rgba(118, 95, 255, 0.30));
  animation: hero-float 6s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-18px); }
}

@keyframes hero-glow {
  0%, 100% { opacity: 0.30; transform: scale(1); }
  50%      { opacity: 0.50; transform: scale(1.08); }
}

/* ============================================
   STEPS SECTION
   ============================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  align-items: start;
}

.step-card {
  text-align: center;
  padding: 40px 30px;
  position: relative;
}

.step-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 20px;
  border: 2px solid var(--border);
  background: var(--white);
  transition: all 0.3s var(--ease-out);
}

.step-card:hover .step-number {
  color: var(--white);
  transform: scale(1.1);
}

.step-card:nth-child(1):hover .step-number {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(118, 95, 255, 0.30);
}

.step-card:nth-child(2):hover .step-number {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(30, 214, 179, 0.30);
}

.step-card:nth-child(3):hover .step-number {
  background: var(--sky);
  border-color: var(--sky);
  box-shadow: 0 8px 24px rgba(49, 200, 253, 0.30);
}

.step-card h3 { margin-bottom: 10px; }
.step-card p { margin: 0 auto; color: var(--ink-light); font-size: 0.95rem; }

.step-arrow {
  position: absolute;
  right: -30px;
  top: 60px;
  font-size: 1.5rem;
  color: var(--primary-light);
}

[dir="rtl"] .step-arrow {
  right: auto;
  left: -30px;
  transform: scaleX(-1);
}

[dir="rtl"] .card-link svg {
  transform: scaleX(-1);
}

[dir="rtl"] .card-link:hover svg {
  transform: scaleX(-1) translateX(4px);
}

[dir="rtl"] .tool-card:hover .card-link svg {
  transform: scaleX(-1) translateX(4px);
}

/* ============================================
   TOOL CARDS GRID
   ============================================ */
/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 28px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 38px 34px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Decorative corner blob */
.tool-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(118, 95, 255, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.6s var(--ease-out), background 0.4s ease;
}

/* Top gradient line that fills on hover */
.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--sky), var(--cyan));
  border-radius: 24px 24px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.tool-card:hover::after {
  transform: scaleX(1);
}

.tool-card:hover::before {
  transform: scale(1.4) translate(-30px, 30px);
  background: radial-gradient(circle, rgba(30, 214, 179, 0.14) 0%, transparent 70%);
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(118, 95, 255, 0.18);
  border-color: rgba(118, 95, 255, 0.30);
}

.tool-card .card-icon-bubble {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(118, 95, 255, 0.12), rgba(30, 214, 179, 0.08));
  border: 1px solid rgba(118, 95, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 0;
  transition: transform 0.45s var(--ease-spring);
}

.tool-card:hover .card-icon-bubble {
  transform: scale(1.08) rotate(-4deg);
}

.tool-card .card-icon-bubble img,
.tool-card .card-icon-bubble svg {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
  stroke-width: 1.6;
  transition: transform 0.45s var(--ease-spring);
}

/* Per-tool icon colors (V2 palette) */
.tools-grid .tool-card:nth-child(1) .card-icon-bubble {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border-color: rgba(25, 118, 210, 0.18);
}
.tools-grid .tool-card:nth-child(1) .card-icon-bubble svg { color: #1976D2; }

.tools-grid .tool-card:nth-child(2) .card-icon-bubble {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border-color: rgba(230, 81, 0, 0.18);
}
.tools-grid .tool-card:nth-child(2) .card-icon-bubble svg { color: #E65100; }

.tools-grid .tool-card:nth-child(3) .card-icon-bubble {
  background: linear-gradient(135deg, #EDE7F6, #D1C4E9);
  border-color: rgba(94, 53, 177, 0.18);
}
.tools-grid .tool-card:nth-child(3) .card-icon-bubble svg { color: #5E35B1; }

.tools-grid .tool-card:nth-child(4) .card-icon-bubble {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-color: rgba(46, 125, 50, 0.18);
}
.tools-grid .tool-card:nth-child(4) .card-icon-bubble svg { color: #2E7D32; }

.tools-grid .tool-card:nth-child(5) .card-icon-bubble {
  background: linear-gradient(135deg, #FCE4EC, #F8BBD0);
  border-color: rgba(194, 24, 91, 0.18);
}
.tools-grid .tool-card:nth-child(5) .card-icon-bubble svg { color: #C2185B; }

.tools-grid .tool-card:nth-child(6) .card-icon-bubble {
  background: linear-gradient(135deg, #FFF8E1, #FFE082);
  border-color: rgba(245, 127, 23, 0.18);
}
.tools-grid .tool-card:nth-child(6) .card-icon-bubble svg { color: #F57F17; }

.tool-card:hover .card-icon-bubble svg {
  transform: scale(1.08);
}

.tool-card .card-cat {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(118, 95, 255, 0.10);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.tool-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.tool-card p {
  position: relative;
  z-index: 1;
  color: var(--ink-light);
  font-size: 0.94rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 28px;
}

.tool-card .card-price {
  position: relative;
  z-index: 1;
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(118, 95, 255, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  margin: -16px 0 16px;
  flex: none;
}

.tool-card .card-link {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
  transition: gap 0.3s ease;
}

.tool-card .card-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s var(--ease-out);
}

.tool-card:hover .card-link {
  gap: 12px;
}

.tool-card:hover .card-link svg {
  transform: translateX(4px);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 36px;
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.45;
  font-family: Georgia, serif;
  line-height: 1;
  position: absolute;
  top: 20px;
  left: 28px;
}

.testimonial-text {
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 20px;
  padding-top: 24px;
  line-height: 1.7;
}

.testimonial-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.testimonial-role {
  font-size: 0.82rem;
  color: var(--ink-light);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  background:
    radial-gradient(at 15% 20%, rgba(118, 95, 255, 0.35) 0%, transparent 50%),
    radial-gradient(at 85% 30%, rgba(30, 214, 179, 0.25) 0%, transparent 50%),
    radial-gradient(at 50% 100%, rgba(49, 200, 253, 0.20) 0%, transparent 50%),
    var(--ink);
  border-radius: var(--radius-xl);
  padding: 80px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 0 24px;
  box-shadow: 0 30px 80px rgba(31, 27, 58, 0.25);
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 auto 36px;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.cta-section .btn {
  position: relative;
  z-index: 1;
}

.cta-section .btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.cta-section .btn-primary:hover {
  background: var(--white);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

/* ============================================
   CTA TOOLS — light variant for tools page
   ============================================ */
.cta-tools {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 96px 60px;
  margin: 0 24px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, #F7F6FF 0%, #EAFBF6 50%, #E5F4FE 100%);
  border: 1px solid rgba(118, 95, 255, 0.15);
  box-shadow: 0 30px 70px rgba(118, 95, 255, 0.10);
}

.cta-tools::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.30;
  filter: blur(70px);
  pointer-events: none;
}

.cta-tools::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.28;
  filter: blur(70px);
  pointer-events: none;
}

.cta-tools-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.cta-tools .cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: rgba(118, 95, 255, 0.10);
  border: 1px solid rgba(118, 95, 255, 0.20);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.cta-tools h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 18px;
  line-height: 1.15;
}

.cta-tools .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.cta-tools p {
  font-size: 1.15rem;
  color: var(--ink-light);
  max-width: 540px;
  margin: 0 auto 36px;
}

@media (max-width: 768px) {
  .cta-tools { padding: 64px 28px; margin: 0 16px; }
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
}

.contact-info-card {
  background:
    radial-gradient(at 15% 20%, rgba(118, 95, 255, 0.35) 0%, transparent 50%),
    radial-gradient(at 85% 30%, rgba(30, 214, 179, 0.25) 0%, transparent 50%),
    radial-gradient(at 50% 100%, rgba(49, 200, 253, 0.20) 0%, transparent 50%),
    var(--ink);
  border-radius: var(--radius-lg);
  padding: 48px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(31, 27, 58, 0.22);
}

.contact-info-card h3 {
  color: var(--white);
  margin-bottom: 16px;
}

.contact-info-card p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.contact-detail-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 48px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--off-white);
  transition: all 0.3s var(--ease-out);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234A3B4A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* ============================================
   TOOL DETAIL PAGE
   ============================================ */
.tool-hero {
  padding-top: calc(var(--header-h) + 60px);
  padding-bottom: 60px;
  text-align: center;
}

.tool-hero .badge {
  margin-bottom: 16px;
}

.tool-hero h1 {
  margin-bottom: 16px;
}

.tool-hero p {
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--ink-light);
}

.tool-demo {
  max-width: 700px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.tool-demo-header {
  background: var(--ink);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.tool-demo-dot:nth-child(1) { background: #FF6058; }
.tool-demo-dot:nth-child(2) { background: #FFC02F; }
.tool-demo-dot:nth-child(3) { background: #28CA41; }

.tool-demo-title {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-left: 8px;
}

.tool-demo-body {
  padding: 32px;
  min-height: 400px;
}

/* Chat UI for Vent Bot */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}

.chat-bubble {
  max-width: 80%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.6;
  animation: bubble-in 0.3s var(--ease-spring);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.bot {
  background: var(--bg-soft);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}

.chat-bubble.user {
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  background: var(--off-white);
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s var(--ease-out);
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Upload UI for Pro Mode / Teleport */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(118,95,255,0.03);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.upload-zone p {
  margin: 0 auto;
  color: var(--ink-light);
}

.option-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.option-pill {
  padding: 10px 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.option-pill:hover,
.option-pill.active {
  border-color: var(--primary);
  background: rgba(118, 95, 255, 0.12);
  color: var(--primary);
}

/* ============================================
   PAGE HERO (Inner pages)
   ============================================ */
.page-hero {
  padding-top: calc(var(--header-h) + 80px);
  padding-bottom: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  margin-bottom: 16px;
}

.page-hero p {
  margin: 0 auto;
  color: var(--ink-light);
  font-size: 1.15rem;
  max-width: 540px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.value-card {
  text-align: center;
  padding: 40px 30px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.value-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.value-icon {
  font-size: 2.8rem;
  margin-bottom: 18px;
}

.value-card h3 { margin-bottom: 10px; }
.value-card p { margin: 0 auto; color: var(--ink-light); font-size: 0.92rem; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-light);
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

.footer-bottom-links a {
  color: var(--ink-light);
  transition: color 0.2s;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .hero .container { flex-direction: column; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  .hero-visual { margin-top: 40px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .step-arrow { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 70px 0; }
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .hero { min-height: auto; padding: 120px 0 80px; }
  .hero-visual { min-height: 320px; }
  .hero-visual::before { width: 320px; height: 320px; }
  .hero-visual::after { width: 300px; height: 300px; }
  .hero-image { max-width: 320px; }
  .tools-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 60px 30px; margin: 0 16px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .hero-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .card { padding: 28px; }
  .tool-card { padding: 24px; }
  .contact-info-card, .contact-form-card { padding: 32px; }
}

/* ============================================
   TOOL FEATURES GRID
   ============================================ */
.features-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.feature-mini {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.feature-mini:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.feature-mini-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-mini h4 { margin-bottom: 6px; }
.feature-mini p { color: var(--ink-light); font-size: 0.85rem; }

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-content {
  color: var(--ink);
  line-height: 1.85;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.legal-content h2:first-of-type {
  margin-top: 32px;
}

.legal-content h3 {
  font-size: 1.05rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--ink);
}

.legal-content p {
  color: var(--ink-light);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.legal-content ul {
  margin: 12px 0 20px 0;
  padding-inline-start: 24px;
}

.legal-content ul li {
  color: var(--ink-light);
  font-size: 0.95rem;
  padding: 5px 0;
  line-height: 1.7;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(118,95,255,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.legal-content a:hover {
  text-decoration-color: var(--primary);
}

.legal-updated {
  display: inline-block;
  background: var(--bg-soft);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 12px;
}

.disclaimer-note {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  border-inline-start: 4px solid var(--primary);
}

.disclaimer-note p {
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 0;
}

/* Cookie table */
.cookie-table {
  margin: 20px 0 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cookie-row {
  display: grid;
  grid-template-columns: 140px 1fr 130px;
  gap: 0;
}

.cookie-header {
  background: var(--ink);
}

.cookie-header .cookie-cell {
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-cell {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--ink-light);
  border-bottom: 1px solid var(--border);
}

.cookie-row:last-child .cookie-cell {
  border-bottom: none;
}

@media (max-width: 640px) {
  .cookie-row {
    grid-template-columns: 1fr;
  }
  .cookie-cell {
    padding: 10px 20px;
  }
  .cookie-cell:first-child {
    padding-top: 16px;
    font-weight: 600;
    color: var(--ink);
  }
  .cookie-cell:last-child {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }
  .cookie-header {
    display: none;
  }
}

/* ============================================
   Profile Page
   ============================================ */

.profile-main {
  display: grid;
  /* minmax(0, 1fr) so the content column can shrink below its content width —
     otherwise wide children (like a fixed-min-width table) push the grid
     wider than the container and the whole page scrolls sideways. */
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 32px) 20px 60px;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Account Card */
.profile-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.profile-card-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.status-active {
  background: rgba(30, 214, 179, 0.1);
  border: 1px solid rgba(30, 214, 179, 0.3);
  color: #0d9b7a;
}

.status-inactive {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #c44;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.status-active .status-dot { background: var(--accent); }
.status-inactive .status-dot { background: #c44; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Profile Details */
.profile-details {
  display: flex;
  flex-direction: column;
}

.profile-detail-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.profile-detail-row:last-child {
  border-bottom: none;
}

.profile-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-detail-icon .material-symbols-outlined {
  font-size: 24px;
}

.icon-primary { background: rgba(118, 95, 255, 0.1); color: var(--primary); }
.icon-secondary { background: rgba(30, 214, 179, 0.1); color: var(--accent); }
.icon-accent { background: rgba(49, 200, 253, 0.1); color: var(--sky); }
.icon-info { background: rgba(33, 208, 216, 0.1); color: var(--cyan); }
.icon-muted { background: var(--ink-muted); color: var(--ink-light); }

.detail-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-light);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

/* Unsub / Logout Buttons */
.btn-unsub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(220, 60, 60, 0.06);
  color: #c44;
  border: 1px solid rgba(220, 60, 60, 0.2);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.btn-unsub:hover {
  background: #c44;
  color: #fff;
  border-color: #c44;
  box-shadow: 0 8px 24px rgba(220, 60, 60, 0.2);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--ink-muted);
  color: var(--ink-light);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* Token Balance Card */
.token-card {
  position: relative;
  overflow: hidden;
  background: var(--ink-dark);
  border-radius: var(--radius-md);
  padding: 32px;
  color: #fff;
}

.token-card-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.token-card-bg::before,
.token-card-bg::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(60px);
}

.token-card-bg::before {
  top: -60px;
  right: -60px;
  background: rgba(118, 95, 255, 0.25);
}

.token-card-bg::after {
  bottom: -60px;
  left: -60px;
  background: rgba(30, 214, 179, 0.2);
}

.token-card-content {
  position: relative;
  z-index: 1;
}

.token-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.token-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.token-number {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.token-remaining {
  font-size: 0.85rem;
  opacity: 0.6;
  font-style: italic;
}

/* Right Content */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0; /* allow flex children to shrink below their content width */
}

.profile-section {
  min-width: 0;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--ink-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Service Rates Grid */
.rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rate-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  transition: all 0.3s var(--ease-out);
}

.rate-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.rate-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.rate-icon .material-symbols-outlined {
  font-size: 24px;
}

.rate-card:hover .rate-icon.icon-primary { background: var(--primary); color: #fff; }
.rate-card:hover .rate-icon.icon-secondary { background: var(--accent); color: #fff; }
.rate-card:hover .rate-icon.icon-accent { background: var(--sky); color: #fff; }

.rate-info {
  flex: 1;
  min-width: 0;
}

.rate-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.rate-desc {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-light);
}

.rate-cost {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
  color: var(--accent);
}

.rate-amount {
  font-size: 1.5rem;
  font-weight: 900;
}

.rate-unit {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Usage History Table */
#usage-history-wrap { margin-top: 20px; }

.usage-table-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
  table-layout: fixed;
}

.usage-table th,
.usage-table td {
  overflow: hidden;
}

/* Column widths so truncation takes effect and layout stays balanced */
.usage-table th:nth-child(1), .usage-table td:nth-child(1) { width: 170px; }  /* Date */
.usage-table th:nth-child(2), .usage-table td:nth-child(2) { width: 160px; }  /* Tool */
.usage-table th:nth-child(3), .usage-table td:nth-child(3) { width: auto;  }  /* Input */
.usage-table th:nth-child(4), .usage-table td:nth-child(4) { width: auto;  }  /* Output */
.usage-table th:nth-child(5), .usage-table td:nth-child(5) { width: 70px;  }  /* Credits */
.usage-table th:nth-child(6), .usage-table td:nth-child(6) { width: 90px;  }  /* Action */

.usage-table thead tr {
  background: var(--bg-soft);
}

.usage-table th {
  padding: 14px 14px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-light);
}

.usage-table td {
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.usage-table tbody tr {
  transition: background 0.2s;
}

.usage-table tbody tr:hover {
  background: var(--bg-soft);
}

.usage-date,
.usage-time {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-light);
  white-space: nowrap;
}

.usage-time {
  margin-inline-start: 6px;
}

.usage-service {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.usage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.usage-dot.dot-primary { background: var(--primary); }
.usage-dot.dot-secondary { background: var(--accent); }
.usage-dot.dot-accent { background: var(--sky); }

.usage-summary {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-style: italic;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usage-cost {
  font-weight: 700;
  color: var(--accent);
}

.usage-thumb {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.usage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Download overlay that appears on hover */
.usage-thumb-download { cursor: pointer; text-decoration: none; }

.usage-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 11, 42, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s;
}

.usage-thumb-download:hover .usage-thumb-overlay { opacity: 1; }

.usage-thumb-download:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(118, 95, 255, 0.25);
}

/* Tool cell: icon + label (kept on one line) */
.usage-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.usage-tool .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.usage-tool-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Truncated text cells — rely on table-layout:fixed + column widths */
.usage-text {
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small thumbnail for image output */
.usage-thumb-sm {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  transition: transform 0.15s, border-color 0.15s;
}

.usage-thumb-sm:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

/* Action icon button (View / Download) */
.usage-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-glow);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.usage-action:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.usage-action .material-symbols-outlined {
  font-size: 20px;
}

.usage-thumb-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--ink-light);
  font-weight: 600;
}

.text-right { text-align: right; }
.text-end { text-align: end; }

[dir="rtl"] .usage-page-btn .material-symbols-outlined { transform: scaleX(-1); }

.usage-empty {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-light);
}

.usage-empty p {
  max-width: 100%;
}

/* Usage pagination */
.usage-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.usage-summary-text {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin: 0;
}

.usage-summary-text strong { color: var(--ink); font-weight: 700; }

.usage-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-page-btn,
.usage-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-light);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.usage-page-btn:hover,
.usage-page-num:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.usage-page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.usage-page-num.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.usage-page-ellipsis {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 20px;
  height: 36px;
  color: var(--ink-light);
  font-weight: 700;
  user-select: none;
}

/* --- Profile Responsive --- */

/* iPad Pro 12.9 portrait (1024) and below: stack main, sidebar becomes 2-col
   (Account + Credit side-by-side). iPad Air/Pro-11 portrait fall in this range. */
@media (max-width: 960px) {
  .profile-main {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: calc(var(--header-h) + 28px) 20px 48px;
  }

  .profile-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .rates-grid { grid-template-columns: repeat(3, 1fr); }
}

/* iPad mini portrait (768): sidebar still 2-col, rates 2-col */
@media (max-width: 820px) {
  .profile-main {
    padding: calc(var(--header-h) + 24px) 18px 44px;
    gap: 26px;
  }

  .rates-grid { grid-template-columns: 1fr 1fr; }

  .profile-card { padding: 26px; }
  .token-card { padding: 28px; }
}

/* Large phones / stacked single col */
@media (max-width: 640px) {
  .profile-main {
    padding: calc(var(--header-h) + 22px) 16px 40px;
    gap: 22px;
  }

  .profile-sidebar {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .profile-card { padding: 24px; }

  .rates-grid { grid-template-columns: 1fr; }

  .usage-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .usage-table { min-width: 780px; }

  .section-title { font-size: 1.3rem; }
  .token-number { font-size: 2.6rem; }

  .usage-pagination { gap: 12px; }
}

/* iPhone XR and similar (≤480) */
@media (max-width: 480px) {
  .profile-main {
    padding: calc(var(--header-h) + 16px) 12px 32px;
    gap: 20px;
  }

  .profile-card { padding: 20px; }

  .profile-card-header { margin-bottom: 20px; }
  .profile-card-header h2 { font-size: 1.1rem; }

  .profile-detail-row {
    gap: 14px;
    padding: 14px 0;
  }

  .profile-detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .profile-detail-icon .material-symbols-outlined { font-size: 20px; }

  .detail-value { font-size: 0.9rem; word-break: break-word; }

  .rate-card {
    padding: 14px 14px;
    gap: 12px;
  }

  .rate-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .rate-icon .material-symbols-outlined { font-size: 20px; }

  .rate-name { font-size: 0.9rem; }
  .rate-amount { font-size: 1.2rem; }

  .token-card { padding: 22px; }
  .token-label { font-size: 0.65rem; letter-spacing: 1.5px; }
  .token-number { font-size: 2.2rem; }
  .token-remaining { font-size: 0.8rem; }

  .btn-unsub,
  .btn-logout {
    padding: 12px;
    font-size: 0.85rem;
  }

  .section-title { font-size: 1.2rem; }
  .section-subtitle { font-size: 0.85rem; margin-bottom: 18px; }

  .usage-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .usage-summary-text { text-align: center; }
  .usage-pages { justify-content: center; flex-wrap: wrap; }
}

/* iPhone SE and very narrow (≤380) */
@media (max-width: 380px) {
  .profile-main { padding: calc(var(--header-h) + 14px) 10px 28px; }
  .profile-card { padding: 18px; }
  .token-card { padding: 20px; }
  .token-number { font-size: 2rem; }

  .rate-card {
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .rate-cost { gap: 2px; }
  .rate-amount { font-size: 1.1rem; }
  .rate-unit { font-size: 0.55rem; }

  .profile-detail-row { gap: 12px; }

  .usage-page-btn,
  .usage-page-num {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* ============================================
   Flash Toast
   ============================================ */
.flash-toast {
  position: fixed;
  top: calc(var(--header-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 18px 20px;
  border-radius: 16px;
  z-index: 9999;
  min-width: 320px;
  max-width: 520px;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: flashSlideIn 0.4s var(--ease-spring);
  overflow: hidden;
}

.flash-toast.flash-hiding {
  animation: flashSlideOut 0.3s ease forwards;
}

.flash-error {
  background: linear-gradient(135deg, #ff5858 0%, #c44 100%);
}

.flash-success {
  background: linear-gradient(135deg, #1ED6B3 0%, #0d9b7a 100%);
}

.flash-icon {
  font-size: 26px !important;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  font-variation-settings: 'FILL' 1;
  text-align: center;
  align-content: center;
}

.flash-message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.flash-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}

.flash-close:hover { background: rgba(255, 255, 255, 0.3); }

.flash-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  animation: flashProgress 5s linear forwards;
}

@keyframes flashSlideIn {
  from { transform: translate(-50%, -30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes flashSlideOut {
  from { transform: translate(-50%, 0); opacity: 1; }
  to { transform: translate(-50%, -30px); opacity: 0; }
}

@keyframes flashProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@media (max-width: 640px) {
  .flash-toast {
    left: 12px;
    right: 12px;
    transform: none;
    min-width: 0;
    max-width: none;
  }
  @keyframes flashSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  @keyframes flashSlideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-30px); opacity: 0; }
  }
}
