/* ============================================================
   SAIF TECH — STYLES
   A dark, premium technology-media aesthetic:
   deep slate background, brand blue accent, restrained motion.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0d12;
  --bg-elevated: #0d1117;
  --panel: #12161f;
  --panel-hover: #161b26;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #edf0f4;
  --text-dim: #9aa4b4;
  --text-faint: #6b7385;

  --accent: #4c86ff;
  --accent-bright: #7aa8ff;
  --accent-dim: #2c5bd6;
  --navy: #10182b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --container-w: 1200px;
  --header-h: 76px;

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

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

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;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

p {
  margin: 0 0 1em;
  color: var(--text-dim);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Reusable bits ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.text-accent {
  background: linear-gradient(100deg, var(--accent-bright), var(--accent) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Logo container: the source logo has a light background baked in,
   so it sits on a small light plate to stay crisp on the dark theme. */
.brand-plate {
  display: inline-flex;
  align-items: center;
  background: #f4f5f7;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.brand-plate img {
  height: 24px;
  width: auto;
}

.brand-plate-lg {
  padding: 20px 28px;
  border-radius: var(--radius-md);
}

.brand-plate-lg img {
  height: 46px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}

.btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1rem;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-dim));
  color: #fff;
  box-shadow: 0 8px 24px rgba(76, 134, 255, 0.35);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(76, 134, 255, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 13, 18, 0.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 13, 18, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
}

.main-nav ul {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px 2px;
  position: relative;
  transition: color 0.2s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s var(--ease);
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 100px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background: radial-gradient(60% 60% at 30% 20%, rgba(76, 134, 255, 0.22), transparent 70%),
    radial-gradient(45% 45% at 80% 10%, rgba(122, 168, 255, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 30%, black, transparent 75%);
  mask-image: radial-gradient(60% 55% at 50% 30%, black, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 56px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  margin-bottom: 0.35em;
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 54ch;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 30px 0 34px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--panel), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(76, 134, 255, 0.35), transparent 70%);
  pointer-events: none;
}

.hero-logo {
  position: relative;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}

.hero-card-rule {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}

.hero-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.hero-card-row:last-child {
  margin-bottom: 0;
}

.hero-card-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(76, 134, 255, 0.15);
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head .eyebrow {
  justify-content: center;
}

.section-head .eyebrow::before {
  display: none;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.section-lede {
  margin: 0;
  font-size: 1.02rem;
}

.section-cta {
  text-align: center;
  margin-top: 44px;
}

/* ---------- Video grid & cards ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.video-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.video-card:hover .video-thumb img {
  transform: scale(1.06);
}

.video-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb-play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.video-card:hover .video-thumb-play::before {
  opacity: 1;
}

.video-thumb-play svg {
  position: relative;
  width: 60px;
  height: 60px;
  color: #fff;
  background: rgba(15, 18, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  padding: 14px;
  backdrop-filter: blur(4px);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.video-card:hover .video-thumb-play svg {
  transform: scale(1.08);
  background: var(--accent);
}

.video-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-card-title {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.video-card-desc {
  font-size: 0.92rem;
  margin-bottom: 20px;
  flex: 1;
}

.video-card-btn {
  align-self: flex-start;
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.category-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  background: var(--panel-hover);
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(76, 134, 255, 0.12);
  color: var(--accent-bright);
  margin-bottom: 18px;
}

.category-icon svg {
  width: 24px;
  height: 24px;
}

.category-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}

.about-copy p {
  font-size: 1.02rem;
}

.about-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.about-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-bright);
}

.about-stat-label {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.about-visual {
  display: flex;
  justify-content: center;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  padding: 110px 0;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg), var(--navy) 130%);
}

.cta-glow {
  position: absolute;
  inset: auto -10% -60% -10%;
  height: 500px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(76, 134, 255, 0.25), transparent 70%);
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.cta h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  margin-bottom: 0.4em;
}

.cta p {
  font-size: 1.08rem;
  margin-bottom: 34px;
}

.cta-note {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand p {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.footer-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

.footer-nav a:hover {
  color: var(--accent-bright);
}

.footer-copy {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
  width: 100%;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* ---------- Video modal ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.video-modal[hidden] {
  display: none;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.85);
  backdrop-filter: blur(6px);
}

.video-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  animation: modal-in 0.25s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-modal-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.video-modal-close:hover {
  background: var(--accent);
  transform: rotate(90deg);
}

.video-modal-close svg {
  width: 18px;
  height: 18px;
}

/* 16:9 responsive YouTube embed container */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1000px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 12px;
  }

  .hero-card {
    max-width: 420px;
  }

  .about-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-stats {
    justify-content: center;
  }

  .about-copy .eyebrow {
    justify-content: center;
  }

  .about-copy .eyebrow::before {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  .main-nav {
    position: fixed;
    z-index: 99;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }

  .main-nav.is-open {
    max-height: 320px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
  }

  .main-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .header-actions .btn-sm {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 76px 0 64px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section {
    padding: 72px 0;
  }

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

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .footer-nav {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-tags {
    display: none;
  }
}
