/* =====================================================================
   Ehsan Kahrizi — shared stylesheet for all pages
   ===================================================================== */

/* === THEME TOKENS ==================================================== */
:root {
  color-scheme: light dark;
  --bg-color: #fefefe;
  --text-color: #333333;
  --heading-color: #0077cc;
  --accent-color: #005fa3;
  --card-bg: #f9f9f9;
  --card-border: #cccccc;
  --surface: #f0f0f0;
  --footer-border: #eeeeee;
  --footer-text: #666666;
  --link-color: #005fa3;
  --link-hover: #00447a;
  --shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
  --content-width: 1200px;
}

html.dark-mode {
  --bg-color: #121212;
  --text-color: #e8e8e8;
  --heading-color: #7ec8ff;
  --accent-color: #8cc8ff;
  --card-bg: #1e1e1e;
  --card-border: #333333;
  --surface: #1a1a1a;
  --footer-border: #333333;
  --footer-text: #b0b0b0;
  --link-color: #8cc8ff;
  --link-hover: #b7dcff;
  --shadow: 1px 1px 5px rgba(0, 0, 0, 0.35);
}

/* === BASE ============================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg-color);
  color: var(--link-color);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* === HEADER (shared by every page) =================================== */
.site-header {
  position: relative;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url('Header.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  text-align: center;
}

.site-header a {
  color: #ffffff;
}

/* --- Home variant: full-screen background video --------------------- */
.site-header.hero {
  min-height: calc(100vh - 56px);
  padding: 90px 5vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

/* The video fills the whole hero; the poster/background image shows
   through underneath until it is ready. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* Darkening layer so the white text stays readable over any frame. */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-header.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.site-tagline {
  margin: 0 0 18px 0;
  max-width: 640px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* --- Inner-page variant: compact bar -------------------------------- */
.site-header.compact {
  padding: 18px 5vw;
  text-align: left;
}

.site-header.compact .header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.brand {
  font-size: 1.35rem;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.85;
}

/* === NAVIGATION ====================================================== */
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 22px;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

nav ul li a:hover {
  color: #ffffff;
  text-decoration: none;
  border-bottom-color: rgba(255, 255, 255, 0.65);
}

nav ul li a[aria-current="page"] {
  border-bottom-color: #ffffff;
}

/* Keeps the links legible over bright frames of the hero video. */
.hero-content nav ul li a {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* === THEME TOGGLE ==================================================== */
.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.site-header.hero .theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
}

/* === PAGE CONTENT ==================================================== */
main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 5vw;
}

main.full-bleed {
  max-width: none;
  padding: 0;
}

.page-title {
  color: var(--heading-color);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
  margin: 36px 0 0 0;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
}

.page-intro {
  margin: 12px 0 0 0;
  color: var(--footer-text);
}

section {
  padding: 26px 0;
}

section h2 {
  color: var(--heading-color);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 5px;
  margin-top: 0;
}

section h3 {
  color: var(--accent-color);
}

/* === LISTS =========================================================== */
ul {
  padding-left: 20px;
}

ul li {
  margin-bottom: 6px;
}

ol {
  padding-left: 20px;
}

ol li {
  margin-bottom: 10px;
}

/* === CARD GRID ======================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding-top: 10px;
}

.project-item {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 15px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-item h3 {
  margin-top: 0;
  color: var(--accent-color);
}

.project-item p {
  margin-bottom: 0.9rem;
}

.project-item p:last-child {
  margin-bottom: 0;
}

/* === SWIPER ========================================================== */
.swiper {
  width: 100%;
  height: 400px;
  margin-bottom: 10px;
  border-radius: 8px;
  position: relative;
  background-color: var(--surface);
  overflow: hidden;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--surface);
}

.swiper-slide img,
.swiper-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.swiper-button-prev,
.swiper-button-next {
  color: var(--heading-color);
}

.swiper-pagination-bullet-active {
  background: var(--heading-color);
}

/* === CONTACT LIST ==================================================== */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  max-width: 640px;
}

.contact-list li {
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
}

.contact-list .label {
  display: block;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 2px;
}

/* === FOOTER ========================================================== */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 12px 20px;
  border-top: 1px solid var(--footer-border);
  color: var(--footer-text);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
  text-align: center;
}

/* === MOBILE ========================================================== */
@media (max-width: 768px) {
  .site-header.hero {
    padding: 70px 20px 40px;
    min-height: calc(100vh - 56px);
  }

  .site-header.compact {
    padding: 16px 20px;
    text-align: center;
  }

  .site-header.compact .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  nav ul {
    gap: 6px 16px;
  }

  .site-header.hero .theme-toggle {
    position: static;
    order: 2; /* keep the toggle below the name/nav instead of above it */
    margin-top: 22px;
  }

  main {
    padding: 0 20px;
  }

  .page-title {
    margin-top: 26px;
  }

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

  .project-item {
    padding: 12px;
  }

  .swiper {
    height: 250px;
  }
}

/* === REDUCED MOTION ================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
