@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

/* ==========================================
   DESIGN TOKENS & SYSTEM PROPERTIES
   ========================================== */
:root {
  /* Color Scheme - Koyu Safir & Kehribar Balı */
  --color-bg-deep: #0A1128;
  --color-bg-sapphire: #0F1E36;
  --color-bg-card: rgba(15, 30, 54, 0.65);
  
  --color-amber-light: #F7D098;
  --color-amber-mid: #FF9F1C;
  --color-amber-dark: #A06227;
  
  --color-text-white: #FFFFFF;
  --color-text-slate: #94A3B8;
  --color-text-muted: #64748B;
  
  --color-border-glass: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 159, 28, 0.3);
  
  /* Wood Tile Specific Tokens */
  --tile-wood-gradient: linear-gradient(135deg in oklch, #FFE6C7 0%, #F7D098 50%, #D8923D 100%);
  --tile-wood-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 6px rgba(0, 0, 0, 0.4),
    0 2px 2px rgba(160, 98, 39, 0.6);
  --cell-pocket-shadow: 
    inset 2px 2px 5px rgba(0, 0, 0, 0.6),
    inset -1px -1px 2px rgba(255, 255, 255, 0.05);

  /* Fonts */
  --font-family-title: 'Outfit', 'Inter', sans-serif;
  --font-family-body: 'Inter', sans-serif;
  
  /* Animation Timing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================
   RESET & FOUNDATIONS
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family-body);
  background-color: var(--color-bg-deep);
  color: var(--color-text-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 80% 10%, rgba(255, 159, 28, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(30, 62, 98, 0.2) 0%, transparent 50%);
}

h1, h2, h3, h4 {
  font-family: var(--font-family-title);
  font-weight: 700;
  margin-block: 0;
  color: var(--color-text-white);
  letter-spacing: -0.02em;
}

p {
  margin-block: 0;
  color: var(--color-text-slate);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

/* ==========================================
   GLASSMORPHISM & PREMIUM UI ELEMENTS
   ========================================== */
.glass-panel {
  background-color: var(--color-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-glass);
  border-radius: 24px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 159, 28, 0.15);
}

/* Interactive elements focus rings */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-amber-mid);
  outline-offset: 4px;
}

/* ==========================================
   HEADER / NAVIGATION
   ========================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 1rem;
  background-color: rgba(10, 17, 40, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--color-border-glass);
}

.nav-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-text-white);
}

.logo span {
  color: var(--color-amber-mid);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text {
  display: inline-block;
}

.logo-tile {
  background: var(--tile-wood-gradient);
  color: #5C3814;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 1.2rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-slate);
}

.nav-link:hover {
  color: var(--color-amber-mid);
}

.nav-btn {
  background: linear-gradient(135deg, var(--color-amber-mid) 0%, var(--color-amber-dark) 100%);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 159, 28, 0.25);
  font-size: 0.9rem;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.35);
}

/* Language Selector */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-selector {
  position: relative;
  display: inline-block;
}

.lang-btn {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-white);
  border: 1px solid var(--color-border-glass);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: #0F1E36;
  border: 1px solid var(--color-border-glass);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.lang-selector.active .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown,
.lang-dropdown li {
  list-style: none !important;
  list-style-type: none !important;
  width: 100%;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text-slate);
  transition: var(--transition-smooth);
}

.lang-dropdown a:hover {
  background-color: rgba(255, 159, 28, 0.1);
  color: var(--color-text-white);
}

.flag-icon {
  font-size: 1rem;
}

/* ==========================================================
   HERO SECTION
   ========================================== */
.hero-section {
  padding-block-start: 8rem;
  padding-block-end: 4rem;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-badge {
  align-self: flex-start;
  background-color: rgba(255, 159, 28, 0.1);
  border: 1px solid rgba(255, 159, 28, 0.2);
  color: var(--color-amber-mid);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  line-height: 1.1;
  text-wrap: balance;
}

.hero-title span {
  background: linear-gradient(to right, var(--color-amber-light), var(--color-amber-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
  max-width: 500px;
}

.download-badges {
  display: flex;
  gap: 1rem;
  margin-block-start: 1rem;
}

.badge-btn {
  height: 48px;
  transition: transform var(--transition-smooth);
}

.badge-btn:hover {
  transform: scale(1.05);
}

.badge-btn img {
  height: 100%;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.mockup-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.mockup-img {
  width: 100%;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-border-glass);
}

/* Ambient light glow behind the device */
.hero-visual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 159, 28, 0.15) 0%, transparent 60%);
  z-index: -1;
  filter: blur(30px);
}

/* ==========================================
   INTERACTIVE DEMO / PLAYABLE BOARD
   ========================================== */
.demo-section {
  padding-block: 6rem;
  background-color: rgba(15, 30, 54, 0.3);
  border-block: 1px solid var(--color-border-glass);
}

.section-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
  margin-block-end: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.section-desc {
  font-size: 1.1rem;
}

.demo-grid-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.interactive-demo-card {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
}

/* 4x4 Mini Scrabble Board */
.demo-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  background: #14223A;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
}

