/* KION — Code Maker · Rebrand */
/* Dark theme (default) */
:root {
  --bg: #000000;
  --bg-alt: #0a0a0a;
  --surface: #111111;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --border: #1e1e1e;
  --header-bg: rgba(0, 0, 0, 0.92);
  --partner-bg: #ffffff;
  --partner-text: #000000;
  --card-hover-border: rgba(56, 189, 248, 0.4);
  --card-hover-shadow: rgba(0, 0, 0, 0.25);
  --nav-overlay-bg: var(--surface);
  --hero-glow: radial-gradient(ellipse 32% 20% at 50% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 55%);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --space: 1.25rem;
  --container: min(92vw, 1100px);
  --touch: 44px; /* min touch target */
}

/* Light theme */
[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --accent: #0284c7;
  --accent-dim: #0369a1;
  --border: #e5e5e5;
  --header-bg: rgba(250, 250, 250, 0.92);
  --partner-bg: #e8e8e8;
  --partner-text: #1a1a1a;
  --card-hover-border: rgba(2, 132, 199, 0.35);
  --card-hover-shadow: rgba(0, 0, 0, 0.08);
  --nav-overlay-bg: var(--surface);
  --hero-glow: radial-gradient(ellipse 32% 20% at 50% 0%, rgba(2, 132, 199, 0.08) 0%, transparent 55%);
}

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

html {
  scroll-behavior: smooth;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

[dir="rtl"] body {
  font-family: "Tajawal", var(--font-sans);
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space);
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus {
  top: var(--space);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-dim);
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--space), 1rem);
}

/* ========== Header (recode) ========== */
/* .ite-header: allow same styles if header class differs (e.g. from another build) */
.site-header,
.ite-header {
  --header-height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.75rem max(var(--space), 1rem);
  min-height: var(--header-height);
}

@media (min-width: 768px) {
  .header-inner {
    padding: 1rem var(--space);
  }
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  flex-shrink: 0;
}
.logo:hover {
  color: var(--text);
  text-decoration: none;
}
.logo-img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}
.logo-tag {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Right side: nav + lang + toggle */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Nav list: hidden on mobile, shown as overlay when .is-open */
.nav {
  display: contents;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 0;
}
.nav-list a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}
.nav-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Mobile: open menu is full-width overlay below header */
@media (max-width: 767px) {
  .nav-list.is-open {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-height);
    margin: 0;
    padding: 0.5rem 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--nav-overlay-bg);
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 40;
  }
  .nav-list.is-open li {
    border-bottom: 1px solid var(--border);
  }
  .nav-list.is-open li:last-child {
    border-bottom: none;
  }
  .nav-list.is-open a {
    display: flex;
    align-items: center;
    padding: 0.875rem max(var(--space), 1rem);
    min-height: var(--touch);
  }
  .lang-switch {
    display: none;
  }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: var(--touch);
    min-height: var(--touch);
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    background: currentColor;
    width: 18px;
    margin-inline: auto;
    border-radius: 1px;
  }
}

/* Desktop: horizontal nav, no toggle */
@media (min-width: 768px) {
  .nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    position: static;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .nav-list.is-open {
    position: static;
    display: flex;
    flex-direction: row;
    padding: 0;
    margin: 0;
    max-height: none;
    overflow: visible;
    border: none;
    box-shadow: none;
  }
  .nav-list.is-open li {
    border-bottom: none;
  }
  .nav-toggle {
    display: none;
  }
  .lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
}

