/* ========================================
   xFactorial Modern Redesign Styles
   ======================================== */

/* ------------------
   CSS Variables
------------------ */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-accent: #263238;
  --color-surface: #f8f9fa;
  --color-border: #ddd;

  --font-body: 'Open Sans', system-ui, sans-serif;
  --font-heading: 'Poppins', system-ui, sans-serif;

  --radius: 0.75rem;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: 0.25s ease-in-out;
}

body[data-theme='dark'] {
  --color-bg: #121212;
  --color-text: #e0e0e0;
  --color-muted: #aaa;
  --color-accent: #2b132b;
  --color-surface: #1e1e1e;
  --color-border: #333;
}

/* ------------------
   Base Styles
------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  border-bottom: 1px solid #dfd2d2;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

/* ------------------
   Layout Utilities
------------------ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.stack > * + * {
  margin-top: var(--gap, 1rem);
}

.grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.center {
  text-align: center;
}

/* ------------------
   Header
------------------ */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-family: var(--font-heading);
}
.brand__logo {
  width: 32px;
  margin-right: 8px;
}
.brand:hover {
  border-bottom: none;
}

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

.site-nav .nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* ------------------
   Buttons
------------------ */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background var(--transition), color var(--transition),
    border var(--transition);
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
}
.btn--primary:hover {
  background: transparent;
  color: var(--color-accent);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ------------------
   Sections
------------------ */
.section {
  padding: 4rem 0;
}
.section.alt {
  background: var(--color-surface);
}

.section__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.section__subtitle {
  color: var(--color-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* Hero */
.hero__title {
  font-size: 2.25rem;
  font-family: var(--font-heading);
}

/* Trusted */
.trusted .container {
  margin: 0 12rem;
}

.trusted__label {
  text-align: center;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* carousel wrapper */
.carousel {
  overflow: hidden;
  width: 100%;
  position: relative;
  display: flex;
}

/* list styles */
.trusted__list {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 10px;
  margin: 0;
  animation: scroll 15s linear infinite;
}

.trusted__list li {
  min-width: 300px;
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: bold;
}

/* scrolling animation */
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* pause on hover */
.carousel:hover .trusted__list {
  animation-play-state: paused;
}

/* End of */

/* Media Blocks */
.media-block {
  gap: 2rem;
}
.media-block--reverse {
  direction: rtl;
}
.media-block--reverse > * {
  direction: ltr;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  list-style: none;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.card:hover {
  transform: translateY(-4px);
}
.card__title {
  margin-bottom: 0.75rem;
}
.card__media {
  width: 100px;
  margin: 0 auto;
}

/* ------------------
   Footer
------------------ */
.site-footer {
  background: var(--color-accent);
  color: #fff;
  margin-top: 4rem;
  padding-top: 2rem;
}
.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li + li {
  margin-top: 0.5rem;
}
.subscribe input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.muted {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  padding: 1rem 0;
}
.footer-legal {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.social {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.social img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
}

/* 404 page */
.error-section {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.error-section h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ------------------
   Responsive Nav
------------------ */
@media (max-width: 768px) {
  .site-nav .nav-list {
    position: absolute;
    top: 100%;
    right: 1rem;
    background: var(--color-surface);
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: none;
  }
  .site-nav .nav-toggle {
    display: block;
  }
  .site-nav.open .nav-list {
    display: flex;
    margin-right: -1rem;
    border-radius: 0;
  }

  .trusted .container {
    margin: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 1.5rem;
  }
}
