/* ============================================================
   Word Tiles Puzzle - Stylesheet
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --color-primary: #ff6b35;
  --color-secondary: #00b4a6;
  --color-accent: #ffb627;
  --color-dark: #1f2d3d;
  --color-text: #2c3e50;
  --color-muted: #6b7c93;
  --color-bg: #ffffff;
  --color-bg-soft: #f6f9fc;
  --color-bg-warm: #fff7f0;
  --color-white: #ffffff;
  --color-border: #e6edf3;

  --shadow-sm: 0 2px 8px rgba(31, 45, 61, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 45, 61, 0.10);
  --shadow-lg: 0 18px 50px rgba(31, 45, 61, 0.16);

  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --maxw: 1140px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
  position: relative;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(255, 107, 53, 0.45);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-dark);
  box-shadow: 0 10px 24px rgba(255, 182, 39, 0.4);
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(255, 182, 39, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  transform: translateY(-3px);
}

/* ---------- Tag ---------- */
.tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: rgba(0, 180, 166, 0.1);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.tag-light {
  color: var(--color-dark);
  background: rgba(255, 255, 255, 0.85);
}

/* ---------- Section Heading ---------- */
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1.2;
}

.section-sub {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 1.08rem;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s var(--ease), padding 0.3s var(--ease),
    background 0.3s var(--ease);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.95);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-dark);
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.2s var(--ease);
  position: relative;
}

.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.25s var(--ease);
}

.nav-links a:not(.btn):hover {
  color: var(--color-primary);
}

.nav-links a:not(.btn):hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 140px 0 110px;
  background: linear-gradient(160deg, var(--color-bg-warm) 0%, var(--color-bg-soft) 55%, var(--color-white) 100%);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  margin-bottom: 16px;
}

.hero-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 5px;
  border-radius: 3px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 18px;
}

.hero-desc {
  color: var(--color-muted);
  font-size: 1.08rem;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-media {
  position: relative;
}

.hero-banner {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.5deg);
  transition: transform 0.5s var(--ease);
}

.hero-media:hover .hero-banner {
  transform: rotate(0deg) scale(1.01);
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: -18px -18px 30px -18px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.18), rgba(0, 180, 166, 0.18));
  border-radius: var(--radius-lg);
  z-index: -1;
  filter: blur(8px);
}

/* ============================================================
   Features
   ============================================================ */
.features {
  background: var(--color-bg-soft);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.6;
  letter-spacing: 0.1em;
}

.feature-icon {
  font-size: 2.6rem;
  margin: 14px 0 18px;
  line-height: 1;
}

.feature-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 10px;
}

.feature-desc {
  color: var(--color-muted);
  font-size: 1rem;
}

/* ============================================================
   Screenshots
   ============================================================ */
.screenshots {
  background: var(--color-white);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.shot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.shot:nth-child(4),
.shot:nth-child(5) {
  grid-column: span 1;
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.shot figcaption {
  padding: 16px 20px;
  font-weight: 700;
  color: var(--color-dark);
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.shot:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.shot:hover img {
  transform: scale(1.05);
}

/* ============================================================
   CTA
   ============================================================ */
.cta {
  background: linear-gradient(135deg, var(--color-primary), #ff8a5b);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.cta::before,
.cta::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.cta::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
}

.cta::after {
  width: 240px;
  height: 240px;
  bottom: -100px;
  left: -60px;
}

.cta-inner {
  position: relative;
  text-align: center;
  max-width: 680px;
}

.cta-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.cta-desc {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.12rem;
  margin-bottom: 32px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 56px 0;
}

.footer-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-white);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.footer-brand .nav-logo {
  box-shadow: none;
}

.footer-tag {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.footer-link {
  font-size: 0.95rem;
}

.footer-copy {
  margin-top: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   Reveal Animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1023px) {
  .hero-inner {
    gap: 40px;
  }

  .feature-grid {
    gap: 22px;
  }
}

@media (max-width: 900px) {
  section {
    padding: 72px 0;
  }

  .hero {
    padding: 120px 0 80px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .hero-text {
    order: 2;
  }

  .hero-media {
    order: 1;
    max-width: 520px;
    margin: 0 auto;
  }

  .hero-title::after {
    margin: 18px auto 0;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }

  .shot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shot:nth-child(5) {
    grid-column: span 2;
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
    border-top: 1px solid var(--color-border);
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links a {
    width: 100%;
    padding: 14px 24px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links a:not(.btn)::after {
    display: none;
  }

  .nav-links .btn {
    margin: 14px 24px;
    width: calc(100% - 48px);
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 18px;
  }

  section {
    padding: 60px 0;
  }

  .hero {
    padding: 110px 0 60px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .shot-grid {
    grid-template-columns: 1fr;
  }

  .shot:nth-child(5) {
    grid-column: span 1;
  }

  .section-head {
    margin-bottom: 40px;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