/* Lang buttons (shared) */
.lang-btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.lang-btn:hover {
  color: var(--text);
}
.lang-btn.active {
  color: var(--bg);
  background: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.theme-toggle .icon-moon {
  opacity: 0;
}
[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 0;
}
[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 1;
}
.theme-toggle-wrap {
  position: relative;
  display: inline-flex;
}

/* Nav toggle base (visible only on mobile via media above) */
.nav-toggle {
  position: relative;
  z-index: 51;
  color: var(--text);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  width: 18px;
  margin-inline: auto;
  border-radius: 1px;
  pointer-events: none;
}

/* Footer logo/brand (reuse .logo-tag) */
.logo-img-footer {
  width: 32px;
  height: 32px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(42.5vh, 300px);
  display: flex;
  align-items: center;
  padding: 1rem 0 1.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    min-height: 42.5vh;
    padding: 2rem 0;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--hero-glow), var(--bg);
  animation: heroGlow 6s ease-in-out infinite;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-label {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.15s;
  animation-fill-mode: both;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 1rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw + 0.5rem, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: fadeInUp 0.65s ease-out forwards;
  animation-delay: 0.3s;
  animation-fill-mode: both;
}

.hero-desc {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 0 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.45s;
  animation-fill-mode: both;
}

@media (min-width: 768px) {
  .hero-desc {
    margin-bottom: 2rem;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.6s;
  animation-fill-mode: both;
}

.hero-actions .btn {
  min-height: var(--touch);
  padding: 0.75rem 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--bg);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Sections */
.section {
  padding: 2.5rem 0;
}
.section-alt {
  background: var(--bg-alt);
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

/* Scroll-triggered: section in view */
.section:not(.in-view) .section-title,
.section:not(.in-view) .section-lead,
.section:not(.in-view) .card,
.section:not(.in-view) .services-list li,
.section:not(.in-view) .boss-block .card,
.section:not(.in-view) .partners-row .partner-logo,
.section:not(.in-view) .contact-block {
  opacity: 0;
  transform: translateY(18px);
}

.section.in-view .section-title {
  animation: fadeInUp 0.5s ease-out forwards;
}

.section.in-view .section-lead {
  animation: fadeInUp 0.5s ease-out 0.08s forwards;
  animation-fill-mode: both;
}

.section.in-view .card {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-fill-mode: both;
}

.section.in-view .card-grid-4 .card:nth-child(1) { animation-delay: 0.1s; }
.section.in-view .card-grid-4 .card:nth-child(2) { animation-delay: 0.18s; }
.section.in-view .card-grid-4 .card:nth-child(3) { animation-delay: 0.26s; }
.section.in-view .card-grid-4 .card:nth-child(4) { animation-delay: 0.34s; }

.section.in-view .services-list li {
  animation: fadeInUp 0.4s ease-out forwards;
  animation-fill-mode: both;
}

.section.in-view .services-list li:nth-child(1) { animation-delay: 0.05s; }
.section.in-view .services-list li:nth-child(2) { animation-delay: 0.12s; }
.section.in-view .services-list li:nth-child(3) { animation-delay: 0.19s; }
.section.in-view .services-list li:nth-child(4) { animation-delay: 0.26s; }
.section.in-view .services-list li:nth-child(5) { animation-delay: 0.33s; }

.section.in-view .boss-block .card {
  animation: fadeInUp 0.55s ease-out 0.1s forwards;
  animation-fill-mode: both;
}

.section.in-view .partners-row .partner-logo {
  animation: fadeInUp 0.45s ease-out forwards;
  animation-fill-mode: both;
}

.section.in-view .partners-row .partner-logo:nth-child(1) { animation-delay: 0.05s; }
.section.in-view .partners-row .partner-logo:nth-child(2) { animation-delay: 0.15s; }
.section.in-view .partners-row .partner-logo:nth-child(3) { animation-delay: 0.25s; }
.section.in-view .partners-row .partner-logo:nth-child(4) { animation-delay: 0.35s; }

.section.in-view .contact-block {
  animation: fadeInUp 0.5s ease-out 0.1s forwards;
  animation-fill-mode: both;
}

.section-lead {
  color: var(--text-muted);
  max-width: 55ch;
  margin: 0 0 1.5rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

@media (min-width: 768px) {
  .section-lead {
    margin-bottom: 2.5rem;
  }
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.25rem;
}
.card-grid-3,
.card-grid-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 640px) {
  .card-grid {
    gap: 1.5rem;
  }
  .card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.25s ease;
}

@media (min-width: 640px) {
  .card {
    padding: 1.75rem;
  }
}
.card:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 12px 40px var(--card-hover-shadow);
  transform: translateY(-2px);
}

.card-icon {
  margin-bottom: 1rem;
}

.card-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: var(--accent);
}

.card-icon-svg svg {
  width: 2rem;
  height: 2rem;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-team .card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--border) 0%, var(--bg-alt) 100%);
  margin-bottom: 1rem;
}

.card-team h3 {
  margin: 0;
}

/* Meet our boss — single centered card */
.boss-block {
  display: flex;
  justify-content: center;
  max-width: 360px;
  margin-inline: auto;
}

.card-boss {
  text-align: center;
  width: 100%;
}

.card-boss .card-avatar {
  width: 96px;
  height: 96px;
  margin-inline: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--border) 0%, var(--bg-alt) 100%);
  margin-bottom: 1.25rem;
}

.card-boss .card-avatar-img {
  display: block;
  width: 96px;
  height: 96px;
  margin-inline: auto;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.boss-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.boss-role {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Services list */
.services-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 500px) {
  .services-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.services-list li {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.services-list li::before {
  content: "› ";
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1em;
}

/* Partners placeholder */
.subsection-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

@media (min-width: 640px) {
  .subsection-title {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
  }
}

.partners-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .partners-row {
    gap: 2rem;
  }
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: var(--partner-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 70px;
  flex: 1 1 140px;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
a.partner-logo:hover {
  text-decoration: none;
  border-color: var(--card-hover-border);
  box-shadow: 0 4px 20px var(--card-hover-shadow);
}

@media (min-width: 640px) {
  .partner-logo {
    padding: 1rem 1.5rem;
    min-height: 80px;
    flex: 0 1 auto;
  }
}

.partner-logo img {
  max-width: 100px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (min-width: 640px) {
  .partner-logo img {
    max-width: 120px;
    max-height: 80px;
  }
}

.partner-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--partner-text);
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  .partner-name {
    font-size: 1.2rem;
  }
}

/* Contact */
.section-contact .contact-block {
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .section-contact .contact-block {
    padding: 1.5rem;
  }
}
.contact-block p {
  margin: 0 0 0.5rem;
}
.contact-block p:last-child {
  margin-bottom: 0;
}

.contact-map-wrap {
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.contact-map {
  display: block;
  width: 100%;
  min-height: 180px;
  height: 200px;
}
.contact-map-links {
  margin: 0.75rem 0 0 !important;
  padding: 0 1rem 0.75rem;
  font-size: 0.9375rem;
}
.contact-map-sep {
  margin: 0 0.25rem;
  color: var(--muted);
}
@media (min-width: 640px) {
  .contact-map {
    min-height: 220px;
    height: 220px;
  }
}

.contact-link {
  text-decoration: none;
  font-weight: 500;
}
.contact-link:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

@media (min-width: 768px) {
  .site-footer {
    padding: 2.5rem 0;
  }
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  justify-content: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
  }
}

.footer-brand .logo-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

@media (min-width: 768px) {
  .footer-nav {
    justify-content: flex-start;
    gap: 1.25rem;
  }
}
.footer-nav a {
  color: var(--text-muted);
}
.footer-nav a:hover {
  color: var(--accent);
}

.footer-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  order: 3;
}

@media (min-width: 768px) {
  .footer-copy {
    width: auto;
    text-align: right;
    order: 0;
  }
}

/* Visitor counter under footer */
.visit-counter {
  padding: 0.5rem 1rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.visit-counter-label {
  margin-right: 0.35em;
}
.visit-counter-value {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

