/* =========================================================
   Dev Fighters — shared design system
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --blue-700: #00006e;
  --blue-500: #000091;
  --red-500: #E1000F;
  --red-600: #b80012;

  --ink: #0c1330;
  --muted: #5b6580;
  --bg: #ffffff;
  --bg-soft: #f4f6fc;
  --line: #e3e8f5;
  --white: #fff;

  --grad-blue: linear-gradient(135deg, #000091 0%, #00006e 100%);
  --grad-red: linear-gradient(135deg, #E1000F 0%, #b80012 100%);

  --font-head: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1120px;
  --pad: clamp(1.1rem, 4vw, 2rem);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(12, 19, 48, .06), 0 2px 8px rgba(12, 19, 48, .05);
  --shadow-md: 0 10px 30px rgba(12, 19, 48, .10);
  --shadow-glow: 0 18px 40px rgba(0, 0, 145, .18);

  --header-h: 70px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--blue-500); text-decoration: none; }
a:hover { color: var(--blue-700); }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.25rem, 1.6rem + 3.2vw, 3.75rem); }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); }

p { margin: 0 0 1rem; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

section {
  padding-block: clamp(3.5rem, 6vw, 6rem);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-500);
  margin: 0 0 .9rem;
}

.lead {
  font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem);
  color: var(--muted);
  max-width: 60ch;
}

.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease),
              background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background-image: var(--grad-red);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(225, 0, 15, .28);
}
.btn--primary:hover {
  color: var(--white);
  box-shadow: 0 16px 32px rgba(225, 0, 15, .38);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 0 0 0 1px transparent;
}
.btn--ghost:hover {
  color: var(--blue-700);
  border-color: var(--blue-500);
  background: var(--bg-soft);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 34px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}
.nav a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .98rem;
  color: var(--ink);
  position: relative;
  padding: .25rem 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--grad-red);
  border-radius: 2px;
  transition: width .25s var(--ease);
}
.nav a:hover { color: var(--blue-700); }
.nav a:hover::after { width: 100%; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem;
  background: var(--white);
}
.lang-switch a {
  color: var(--muted);
  padding: .25rem .6rem;
  border-radius: 999px;
  line-height: 1;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active {
  color: var(--white);
  background-image: var(--grad-blue);
}

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: .25rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
#hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 8vw, 7.5rem);
  background:
    radial-gradient(60% 80% at 75% -10%, rgba(0, 0, 145, .12), transparent 60%),
    radial-gradient(50% 70% at 5% 0%, rgba(225, 0, 15, .08), transparent 55%),
    var(--bg);
}
#hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
#hero h1 { max-width: 18ch; }
#hero .lead { margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ---------- Services ---------- */
#services { background: var(--bg-soft); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              border-color .25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(0, 0, 145, .10), rgba(225, 0, 15, .08));
}
.card__title { margin-bottom: .4rem; }
.card__text { color: var(--muted); margin: 0; font-size: .98rem; }

/* ---------- Why ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.why-item {
  position: relative;
  padding-top: 1.25rem;
  border-top: 3px solid transparent;
  border-image: var(--grad-blue) 1;
}
.why-item h3 { margin-bottom: .4rem; }
.why-item p { color: var(--muted); margin: 0; }

/* ---------- Contact ---------- */
#contact { background: var(--bg-soft); }
.contact-band {
  position: relative;
  overflow: hidden;
  background-image: var(--grad-blue);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(2.25rem, 5vw, 4rem);
  box-shadow: var(--shadow-md);
}
.contact-band::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(225, 0, 15, .35), transparent 65%);
  pointer-events: none;
}
.contact-band .eyebrow { color: rgba(255, 255, 255, .85); }
.contact-band h2 { color: var(--white); }
.contact-band p { color: rgba(255, 255, 255, .88); max-width: 55ch; }
.contact-band .btn--ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, .5);
}
.contact-band .btn--ghost:hover {
  background: rgba(255, 255, 255, .12);
  border-color: var(--white);
  color: var(--white);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 1.75rem;
}
.contact-band noscript { display: block; margin-top: 1rem; font-size: .9rem; color: rgba(255,255,255,.8); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, .72);
  padding-block: 2.5rem;
  font-size: .92rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--red-500); }
.site-footer .lang-switch {
  background: transparent;
  border-color: rgba(255, 255, 255, .2);
}
.site-footer .lang-switch a { color: rgba(255, 255, 255, .7); }
.site-footer .lang-switch a:hover { color: var(--white); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 100;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  padding: .6rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; }

/* ---------- Footer links ---------- */
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn:focus-visible { outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .brand { margin-right: auto; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: .5rem var(--pad) 1.25rem;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s var(--ease), opacity .25s var(--ease), visibility .25s;
  }
  .nav a {
    padding: .9rem .25rem;
    border-bottom: 1px solid var(--line);
  }
  .nav a::after { display: none; }

  /* Shown when nav itself or an ancestor carries .is-open */
  .nav.is-open,
  .is-open .nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .lang-switch { order: 3; }
}

@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .hero__actions .btn,
  .contact-actions .btn { width: 100%; }
  .site-footer .container { justify-content: center; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card:hover { transform: none; }
}
