/* ═══════════════════════════════════════════════════════════════════════
   PORTFOLIO — style.css
   All colors, fonts, and key measurements live in :root so you can
   restyle the entire site by editing just that block.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Design tokens ────────────────────────────────────────────────── */
:root {
  /* Primary palette */
  --color-primary:        #0d6efd;   /* Bootstrap blue — change to any hex */
  --color-primary-dark:   #0a58ca;
  --color-primary-light:  #cfe2ff;
  --color-accent:         #fd7e14;   /* Accent / highlight color */

  /* Neutrals */
  --color-bg:             #0b0f19;   /* Page background */
  --color-bg-secondary:   #111827;   /* Section alternating bg */
  --color-bg-card:        #1a2035;   /* Card background */
  --color-border:         #2a3555;   /* Subtle borders */
  --color-text:           #e2e8f0;   /* Body text */
  --color-text-muted:     #a3a3a3;   /* Muted / secondary text */

  /* Navbar */
  --navbar-bg:            rgba(11, 15, 25, 0.95);
  --navbar-height:        70px;

  /* Typography */
  --font-display:         'Syne', sans-serif;
  --font-body:            'DM Sans', sans-serif;
  --font-mono:            'JetBrains Mono', monospace;

  /* Spacing & shape */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45);
  --transition:  0.25s ease;
}

/* ── 2. Global reset / base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }

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

/* ── 3. Utility classes ──────────────────────────────────────────────── */
.text-accent   { color: var(--color-accent) !important; }
.text-primary  { color: var(--color-primary) !important; }
.text-muted    { color: var(--color-text-muted) !important; }
.bg-card       { background-color: var(--color-bg-card); }
.bg-secondary-custom { background-color: var(--color-bg-secondary); }
.border-custom { border-color: var(--color-border) !important; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}

.section-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border: none;
  border-radius: 2px;
  margin: 0 0 2rem 0;
}

section { padding: 90px 0; }
section:nth-of-type(even) { background-color: var(--color-bg-secondary); }

/* ── 4. Navbar ───────────────────────────────────────────────────────── */
.navbar {
  background: var(--navbar-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--navbar-height);
  transition: box-shadow var(--transition);
  z-index: 1050; /* Keeps navbar sitting on top of scrolling content headers */
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.5); }

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: -0.02em;
}
.navbar-brand span { color: var(--color-primary); }

.navbar-nav .nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-muted) !important;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color var(--transition);
}
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 1rem; right: 1rem;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  border-radius: 2px;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { transform: scaleX(1); }

.navbar-toggler {
  border-color: var(--color-border);
  color: var(--color-text);
}
.navbar-toggler-icon {
  filter: invert(1);
}

/* ── 5. Hero / Page headers ──────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--navbar-height);
  position: relative;
  overflow: hidden;
  /* Clean linear pattern without dependency assets */
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(13,110,253,0.12) 0%, transparent 70%),
    var(--color-bg);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-name .line-accent { color: var(--color-primary); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.page-header {
  background:
    radial-gradient(ellipse 70% 80% at 30% 50%, rgba(13,110,253,0.1) 0%, transparent 70%),
    var(--color-bg-secondary);
  padding: 120px 0 60px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}
.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ── 6. Buttons ──────────────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary-custom:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13,110,253,0.35);
  color: #fff;
}

.btn-outline-custom {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-outline-custom:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* ── 7. Cards ────────────────────────────────────────────────────────── */
.card-custom {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  height: 100%;
}
.card-custom:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  border-color: var(--color-primary);
}

.card-custom .card-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

.card-custom .card-body { padding: 1.75rem; }
.card-custom .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #fff;
}
.card-custom .card-text { color: var(--color-text-muted); font-size: 0.9rem; }

/* Image cards (projects / gallery) */
.card-img-custom .card-img-top {
  height: 220px;
  object-fit: cover;
  width: 100%;
  background: var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}
.img-placeholder {
  height: 220px;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-border));
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.img-placeholder-sm {
  height: 160px;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-border));
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
}

/* ── 8. About section ────────────────────────────────────────────────── */
.about-img-wrap {
  position: relative;
}
.about-img-wrap img,
.about-img-frame {
  border-radius: var(--radius-lg);
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-border));
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
}
.about-img-wrap::after {
  content: '';
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.5;
}

