/* =========================================================================
   AHMAD AGENCY — STYLESHEET
   Organized top to bottom: tokens → base → layout → components → sections →
   responsive → motion/accessibility. Section markers match index.html IDs.
   ========================================================================= */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Color: a cartography palette — ink background, gold "compass" accent for
     action, teal "route" accent for connection/paths, warm parchment text. */
  --bg: #0F1219;
  --surface: #171B24;
  --surface-raised: #1D2330;
  --border: #2A3140;
  --text: #ECE7DC;
  --text-muted: #97A0AE;
  --text-faint: #626A78;
  --gold: #E3B23C;
  --gold-dim: #8A6B2C;
  --teal: #3FA7A0;
  --teal-dim: #24605C;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --gap: clamp(1rem, 2vw, 1.75rem);
  --radius: 4px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- 3. TYPE SCALE ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--teal);
  margin: 0 0 0.9rem;
}

.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  max-width: 22ch;
}

.section-lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 62ch;
  margin-top: 1rem;
}

.section-head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* ---------- 4. HEADER / NAV ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 18, 25, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand img { height: 30px; width: auto; }

.nav-links {
  display: flex;
  gap: clamp(1rem, 2vw, 1.9rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.94rem;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 1.25rem;
}
.mobile-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gold);
  color: #17130A;
  font-weight: 600;
}
.btn-primary:hover { background: #edc158; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-muted); }

.btn-block { width: 100%; justify-content: center; }

/* ---------- 6. HERO ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-headline {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.015em;
}

.hero-headline .line-2 { color: var(--gold); }

.hero-sub {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-ctas {
  margin-top: 2.2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  width: 100%;
  height: auto;
}

/* ---------- 7. GAME DEV VS MARKETING ---------- */
.flow-vertical {
  display: grid;
  gap: 0;
  max-width: 560px;
  margin-inline: auto;
}

.flow-step {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  text-align: center;
}

.flow-step h3 {
  font-size: 1.15rem;
  color: var(--text);
}
.flow-step p { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.95rem; }

.flow-step.is-accent { border-color: var(--teal-dim); }
.flow-step.is-final { border-color: var(--gold-dim); }

.flow-arrow {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
  color: var(--text-faint);
}

/* ---------- 8. MARKETING SYSTEM (process) ---------- */
.system-track {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.6rem;
  position: relative;
}

.system-track::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 4%;
  right: 4%;
  height: 1px;
  background: linear-gradient(90deg, var(--teal-dim), var(--gold-dim));
}

.system-stage {
  position: relative;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.stage-marker {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--teal);
  position: relative;
  z-index: 1;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.system-stage[aria-expanded="true"] .stage-marker {
  border-color: var(--gold);
  color: var(--gold);
}

.stage-name {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.stage-detail {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 24ch;
  display: none;
}

.system-stage[aria-expanded="true"] .stage-detail { display: block; }

/* ---------- 9. SERVICES ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
}

.service-card .num {
  font-family: var(--font-display);
  color: var(--teal);
  font-size: 0.95rem;
}

.service-card h3 {
  margin-top: 0.5rem;
  font-size: 1.2rem;
}

.service-card .note {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.service-card details {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.service-card summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--gold);
  list-style: none;
}
.service-card summary::-webkit-details-marker { display: none; }
.service-card summary::after { content: " — show details"; color: var(--text-faint); }
.service-card details[open] summary::after { content: " — hide details"; }

.service-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.service-card li { margin-bottom: 0.35rem; }

/* ---------- 10. LIFECYCLE BAND ---------- */
.lifecycle {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lifecycle-track {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 2rem;
}

.lifecycle-stage {
  flex: 1 1 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  background: var(--bg);
}

.lifecycle-stage h4 { font-size: 1.05rem; }
.lifecycle-stage p { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.88rem; }

.lifecycle-includes {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lifecycle-includes span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- 11. CASE STUDIES ---------- */
.case-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.case-card figure { margin: 0; }
.case-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.case-card-body { padding: 1.6rem; }
.case-card-body .eyebrow { margin-bottom: 0.5rem; }

.case-study-detail {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 3.5rem);
}

.case-block h3 {
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}

.case-block p, .case-block li {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin-right: 0.4rem;
  margin-bottom: 0.6rem;
}
.tag-observation { background: rgba(63,167,160,0.15); color: var(--teal); border: 1px solid var(--teal-dim); }
.tag-recommendation { background: rgba(227,178,60,0.13); color: var(--gold); border: 1px solid var(--gold-dim); }

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

.gallery button {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: none;
  cursor: zoom-in;
}
.gallery img { aspect-ratio: 4/3; object-fit: cover; }

.player-journey {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.player-journey span.step {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.player-journey span.sep { color: var(--text-faint); }

.developer-feedback {
  border-left: 2px solid var(--gold-dim);
  padding-left: 1.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}
.developer-feedback cite {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,12,17,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(90vw, 900px); max-height: 85vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

/* ---------- 12. TESTIMONIALS ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
}

.testimonial-card blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
}

.testimonial-meta {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.testimonial-meta img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border);
}

.testimonial-meta .name { font-weight: 600; font-size: 0.92rem; }
.testimonial-meta .role { color: var(--text-muted); font-size: 0.82rem; }

.testimonial-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- 13. ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-lens {
  display: grid;
  gap: 1rem;
}

.lens-item {
  border-left: 2px solid var(--teal-dim);
  padding-left: 1rem;
}
.lens-item h4 { font-size: 1.05rem; }
.lens-item p { color: var(--text-muted); margin-top: 0.3rem; font-size: 0.92rem; }

/* ---------- 14. CONTACT ---------- */
.contact-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-channels {
  display: grid;
  gap: 0.9rem;
}

.contact-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s var(--ease);
}
.contact-channel:hover { border-color: var(--gold-dim); }
.contact-channel .label { color: var(--text-muted); font-size: 0.85rem; }
.contact-channel .value { font-size: 1rem; }

/* ---------- 15. FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem 2rem;
}

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

.footer-brand { max-width: 32ch; }
.footer-brand img { height: 26px; margin-bottom: 0.9rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.footer-nav a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--text); }

.footer-socials {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.footer-socials a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-socials a:hover { color: var(--text); border-color: var(--text-muted); }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ---------- 16. SHARED SECTION SPACING ---------- */
section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.bordered-top { border-top: 1px solid var(--border); }

/* ---------- 17. SCROLL REVEAL (single orchestrated moment) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 18. RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }

  .system-track { grid-template-columns: 1fr; gap: 1.6rem; }
  .system-track::before { display: none; }
  .system-stage { display: flex; align-items: flex-start; gap: 1rem; }
  .stage-name { margin-top: 0; }
  .stage-detail { max-width: none; }

  .lifecycle-track { flex-direction: column; }
}

@media (max-width: 560px) {
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .hero-ctas { flex-direction: column; }
}
