/* ============================================
   Crefiya — Delightful, Minimal, Readable
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand */
  --brand: #2a9d8f;
  --brand-strong: #1d7066;
  --brand-soft: #e6f6f4;
  --brand-glow: rgba(42, 157, 143, 0.18);

  /* Neutrals */
  --text: #0f1c1e;
  --text-heading: #0a1213;
  --muted: #4f6b70;
  --muted-light: #8aa3a8;

  /* Surfaces */
  --bg-1: #f0f6f5;
  --bg-2: #f7fbfa;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --line: #d4e5e3;
  --line-soft: #e8f0ef;

  /* Accents */
  --accent-warm: #fff8f0;
  --accent-warm-line: #f0e0d0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 50, 55, 0.04);
  --shadow: 0 8px 30px rgba(15, 50, 55, 0.07);
  --shadow-lg: 0 18px 55px rgba(15, 50, 55, 0.10);
  --shadow-xl: 0 28px 80px rgba(15, 50, 55, 0.12);

  /* Radii */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --radius-pill: 999px;

  /* Typography */
  --font: Inter, "SF Pro Text", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: Inter, "SF Pro Display", system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

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

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1400px 600px at 85% -5%, #d4f0ec 0%, transparent 60%),
    radial-gradient(1000px 500px at -5% 15%, #e2f2ef 0%, transparent 55%),
    radial-gradient(800px 400px at 50% 110%, #e8f4f2 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 16px;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

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

/* ---------- Layout ---------- */
.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

section {
  padding: var(--space-16) 0;
}

/* ---------- Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 251, 250, 0.82);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.3s var(--ease-out);
}

.topbar.is-scrolled {
  box-shadow: var(--shadow);
  border-bottom-color: var(--line);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--line-soft);
}

.logo {
  width: clamp(130px, 18vw, 170px);
  filter: drop-shadow(0 3px 8px rgba(34, 90, 95, 0.10));
  transition: transform 0.25s var(--ease-out);
}

.logo:hover {
  transform: translateY(-1px);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 720px) {
  .menu-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-strong);
    border-bottom: 1px solid var(--line);
    padding: var(--space-4);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-link {
    padding: var(--space-3) var(--space-4);
  }
}

/* ---------- Typography ---------- */
.overline,
.section-tag {
  display: inline-block;
  margin: 0 0 var(--space-3);
  color: var(--brand-strong);
  font-size: 0.76rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 650;
}

.section-tag {
  background: var(--brand-soft);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-heading);
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
}

h3 {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  font-weight: 620;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.35rem;
  font-size: 0.94rem;
  font-weight: 630;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), background 0.2s;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(180deg, #34b5a8, var(--brand));
  color: white;
  box-shadow: 0 10px 25px rgba(42, 157, 143, 0.28), 0 2px 6px rgba(42, 157, 143, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(42, 157, 143, 0.35), 0 4px 10px rgba(42, 157, 143, 0.18);
}

.btn-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-2);
  border-color: var(--brand-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  background: var(--line-soft);
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.hero h1 {
  max-width: 860px;
  margin: var(--space-4) auto var(--space-5);
}

.hero > p {
  margin: 0 auto;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.hero-actions {
  margin-top: var(--space-8);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Grids & Cards ---------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

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

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

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

@media (max-width: 640px) {
  .grid.two, .grid.three, .grid.four {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
  will-change: transform;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line);
}

.card h3 {
  margin-bottom: var(--space-3);
}

.card p,
.card li {
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.6;
}

.card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.card li + li {
  margin-top: var(--space-3);
}

.section-intro {
  max-width: 760px;
  color: var(--muted);
  margin: var(--space-4) 0 var(--space-8);
  font-size: 1.05rem;
}

/* ---------- Pricing ---------- */
.pricing {
  text-align: center;
}

.pricing-card {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.pricing-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-2);
}

.price {
  margin: var(--space-2) 0;
  font-size: 2.4rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.featured {
  border-color: #a8ddd7;
  background: linear-gradient(180deg, #f0fdfb 0%, #ffffff 70%);
  box-shadow: 0 12px 40px rgba(42, 157, 143, 0.10), var(--shadow);
}

.featured:hover {
  border-color: #8fd4cd;
  box-shadow: 0 18px 55px rgba(42, 157, 143, 0.14), var(--shadow-lg);
}

.pill {
  position: absolute;
  top: -12px;
  right: 18px;
  background: linear-gradient(180deg, #3db8ab, var(--brand));
  color: white;
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.75rem;
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.25);
}

.usage-note {
  margin-top: var(--space-6);
  background: var(--brand-soft);
  border: 1px solid #cfeae6;
  border-radius: var(--radius-sm);
  padding: var(--space-5) var(--space-6);
  text-align: left;
  font-size: 0.95rem;
  color: var(--muted);
}

.usage-note strong {
  color: var(--brand-strong);
}

/* ---------- Video ---------- */
.video {
  text-align: center;
}

.video-embed {
  margin-top: var(--space-6);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
  background: var(--surface-strong);
  aspect-ratio: 16 / 9;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.video-placeholder {
  margin-top: var(--space-5);
  border: 1px dashed #b8ddd8;
  border-radius: var(--radius);
  min-height: 260px;
  background:
    linear-gradient(145deg, rgba(235, 248, 246, 0.85), rgba(255, 255, 255, 0.95)),
    repeating-linear-gradient(
      45deg,
      rgba(198, 226, 222, 0.18) 0 12px,
      rgba(245, 252, 251, 0.25) 12px 24px
    );
  display: grid;
  place-items: center;
}

/* ---------- Tables ---------- */
.pricing-table,
.workflow-table,
.cost-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: var(--space-6);
  background: var(--surface-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line-soft);
}

.pricing-table th,
.pricing-table td,
.workflow-table th,
.workflow-table td,
.cost-table th,
.cost-table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.pricing-table th,
.workflow-table th,
.cost-table th {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 620;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.pricing-table tbody tr:last-child td,
.workflow-table tbody tr:last-child td,
.cost-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody tr,
.workflow-table tbody tr,
.cost-table tbody tr {
  transition: background 0.15s;
}

.pricing-table tbody tr:hover,
.workflow-table tbody tr:hover,
.cost-table tbody tr:hover {
  background: rgba(42, 157, 143, 0.03);
}

.credit-badge {
  display: inline-block;
  background: linear-gradient(180deg, #34b5a8, var(--brand));
  color: white;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 620;
  box-shadow: 0 2px 8px rgba(42, 157, 143, 0.18);
}

/* ---------- Lists ---------- */
.check-list,
.cross-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li,
.cross-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.55;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand-strong);
  font-weight: 700;
}

.cross-list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #e05a5a;
  font-weight: 700;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: var(--space-8) 0 var(--space-12);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  font-weight: 550;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--brand-strong);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

/* ---------- Page headers ---------- */
.page-header {
  text-align: center;
  padding: var(--space-20) 0 var(--space-12);
}

.page-header h1 {
  margin: var(--space-4) auto var(--space-5);
  max-width: 780px;
}

.page-header > p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

/* ---------- Legal ---------- */
.legal {
  max-width: 860px;
  padding: var(--space-20) 0 var(--space-16);
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-2);
}

.legal h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  font-size: 1.3rem;
  font-weight: 620;
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal ul {
  padding-left: 1.3rem;
}

.legal li + li {
  margin-top: var(--space-2);
}

/* ---------- Quest / Guide Pages ---------- */
.quest-header {
  text-align: center;
  padding: var(--space-20) var(--space-4) var(--space-12);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.quest-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  border-radius: 3px;
}

.task-list {
  max-width: 720px;
  margin: -2rem auto var(--space-20);
  padding: 0 var(--space-4);
}

.task-card {
  background: var(--surface-strong);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s;
  cursor: default;
}

.task-card:hover {
  transform: translateX(6px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.task-num {
  background: linear-gradient(180deg, #34b5a8, var(--brand));
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.22);
  margin-top: 2px;
}

.task-content h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.1rem;
  font-weight: 620;
}

.task-content p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
  line-height: 1.55;
}

.mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mode-studio {
  background: #d1fae5;
  color: #065f46;
}

.mode-presenter {
  background: #dbeafe;
  color: #1e3a8a;
}

.problem-solution {
  max-width: 640px;
  margin: var(--space-6) auto 0;
  text-align: left;
  background: var(--surface-strong);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.problem-solution p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
}

.problem-solution p + p {
  margin-top: var(--space-4);
}

.quest-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.icon-inline {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  margin-right: 0.2em;
}

/* ---------- Comparison / Math ---------- */
.comparison-section {
  margin: var(--space-20) auto;
}

.math-breakdown {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.math-breakdown .total {
  font-size: 2.6rem;
  font-weight: 720;
  color: var(--brand-strong);
  margin: var(--space-4) 0;
  letter-spacing: -0.02em;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }
.mb-5 { margin-bottom: var(--space-10); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }
.mt-5 { margin-top: var(--space-10); }
.max-w-sm { max-width: 480px; }
.max-w-md { max-width: 640px; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 960px; }
.mx-auto { margin-inline: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }
.w-full { width: 100%; }

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Focus / Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  body {
    font-size: 15.5px;
  }

  section {
    padding: var(--space-10) 0;
  }

  .hero {
    padding-top: var(--space-12);
  }

  .card {
    padding: var(--space-5);
  }

  .pricing-card {
    min-height: auto;
  }

  .page-header {
    padding: var(--space-12) 0 var(--space-8);
  }

  .task-card {
    padding: var(--space-4) var(--space-5);
  }

  .task-num {
    width: 36px;
    height: 36px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .pricing-table th,
  .pricing-table td,
  .workflow-table th,
  .workflow-table td,
  .cost-table th,
  .cost-table td {
    padding: var(--space-3) var(--space-4);
  }
}