.stat-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.4rem;
  text-align: center;
}
.stat-box .stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}
.stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ── 9. Contact form ─────────────────────────────────────────────────── */
.contact-form-wrap {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-control-custom {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control-custom::placeholder { color: var(--color-text-muted); }
.form-control-custom:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.18);
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.form-label-custom {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: block;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-info-icon {
  width: 42px; height: 42px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── 10. Projects page ───────────────────────────────────────────────── */
.project-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 4rem;
}
.project-block-header {
  background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-card));
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.project-block-header .project-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  background: var(--color-primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}
.project-block-body { padding: 2rem 2.5rem; }

/* ── 11. Robotics page ───────────────────────────────────────────────── */
.year-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 5rem;
}
.year-card-header {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  padding: 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.year-badge {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  opacity: 0.25;
}
.year-card-body { padding: 2rem 2.5rem; }

/* Gallery grid — Spans full width of the card's inner content */
.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Forces exactly 3 equal columns */
    gap: 1.25rem !important;                          /* Spacing between images */
    width: 100% !important;                           /* Spans full width of the card body */
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Force every image to be an identical square, auto-cropping mixed dimensions */
.gallery-grid img.portfolio-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;        /* Forces a perfect square box */
    object-fit: cover !important;          /* Automatically smart-crops layout boundaries */
    display: block !important;
    position: relative !important;         /* Keeps broken image warning boxes perfectly inside the square */
}

/* ── 12. Classes page (alternating) ─────────────────────────────────── */
.class-row {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--color-border);
}
.class-row:last-child { border-bottom: none; }
.class-row.reverse { flex-direction: row-reverse; }

.class-img-wrap {
  flex: 0 0 38%;
  max-width: 38%;
}
.class-img-wrap img,
.class-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-border));
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.class-content { flex: 1; }
.class-trim-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(253,126,20,0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.class-title { font-size: 1.4rem; margin-bottom: 0.6rem; }
.class-desc { color: var(--color-text-muted); font-size: 0.92rem; }

@media (max-width: 768px) {
  .class-row, .class-row.reverse {
    flex-direction: column;
    gap: 1.5rem;
  }
  .class-img-wrap { flex: unset; max-width: 100%; width: 100%; }
}

/* ── 13. Flash alerts ────────────────────────────────────────────────── */
.alert-custom {
  border-radius: var(--radius-sm);
  border: 1px solid;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
}
.alert-success { background: rgba(25,135,84,0.15); border-color: rgba(25,135,84,0.4); color: #75c98e; }
.alert-danger  { background: rgba(220,53,69,0.15); border-color: rgba(220,53,69,0.4);  color: #f4908a; }

/* ── 14. Footer ──────────────────────────────────────────────────────── */
footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
footer .footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

/* ── 15. Scroll animations ───────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 16. Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ── 17. Bootstrap overrides ─────────────────────────────────────────── */
.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* ── 18. Broken Image / File Not Found Fallbacks ──────────────────────── */
img.portfolio-img {
  width: 100%;
  object-fit: cover;
  background-color: var(--color-bg-card);
  display: block;
}

/* When the image breaks or isn't found locally yet */
img.portfolio-img:not([src]), 
img.portfolio-img:failed,
img.portfolio-img:-moz-broken { 
  content: "";
}

img.portfolio-img::before {
  content: "⚠️ " attr(alt);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-border));
  border: 1px dashed var(--color-primary);
  border-radius: inherit;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Force Page Titles and Headers to be Bright White */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff !important;
}

/* Specific Target for the Header Sections */
.page-header h1 {
  color: #ffffff !important;
}

.project-block-header h2 {
  color: #ffffff !important;
}

/* Ensure subheadings inside your project details stay bright white */
.project-block-body h4 {
  color: #ffffff !important;
}

/* 1. Base style for the banner to sit perfectly on top */
.global-maintenance-banner {
    width: 100%;
    height: 40px; 
    z-index: 1070; /* Higher than Bootstrap fixed navbar defaults */
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
}

/* 2. Push down fixed components cleanly when the banner state is active */
body.has-banner .navbar.fixed-top {
    top: 40px !important;
}

/* 3. Handle view alignment compensation targets */
body.has-banner {
    padding-top: 40px !important;
}

/* Ensure smooth tracking updates during viewport scrolling changes */
.navbar.fixed-top {
    transition: top 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
}