/* ─────────────────────────────────────────────
   Harfak — Design System
   ───────────────────────────────────────────── */

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

:root {
  --amber:      #F5A623;
  --deep-amber: #C47D0E;
  --cream:      #FFF8ED;
  --ink:        #1A1207;
  --muted:      #7A6A50;
  --tile-bg:    #FFFFFF;
  --tile-border:#E8D5B0;
  --section-gap: 6rem;
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
}

img { display: block; max-width: 100%; }

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

/* ─── Typography scale ───────────────────────── */
h1 { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.2rem; font-weight: 700; }
p  { font-size: 1.05rem; color: var(--muted); }

/* ─── Layout helpers ─────────────────────────── */
.container {
  width: 90%;
  max-width: 860px;
  margin-inline: auto;
}

section {
  padding-block: var(--section-gap);
}

/* ─────────────────────────────────────────────
   LETTER TILES — Signature Element
   ───────────────────────────────────────────── */
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background: var(--tile-bg);
  border: 2px solid var(--tile-border);
  border-radius: 10px;
  box-shadow:
    0 3px 0 var(--tile-border),
    0 4px 12px rgba(0,0,0,0.08);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  user-select: none;
}

.tile--amber {
  background: var(--amber);
  border-color: var(--deep-amber);
  box-shadow: 0 3px 0 var(--deep-amber), 0 4px 12px rgba(245,166,35,0.25);
  color: #fff;
}

/* ─────────────────────────────────────────────
   NAV
   ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 237, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tile-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}

.nav__logo .tile {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  border-radius: 6px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav__links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav__links a:hover { color: var(--ink); }

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s;
}

.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 600px) {
  .nav__toggle { display: flex; }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--tile-border);
    padding: 1rem 5%;
  }

  .nav__links.open { display: flex; }

  .nav__links li { width: 100%; }

  .nav__links a {
    display: block;
    padding-block: 0.6rem;
    border-bottom: 1px solid var(--tile-border);
    font-size: 1rem;
  }

  .nav__links li:last-child a { border-bottom: none; }
}

/* ─────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────── */
.hero {
  padding-block: 5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero__tiles {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero__tiles .tile:nth-child(1) { transform: rotate(-6deg) translateY(4px); }
.hero__tiles .tile:nth-child(2) { transform: rotate(3deg) translateY(-3px); }
.hero__tiles .tile:nth-child(3) { transform: rotate(-2deg) translateY(6px); }
.hero__tiles .tile:nth-child(4) { transform: rotate(5deg) translateY(-2px); }
.hero__tiles .tile:nth-child(5) { transform: rotate(-4deg) translateY(3px); }

.hero__badge {
  display: inline-block;
  background: var(--amber);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 1.2rem;
}

.hero h1 span {
  color: var(--amber);
}

.hero__sub {
  font-size: 1.15rem;
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
  color: var(--muted);
}

.hero__cta {
  display: inline-block;
  background: var(--amber);
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2.4rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--deep-amber), 0 6px 20px rgba(245,166,35,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--deep-amber), 0 8px 24px rgba(245,166,35,0.35);
}

.hero__cta:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--deep-amber), 0 3px 12px rgba(245,166,35,0.2);
}

/* ─────────────────────────────────────────────
   ABOUT
   ───────────────────────────────────────────── */
.about {
  background: var(--tile-bg);
  border-top: 1px solid var(--tile-border);
  border-bottom: 1px solid var(--tile-border);
}

.about__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}

.about h2 { margin-bottom: 0.4rem; }

.about p { max-width: 580px; font-size: 1.1rem; }

/* ─────────────────────────────────────────────
   FEATURES
   ───────────────────────────────────────────── */
.features__header {
  text-align: center;
  margin-bottom: 3rem;
}

.features__header p {
  margin-top: 0.5rem;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--amber);
  opacity: 0.06;
  border-radius: 0 16px 0 60px;
}

.feature-card .tile {
  margin-bottom: 1rem;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.1rem;
  border-radius: 8px;
}

.feature-card h3 { margin-bottom: 0.4rem; }

/* ─────────────────────────────────────────────
   HOW TO PLAY
   ───────────────────────────────────────────── */
.how {
  background: var(--tile-bg);
  border-top: 1px solid var(--tile-border);
  border-bottom: 1px solid var(--tile-border);
}

.how__header {
  text-align: center;
  margin-bottom: 3rem;
}

.how__steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
  margin-inline: auto;
}

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

.step__num {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--deep-amber);
  margin-top: 0.15rem;
}

.step__body h3 { margin-bottom: 0.2rem; color: var(--ink); }
.step__body p  { font-size: 0.97rem; }

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--tile-border);
  text-align: center;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s;
}

.footer__links a:hover { color: var(--ink); }

.footer__copy {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────────
   PRIVACY PAGE
   ───────────────────────────────────────────── */
.privacy-page {
  direction: ltr;
  text-align: left;
}

.privacy-page .nav,
.privacy-page .footer {
  direction: rtl;
  text-align: right;
}

.privacy-content {
  padding-block: 4rem 6rem;
  max-width: 720px;
  margin-inline: auto;
  width: 90%;
}

.privacy-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.privacy-content .last-updated {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.privacy-section {
  margin-bottom: 2.5rem;
}

.privacy-section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--tile-border);
}

.privacy-section p,
.privacy-section li {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.privacy-section ul {
  padding-left: 1.4rem;
  margin-top: 0.4rem;
}

.placeholder-block {
  background: var(--tile-bg);
  border: 1.5px dashed var(--tile-border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}

/* ─────────────────────────────────────────────
   Reduced motion
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero__cta, .hero__tiles .tile { transition: none; transform: none !important; }
  html { scroll-behavior: auto; }
}
