/* /assets/main.css */
:root {
  --bg: hsl(45, 30%, 98%);
  --bg-alt: hsl(45, 20%, 92%);
  --fg: hsl(220, 25%, 15%);
  --fg-muted: hsl(220, 15%, 45%);
  --card: hsl(0, 0%, 100%);
  --border: hsl(45, 20%, 88%);
  --primary: hsl(175, 60%, 40%);
  --primary-light: hsl(175, 70%, 50%);
  --primary-fg: hsl(0, 0%, 100%);
  --secondary: hsl(30, 90%, 60%);
  --secondary-light: hsl(35, 95%, 65%);
  --secondary-fg: hsl(0, 0%, 100%);
  --accent: hsl(260, 60%, 60%);
  --accent-light: hsl(280, 65%, 65%);
  --accent-fg: hsl(0, 0%, 100%);
  --destructive: hsl(0, 84%, 60%);
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-secondary: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-light));
  --gradient-hero: linear-gradient(180deg, var(--bg) 0%, hsl(175, 30%, 95%) 100%);
  --shadow-soft: 0 4px 20px -4px hsla(220, 25%, 15%, 0.08);
  --shadow-card: 0 8px 30px -8px hsla(220, 25%, 15%, 0.12);
  --shadow-hover: 0 12px 40px -8px hsla(220, 25%, 15%, 0.18);
  --shadow-glow: 0 0 40px hsla(175, 60%, 40%, 0.2);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--gradient-primary);
  color: var(--primary-fg);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.btn-primary:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

.btn-ghost:hover {
  background: var(--bg-alt);
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--gradient-primary);
  color: var(--primary-fg);
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.btn-hero:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.btn-hero svg {
  transition: transform 0.3s;
}

.btn-hero:hover svg {
  transform: translateX(4px);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--card);
  color: var(--fg);
  font-size: 1.125rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.btn-hero-secondary:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.btn-hero-secondary svg {
  color: var(--primary);
}

.btn-credits {
  border-color: var(--border);
  color: var(--fg);
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(0, 0%, 100%, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

@media (min-width: 768px) {
  .header-content {
    height: 5rem;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  color: var(--primary-fg);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.logo:hover .logo-icon {
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  display: none;
}

@media (min-width: 640px) {
  .logo-text {
    display: block;
  }
}

.logo-accent {
  color: var(--primary);
}

.nav-desktop {
  display: none;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--fg);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .header-actions {
    display: flex;
  }
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--fg);
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: var(--bg-alt);
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu {
  display: none;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.mobile-menu.open {
  display: block;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-nav-link:hover {
  background: var(--bg-alt);
}

.mobile-nav-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.mobile-nav-actions .btn-outline,
.mobile-nav-actions .btn-primary {
  flex: 1;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  min-height: 85vh;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.hero-blob-1 {
  top: -10rem;
  right: -10rem;
  width: 20rem;
  height: 20rem;
  background: hsla(175, 60%, 40%, 0.1);
}

.hero-blob-2 {
  top: 50%;
  left: -10rem;
  width: 15rem;
  height: 15rem;
  background: hsla(30, 90%, 60%, 0.1);
}

.hero-blob-3 {
  bottom: 0;
  right: 25%;
  width: 10rem;
  height: 10rem;
  background: hsla(260, 60%, 60%, 0.1);
}

.hero-content {
  position: relative;
  padding: 1rem 0;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 1rem 0;
  }
}

@media (min-width: 1024px) {
  .hero-content {
    padding: 1rem 0;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: hsla(175, 60%, 40%, 0.1);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  opacity: 1;
  transform: translateY(0);
  animation: none;
  contain: layout paint;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--fg-muted);
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

.search-container {
  position: relative;
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  min-height: 64px;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 4rem;
}

@media (min-width: 768px) {
  .hero-stats {
    gap: 4rem;
  }
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--fg);
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 2.25rem;
  }
}

.stat-label {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .badge {
    animation: fadeInUp 0.5s ease forwards;
  }

  .search-container,
  .hero-buttons,
  .hero-stats {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
  }

  .search-container {
    animation-delay: 0.15s;
  }

  .hero-buttons {
    animation-delay: 0.25s;
  }

  .hero-stats {
    animation-delay: 0.35s;
  }
}

.tools-section {
  padding: 1rem 0;
  background: hsla(45, 20%, 92%, 0.3);
}

@media (min-width: 768px) {
  .tools-section {
    padding: 6rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 3rem;
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: 4rem;
  }
}

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.875rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 3rem;
  }
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--fg-muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.tool-card {
  position: relative;
  display: block;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  overflow: hidden;
}

.tool-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.tool-badge-new {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--destructive);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 4px 12px hsla(0, 84%, 60%, 0.3);
}

.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.tool-icon-primary {
  background: hsla(175, 60%, 40%, 0.1);
  color: var(--primary);
}

.tool-card:hover .tool-icon-primary {
  background: var(--gradient-primary);
  color: var(--primary-fg);
}

.tool-icon-secondary {
  background: hsla(30, 90%, 60%, 0.1);
  color: var(--secondary);
}

.tool-card:hover .tool-icon-secondary {
  background: var(--gradient-secondary);
  color: var(--secondary-fg);
}

.tool-icon-accent {
  background: hsla(260, 60%, 60%, 0.1);
  color: var(--accent);
}

.tool-card:hover .tool-icon-accent {
  background: var(--gradient-accent);
  color: var(--accent-fg);
}

.tool-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.tool-card:hover .tool-title {
  color: var(--primary);
}

.tool-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.tool-cta {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover .tool-cta {
  opacity: 1;
}

.features-section {
  padding: 4rem 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .features-section {
    padding: 5rem 0;
  }
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
  }
}

.feature {
  text-align: center;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  color: var(--primary-fg);
  box-shadow: var(--shadow-soft);
}

.feature-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.worksheets-section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .worksheets-section {
    padding: 4rem 0;
  }
}

.worksheets-section-alt {
  background: hsla(45, 20%, 92%, 0.3);
}

.section-header-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .section-header-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-title-sm {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .section-title-sm {
    font-size: 1.875rem;
  }
}

.section-desc {
  color: var(--fg-muted);
  max-width: 42rem;
}

.worksheets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .worksheets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .worksheets-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.worksheet-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.worksheet-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-8px);
}

