:root {
  --green: #2f6854;
  --dark: #080808;
  --light: #ffffff;
  --muted: #aaa;
  --font: 'Segoe UI', system-ui, sans-serif;
  --space: 1.2rem;
  --max-width: 1200px;
}

/* Smooth scroll for in-page anchors */
html { scroll-behavior: smooth; }

/* Mobile text-size adjust (prevents iOS auto zooming text) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Page fade transitions (works with the script you added) */
@media (prefers-reduced-motion: no-preference) {
  .page-transition {
    opacity: 0;
    transition: opacity 260ms ease;
  }
  .page-transition.is-ready { opacity: 1; }
  .page-transition.is-exiting { opacity: 0; }
}

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

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--light);
  line-height: 1.6;
  font-size: 1rem;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* =======================
   HEADER
   ======================= */
.header {
  background: rgba(0, 0, 0, 0.95);
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 1000; /* keep above video on iOS */
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #111;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.brand-mark { height: 64px; display: block; }

/* Nav links slightly larger */
nav.cluster a {
  margin-left: 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  transition: opacity 0.2s;
  padding: 0.25rem 0; /* nicer tap target */
}
nav.cluster a:hover { opacity: 0.7; }

/* =======================
   BUTTON
   ======================= */
.btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
}
.btn-primary {
  background: var(--green);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

/* =======================
   HERO
   ======================= */
.hero-video-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  image-rendering: auto;
  backface-visibility: hidden; /* Safari/Edge smoothing */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.hero-overlay-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.35), transparent 70%);
  z-index: 2;
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 3;
  top: 40%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.hero-symbol {
  width: clamp(200px, 30vw, 360px);
  opacity: 0.95;
  margin-bottom: 0.8rem;
}

.hero-textchip {
  background: rgba(0, 0, 0, 0.35);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  text-align: center;
  backdrop-filter: blur(3px);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.hero-tagline { color: var(--green); font-size: 1.1rem; }

/* =======================
   SECTIONS
   ======================= */
.section { padding: 4rem 1rem; background: #111; }

h2 { font-size: 2rem; margin-bottom: 1.5rem; }

.center { text-align: center; }

.grid { display: grid; gap: 2rem; }

/* ---- ABOUT ---- */
.about-lead {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.about-copy { flex: 1; }
.about-figure { flex: 1; }

/* ---- SERVICES ---- */
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .cols-3 { grid-template-columns: 1fr; } }

/* ---- CARD STYLING (shared) ---- */
.card {
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}
.card img { width: 100%; height: auto; }
.card-body { padding: 1rem 1rem 0.5rem; flex: 1; }
.card-body h3 { font-size: 1.1rem; color: var(--green); margin-bottom: 0.5rem; }

/* ACTIONS */
.actions { padding: 0 1rem 1rem; margin-top: auto; }

/* ---- PROJECTS GRID (5-item layout) ---- */
.projects-grid { gap: 2rem; }
.projects-grid .card > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Desktop: 3 top, 2 centered bottom (5 total) */
@media (min-width: 900px) {
  .projects-grid.projects-5 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .projects-grid.projects-5 .card { grid-column: span 2; }
  .projects-grid.projects-5 .card:nth-child(4) { grid-column: 2 / span 2; }
  .projects-grid.projects-5 .card:nth-child(5) { grid-column: 4 / span 2; }
}

/* Tablet */
@media (max-width: 899.98px) and (min-width: 600px) {
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 599.98px) {
  .projects-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* =======================
   CONTACT
   ======================= */
form {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}
input, textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #444;
  background: #111;
  color: var(--light);
  border-radius: 6px;
}
textarea { min-height: 120px; resize: vertical; }
.sr-only { position: absolute; left: -9999px; }

/* =======================
   FOOTER
   ======================= */
.footer {
  background: #080808;
  color: #777;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* =========================================================
   TABLET (portrait tablets & small laptops) 769–1024px
   ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .brand-mark { height: 54px; }
  nav.cluster { display: flex; gap: 1.25rem; }
  nav.cluster a { font-size: 1.05rem; white-space: nowrap; }
  .btn { padding: 0.44rem 1rem; font-size: 1rem; }

  .about-figure img { border-radius: 10px; }
  .hero-title { font-size: 2.6rem; }
}

/* =========================================================
   MOBILE (phones & small tablets) ≤ 768px
   ========================================================= */
@media (max-width: 768px) {

  /* Container padding a touch tighter */
  .container { padding: 0 0.75rem; }

  /* Header & navigation: keep on one line, no wrapping */
  .header { padding: 0.6rem 0; }
  .nav { gap: 0.75rem; align-items: center; }
  .brand-badge { padding: 0.34rem 0.6rem; }
  .brand-mark { height: 40px; }
  nav.cluster { display: flex; gap: 0.9rem; }
  nav.cluster a { margin-left: 0; font-size: 0.95rem; white-space: nowrap; }
  .btn { padding: 0.32rem 0.8rem; font-size: 0.95rem; border-radius: 6px; }

  /* Hero: scale for phones */
  .hero-content { top: 45%; }
  .hero-symbol { width: clamp(160px, 38vw, 280px); margin-bottom: 0.6rem; }
  .hero-textchip { padding: 1rem 1.2rem; }
  .hero-title { font-size: 2.1rem; line-height: 1.15; }
  .hero-tagline { font-size: 1rem; }

  /* About: stack text then image */
  .about-lead { flex-direction: column; gap: 1.2rem; align-items: flex-start; }
  .about-copy, .about-figure { flex: 1 1 100%; width: 100%; }
  .about-figure img { width: 100%; height: auto; border-radius: 8px; }

  /* Forms: avoid iOS zoom on focus */
  input, textarea { font-size: 16px; }
}

/* =========================================================
   EXTRA-SMALL PHONES ≤ 380px
   ========================================================= */
@media (max-width: 380px) {
  .brand-mark { height: 36px; }
  nav.cluster { gap: 0.7rem; }
  nav.cluster a { font-size: 0.9rem; }
  .btn { padding: 0.28rem 0.7rem; font-size: 0.9rem; }

  .hero-title { font-size: 1.9rem; }
  .hero-textchip { padding: 0.85rem 1rem; }
}
