/* ==========================================================
   MA9 DEVELOPMENT — style.css (LIGHT THEME)
   Single source of truth: design tokens + base + nav + hero.
   (Only the 3D stage visuals live in 3d.css / 3d.js.)
   ========================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  --bg:         #FAF9F7;               /* page background (warm white)     */
  --surface:    #FFFFFF;               /* raised surfaces / cards          */
  --surface-2:  #F1EFEB;               /* hover fills, thumb placeholders  */
  --line:       rgba(20, 18, 16, .12); /* hairline borders                 */

  --red:        #FF4142;               /* brand accent — DO NOT CHANGE     */
  --red-deep:   #B01E1F;               /* buttons / text-on-light red      */
  --red-press:  #99191A;               /* pressed / hover state            */
  --red-tint:   rgba(255, 65, 66, .08);/* subtle red wash                  */

  --text:       #1B1917;               /* primary text                     */
  --text-dim:   rgba(27, 25, 23, .64); /* secondary text                   */

  --shadow-card: 0 1px 2px rgba(20,18,16,.05), 0 6px 24px rgba(20,18,16,.06);

  --font-main:  'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --nav-h: 72px;
  --radius: 10px;
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
img, canvas { max-width: 100%; }

/* Anchor targets land below the fixed nav */
section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Visible keyboard focus — accessibility floor */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red-deep);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* Skip link: hidden until focused with the keyboard */
.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--red-deep);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 3. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;                    /* comfortable tap target */
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.btn:active { transform: scale(.97); }

/* Solid red — primary action.
   Fon --red-deep saxlanılır ki, ağ mətn AA kontrastını keçsin. */
.btn--primary {
  background: var(--red-deep);
  color: #fff;
  border: 1px solid var(--red-deep);
  box-shadow: 0 4px 16px rgba(255, 65, 66, .28);
}
.btn--primary:hover {
  background: var(--red-press);
  border-color: var(--red-press);
  box-shadow: 0 4px 22px rgba(255, 65, 66, .38);
}

/* Outlined — secondary action */
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  border-color: var(--red-deep);
  color: var(--red-deep);
  background: var(--red-tint);
}

/* Compact variant — card actions */
.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.82rem;
}

/* ---------- 4. NAVIGATION ---------- */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding-inline: clamp(16px, 4vw, 40px);
  background: rgba(250, 249, 247, .85);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-logo { height: 40px; width: auto; display: block; }

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;          /* centres the links between logo & actions */
}
.menu a {
  display: block;
  padding: 8px 14px;
  border: 1px solid transparent;   /* is-active border layout-u tərpətməsin */
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .2s ease, background-color .2s ease;
}
.menu a:hover { color: var(--text); background: var(--surface-2); }
.menu a.is-active {
  color: var(--red-deep);
  border: 1px solid var(--red);
  background: var(--red-tint);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---------- 5. LANGUAGE SWITCH (segmented pill) ---------- */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch button,
.lang-switch a {                /* <a> = real links per language (SEO, no-JS) */
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: background-color .2s ease, color .2s ease;
}
.lang-switch button:hover,
.lang-switch a:hover { color: var(--text); }
.lang-switch button.is-active,
.lang-switch a.is-active {
  background: var(--red-deep);
  color: #fff;
}

/* ---------- 6. HAMBURGER ---------- */
.hamburger {
  display: none;                 /* shown on mobile only */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 8px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .2s ease;
}
/* bars → X when open */
nav.is-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.is-open .hamburger span:nth-child(2) { opacity: 0; }
nav.is-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. MOBILE NAV ---------- */
@media (max-width: 1025px) {
  .menu,
  .nav-actions { display: none; }

  .hamburger { display: flex; margin-left: auto; }

  /* Slide-down panel under the bar */
  .nav-panel {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px clamp(16px, 4vw, 40px) 24px;
    max-height: calc(100svh - var(--nav-h));   /* kiçik ekranlarda scroll */
    overflow-y: auto;
    background: rgba(250, 249, 247, .97);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
  }
  nav.is-open + .nav-panel {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-panel a:not(.btn) {
    padding: 14px 4px;                 /* ≥44px tap target */
    font-weight: 500;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
  }
  .nav-panel a:not(.btn):hover { color: var(--text); }

  .nav-panel .btn { margin-top: 14px; }
  .nav-panel .lang-switch { margin-top: 14px; align-self: flex-start; }
}

@media (min-width: 1026px) {
  .nav-panel { display: none; }
}

/* ---------- 8. HERO LAYOUT ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: calc(var(--nav-h) + 40px) clamp(20px, 5vw, 72px) 64px;
  max-width: 1440px;
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero__lead {
  margin-top: 20px;
  max-width: 56ch;
  font-size: clamp(.95rem, 1.4vw, 1.05rem);
  color: var(--text-dim);
}

.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;                 /* mobil-də süni boşluq qalmasın */
    text-align: center;
    padding-top: calc(var(--nav-h) + 12px);
    gap: 8px;
  }
  .hero__stage { order: -1; }        /* 3D model first — it's the hook */
  .hero__lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
}