.worksheet-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
}

.worksheet-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.worksheet-card:hover .worksheet-image img {
  transform: scale(1.05);
}

.worksheet-content {
  padding: 1rem;
}

.worksheet-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

@media (min-width: 768px) {
  .worksheet-title {
    font-size: 1rem;
  }
}

.worksheet-card:hover .worksheet-title {
  color: var(--primary);
}

.about-section {
  padding: 4rem 0;
  background: hsla(45, 20%, 92%, 0.3);
}

@media (min-width: 768px) {
  .about-section {
    padding: 6rem 0;
  }
}

.about-content {
  max-width: 56rem;
  margin: 0 auto;
  text-align: center;
}

.about-text {
  font-size: 1.125rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.about-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .about-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-card {
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.about-emoji {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.about-card p {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer {
  padding: 3rem 0;
  background: var(--fg);
  color: var(--bg);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-logo .logo-icon {
  background: var(--primary);
}

.footer-logo .logo-text {
  display: block;
  color: var(--bg);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: hsla(45, 30%, 98%, 0.7);
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--bg);
}

.footer-copy {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: hsla(45, 30%, 98%, 0.6);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background: hsla(175, 60%, 40%, 0.3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(175, 60%, 40%, 0.5);
}

.gcse-wrap .gsc-search-button {
  margin-left: 12px;
}

.gcse-wrap button.gsc-search-button-v2 {
  border-radius: 9999px;
  background: #22b8a9;
  border: none;
  height: 48px;
  width: 110px;
  box-shadow: 0 6px 14px rgba(34, 184, 169, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gcse-wrap button.gsc-search-button-v2:hover {
  background: #1fa89b;
}

.gcse-wrap button.gsc-search-button-v2 svg {
  fill: white;
  width: 20px;
  height: 20px;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
a,
button {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.hero-subtitle,
.section-subtitle,
.tool-desc,
.feature-desc,
.about-text,
.category-text,
.section-desc,
.footer-nav a {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.hero-content,
.tools-section,
.features-section,
.worksheets-section,
.about-section,
.footer {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
