/* ──────────────────────────────────────────────────────────────
   webTools landing page — playful, colorful, friendly
   ────────────────────────────────────────────────────────────── */

:root {
  --bg:        #faf6ee;        /* warm off-white */
  --ink:       #1a1612;        /* deep brown-black for text */
  --ink-soft:  #6b6358;
  --rule:      #e8e0d0;
  --accent:    #ff5b3a;        /* warm coral accent */
  --card-shadow: 0 1px 2px rgba(26,22,18,.04),
                 0 8px 24px -8px rgba(26,22,18,.12);
  --card-shadow-hover: 0 2px 4px rgba(26,22,18,.06),
                       0 24px 48px -12px rgba(26,22,18,.25);
  --radius: 22px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Decorative animated blobs ──────────────────────────────── */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: drift 18s ease-in-out infinite;
}
.blob-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #ffd6c2 0%, transparent 70%);
  top: -150px; left: -120px;
  animation-delay: 0s;
}
.blob-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #c9e4ff 0%, transparent 70%);
  bottom: -200px; right: -150px;
  animation-delay: -6s;
}
.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #e2d7ff 0%, transparent 70%);
  top: 40%; left: 50%;
  animation-delay: -12s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 48px) 80px;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  margin-bottom: clamp(40px, 7vw, 88px);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 24px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
}
.hero-eyebrow .dot {
  width: 8px; height: 8px;
  background: #2bb673;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(43, 182, 115, 0.05); }
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--accent);
}
.hero-title .period {
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0;
}

/* ─── Card grid ──────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.loading, .empty {
  grid-column: 1 / -1;
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
}
.empty code {
  font-family: 'DM Mono', ui-monospace, monospace;
  background: rgba(255,255,255,.7);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

/* ─── Card ───────────────────────────────────────────────────── */
.card {
  --c1: #888;
  --c2: #444;
  position: relative;
  display: block;
  aspect-ratio: 1.15 / 1;
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: white;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--card-shadow);
  transition:
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  animation: cardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay, 0s);
}

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

.card:hover {
  transform: translateY(-6px) rotate(-1.2deg);
  box-shadow: var(--card-shadow-hover);
}
.card:active {
  transform: translateY(-2px) rotate(-0.4deg) scale(0.99);
}

/* Decorative shape inside each card */
.card::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  top: var(--shape-top, -40%);
  right: var(--shape-right, -30%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover::before {
  transform: scale(1.15) rotate(20deg);
}

/* Subtle grain overlay */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}

.card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 2px;
  display: inline-block;
}

.card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  word-wrap: break-word;
  hyphens: auto;
}

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}
.card-arrow svg {
  width: 16px; height: 16px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card-arrow svg {
  transform: translateX(4px);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.foot {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* ─── Tighter mobile layout ──────────────────────────────────── */
@media (max-width: 540px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  .card {
    padding: 18px;
    border-radius: 18px;
  }
  .card-title {
    font-size: 19px;
  }
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  .card { animation: none; opacity: 1; }
  .card:hover { transform: translateY(-3px); }
  .card:hover::before { transform: none; }
}