.demo-cell {
  background: #0B1323;
  border-radius: 8px;
  box-shadow: var(--cell-pocket-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color var(--transition-smooth);
}

.demo-cell.drag-over {
  background-color: rgba(255, 159, 28, 0.15);
  border: 1px dashed var(--color-amber-mid);
}

/* Bonus Labels inside Cells */
.cell-bonus {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 0.75rem;
  opacity: 0.35;
  letter-spacing: 0.05em;
}

.cell-bonus.double-word { color: #E5C384; }
.cell-bonus.triple-word { color: #E63946; }
.cell-bonus.triple-letter { color: #457B9D; }

/* 3D Wooden Tile Styles */
.demo-tile {
  background: var(--tile-wood-gradient);
  color: #5C3814;
  border-radius: 8px;
  box-shadow: var(--tile-wood-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.6rem;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  position: relative;
  transition: transform 0.1s ease;
}

.demo-tile:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.tile-score {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Rack Container */
.demo-rack-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.rack-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

.demo-rack {
  display: flex;
  gap: 8px;
  background: linear-gradient(to bottom, #1B2C46 0%, #111E30 100%);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  min-height: 72px;
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

.rack-slot {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Action Buttons */
.demo-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}

.demo-btn {
  flex: 1;
  border: none;
  padding: 0.9rem;
  border-radius: 12px;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--ease-spring) 0.2s transform, var(--transition-smooth) box-shadow, var(--transition-smooth) background-color;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-btn.primary {
  background: linear-gradient(135deg, var(--color-amber-mid) 0%, var(--color-amber-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 159, 28, 0.25);
}

.demo-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
}

.demo-btn.secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-white);
  border: 1px solid var(--color-border-glass);
}

.demo-btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.demo-btn:active {
  transform: scale(0.98);
}

.demo-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Particle Canvas Overlay */
#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  border-radius: 24px;
}

/* Tutorial Text Column */
.demo-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.demo-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  background-color: rgba(255, 159, 28, 0.1);
  color: var(--color-amber-mid);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-title);
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ==========================================
   FEATURES GRID
   ========================================== */
.features-section {
  padding-block: 8rem;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-badge-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--color-amber-mid);
  box-shadow: 0 6px 16px rgba(255, 159, 28, 0.25);
  margin-block-end: 0.5rem;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background-color: rgba(255, 159, 28, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-amber-mid);
  font-size: 1.5rem;
  margin-block-end: 0.5rem;
}

.feature-title {
  font-size: 1.3rem;
}

/* ==========================================
   LETTERS & SCORES SECTION
   ========================================== */
.rules-section {
  padding-block: 6rem;
  background-color: rgba(15, 30, 54, 0.25);
  border-block: 1px solid var(--color-border-glass);
}

.score-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 800px;
  margin-inline: auto;
  margin-block-start: 3rem;
}

.score-tile {
  background: var(--tile-wood-gradient);
  color: #5C3814;
  font-family: var(--font-family-title);
  font-weight: 800;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--tile-wood-shadow);
  font-size: 1.3rem;
}

.score-tile .tile-score {
  font-size: 0.55rem;
  bottom: 2px;
  right: 4px;
}

/* ==========================================
   FOOTER & LEGAL
   ========================================== */
.main-footer {
  background-color: #050A18;
  padding-block: 4rem 2rem;
  border-top: 1px solid var(--color-border-glass);
}

.footer-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-desc {
  font-size: 0.95rem;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--color-text-slate);
}

.footer-link:hover {
  color: var(--color-amber-mid);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border-glass);
  padding-block-start: 2rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ==========================================
   LEGAL PAGES STYLING (privacy / terms)
   ========================================== */
.legal-body {
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 159, 28, 0.04) 0%, transparent 55%);
}

.legal-section {
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block: 8rem 4rem;
}

.legal-header {
  margin-block-end: 3rem;
  border-bottom: 1px solid var(--color-border-glass);
  padding-block-end: 1.5rem;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  color: var(--color-text-slate);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-content h2 {
  font-size: 1.5rem;
  color: var(--color-text-white);
  margin-block-start: 1rem;
}

.legal-content ul {
  padding-inline-start: 1.5rem;
  margin-block: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */
@media (max-width: 968px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding-block-start: 6rem;
  }
  
  .hero-badge {
    align-self: center;
  }
  
  .hero-desc {
    margin-inline: auto;
  }
  
  .download-badges {
    justify-content: center;
  }
  
  .demo-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .interactive-demo-card {
    order: 2;
  }
  
  .demo-info {
    order: 1;
  }
  
  .footer-top {
    flex-direction: column;
    gap: 3rem;
  }
}

@media (max-width: 576px) {
  .nav-menu {
    display: none;
  }
  
  .download-badges {
    flex-direction: column;
    align-items: center;
  }
  
  .badge-btn {
    width: 160px;
    height: auto;
  }
  
  .demo-board {
    max-width: 280px;
    gap: 6px;
    padding: 8px;
  }
  
  .demo-tile {
    font-size: 1.3rem;
  }
  
  .demo-rack {
    max-width: 280px;
    gap: 6px;
    min-height: 64px;
  }
  
  .rack-slot {
    width: 44px;
    height: 44px;
  }
  
  .demo-actions {
    max-width: 280px;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