/* ---------- 9. SECTION BASE ---------- */
.section {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
}

.section__kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-deep);            /* açıq fonda AA kontrast üçün    */
}

.section__title {
  margin-top: 10px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.section__lead {
  margin-top: 12px;
  max-width: 58ch;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.section__head--center {
  text-align: center;
}
.section__head--center .section__lead { margin-inline: auto; }

/* "All projects" / "All articles" link under a grid */
.section__more {
  margin-top: 32px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.section__head--center .section__more {
  display: flex;
  justify-content: center;
}

/* ---------- 10. ABOUT ---------- */
.about-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.about-copy p {
  color: var(--text-dim);
  font-size: 0.95rem;
}
.about-copy p + p { margin-top: 16px; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat {
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.stat b {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--red-deep);
}
.stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

/* ---------- 11. PORTFOLIO ---------- */
.work-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.work-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.work-card:hover {
  border-color: rgba(255, 65, 66, .5);
  box-shadow: 0 8px 30px rgba(20, 18, 16, .10);
}

.work-card__thumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--surface-2), #E7E4DE);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--text-dim);
}
/* real screenshot dropped in later just works: */
.work-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}
.work-card__title { font-size: 1.05rem; font-weight: 600; }
.work-card__desc  { flex: 1; font-size: 0.88rem; color: var(--text-dim); }
.work-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- 12. SERVICES ---------- */
.service-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.service-card:hover {
  border-color: rgba(255, 65, 66, .5);
  box-shadow: 0 8px 30px rgba(20, 18, 16, .10);
}

.service-card p { flex: 1; }

.service-card__link {
  margin-top: 16px;
  align-self: flex-end;
}

/* 3D ikon (icons3d.js bir dəfə render edir) */
.service-card__icon {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
}

.service-card h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.service-card p  { margin-top: 8px; font-size: 0.88rem; color: var(--text-dim); }

/* ---------- 13. FORM FIELDS (shared: test + contact) ---------- */
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}
.req      { color: var(--red-deep); }
.optional { font-weight: 400; opacity: .8; }

.field {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color .2s ease;
}
.field::placeholder { color: var(--text-dim); }
.field:focus {
  outline: none;
  border-color: var(--red-deep);
  box-shadow: 0 0 0 3px var(--red-tint);
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

textarea.field {
  min-height: 140px;
  resize: vertical;
}

/* ---------- 14. TEST YOUR WEBSITE ---------- */
.test-box {
  max-width: 720px;
  margin: 40px auto 0;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.test-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.test-note {
  margin-top: 14px;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-dim);
}
.test-note a {
  color: var(--red-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.test-error {
  display: none;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--red-deep);
}
.test-error.is-visible { display: block; }

/* ---------- 15. CONTACT (form only) ---------- */
.contact-form {
  max-width: 720px;
  margin: 40px auto 0;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 18px;
}
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-form button[type="submit"] { justify-self: start; }

/* Əlaqə üsulu (radio qrupu) */
.pref-group {
  border: 0;
  padding: 0;
  margin: 0;
}
.pref-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.pref-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.pref-option:hover { border-color: var(--red-deep); }
.pref-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red-deep);
}
.pref-option:has(input:checked) {
  border-color: var(--red-deep);
  background: var(--red-tint);
}
.pref-option input:focus-visible {
  outline: 2px solid var(--red-deep);
  outline-offset: 2px;
}

.form-status {
  display: none;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.form-status.is-visible { display: block; }
.form-status.is-ok { color: var(--red-deep); font-weight: 500; }

/* Honeypot field: invisible to humans, tempting for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 16. FOOTER ---------- */
footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 72px) clamp(20px, 5vw, 72px) 28px;
}

.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
}

.footer-logo { height: 36px; width: auto; display: block; }
.footer-brand p {
  margin-top: 16px;
  max-width: 32ch;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.footer-col h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-col ul {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
.footer-col li { font-size: 0.9rem; color: var(--text-dim); }
.footer-col a {
  display: inline-block;
  padding: 2px 0;                    /* toxunma sahəsini böyüdür */
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--red-deep); }

/* Mərkəzləşdirilmiş copyright */
.footer-bottom {
  max-width: 1440px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- 17. SECTION RESPONSIVE ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .contact-form .form-row { grid-template-columns: 1fr; }
  .contact-form button[type="submit"] { justify-self: stretch; width: 100%; }

  .test-actions .btn { width: 100%; }
  .pref-option { flex: 1 1 100%; justify-content: center; }

  .about-stats { grid-template-columns: 1fr 1fr; gap: 12px; }

  .footer-grid { grid-template-columns: 1fr; }
}
