/* ================================================================
   CUSTOM STYLESHEET — Reconstructing Shadows
   Author: Chen Dinglun
   Course: AST10962 Introduction to the Web
   
   This file contains ALL personal CSS modifications on top of
   Bootstrap 5. It demonstrates: CSS custom properties (variables),
   typography, flexbox & grid, transitions, transforms, animations,
   pseudo-elements, media queries, gradients, box-shadow, filters,
   and responsive design techniques.
   ================================================================ */

/* =============== CSS Custom Properties (Variables) =============== */
:root {
  /* Colour palette */
  --clr-bg: #0a0a0a;
  --clr-bg-alt: #111111;
  --clr-surface: #1a1a1a;
  --clr-border: #2a2a2a;
  --clr-text: #e0e0e0;
  --clr-text-muted: #8a8a8a;
  --clr-heading: #ffffff;
  --clr-accent: #c0392b;
  --clr-accent-soft: rgba(192, 57, 43, 0.15);
  --clr-gold: #d4a857;

  /* Typography */
  --ff-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.4s ease;
  --transition-slow: 0.6s ease;
}

/* =============== Global Reset & Base Styles =============== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* offset for fixed navbar */
}

body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--ff-body);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
}

/* =============== Typography =============== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-display);
  color: var(--clr-heading);
  font-weight: 700;
}

p {
  margin-bottom: 1.2rem;
}

strong {
  font-weight: 600;
  color: var(--clr-heading);
}

em {
  font-style: italic;
  color: var(--clr-gold);
}

::selection {
  background-color: var(--clr-accent);
  color: var(--clr-heading);
}

/* =============== Utility: Letter Spacing =============== */
.tracking-wide {
  letter-spacing: 0.3em;
}

/* =============== NAVBAR =============== */
#mainNav {
  background-color: transparent;
  padding: 1rem 0;
  transition:
    background-color var(--transition-base),
    padding var(--transition-base),
    box-shadow var(--transition-base);
}

/* Scrolled state — applied via JS */
#mainNav.scrolled {
  background-color: rgba(10, 10, 10, 0.95);
  padding: 0.6rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#mainNav .navbar-brand {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--clr-heading);
  transition: color var(--transition-fast);
}

#mainNav .navbar-brand:hover {
  color: var(--clr-gold);
}

#mainNav .nav-link {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-text-muted);
  padding: 0.5rem 1rem;
  position: relative;
  transition: color var(--transition-fast);
}

#mainNav .nav-link:hover,
#mainNav .nav-link:focus {
  color: var(--clr-heading);
}

/* Underline hover effect using pseudo-element */
#mainNav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--clr-gold);
  transition:
    width var(--transition-base),
    left var(--transition-base);
}

#mainNav .nav-link:hover::after {
  width: 60%;
  left: 20%;
}

/* =============== HERO SECTION =============== */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background-image: url("../assets/horizon.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

/* Dark gradient overlay using pseudo-element */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(10, 10, 10, 1) 100%
  );
  z-index: 0;
}

.hero-section .container {
  z-index: 1;
}

.hero-subtitle {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-xs);
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--clr-heading);
  margin-bottom: var(--space-sm);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  font-family: var(--ff-body);
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--clr-text-muted);
  max-width: 550px;
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
}

/* Scroll indicator */
.scroll-indicator {
  margin-top: var(--space-md);
}

.scroll-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--clr-text-muted);
}

.bounce-arrow {
  display: inline-block;
  font-size: 1.5rem;
  color: var(--clr-heading);
  margin-top: var(--space-xs);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* =============== SECTION LAYOUT =============== */
.section-padding {
  padding: var(--space-xl) 0;
}

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

.section-header {
  margin-bottom: var(--space-lg);
}

/* Section labels ("Chapter One", etc.) */
.section-label {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--clr-gold);
  margin-bottom: var(--space-xs);
}

.section-label--accent {
  color: var(--clr-accent);
}

.section-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--clr-heading);
  margin-bottom: var(--space-sm);
}

/* Decorative divider line */
.section-divider {
  width: 60px;
  height: 2px;
  background-color: var(--clr-gold);
  margin: 0 auto var(--space-sm);
}

.section-intro {
  font-size: 1.1rem;
  color: var(--clr-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* =============== STORY BLOCKS (text + image pairs) =============== */
.story-block {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.story-heading {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  color: var(--clr-heading);
  margin-bottom: var(--space-sm);
}

.story-text {
  font-size: 1.05rem;
  color: var(--clr-text-muted);
  line-height: 1.85;
}

/* =============== IMAGE WRAPPERS =============== */
.image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.image-wrapper img {
  transition:
    transform var(--transition-slow),
    filter var(--transition-slow);
}

/* Hover zoom + brightness boost on images */
.image-wrapper:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.image-caption {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--clr-text-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* =============== BLOCKQUOTE / PULL QUOTE =============== */
.pull-quote {
  position: relative;
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-md) var(--space-md);
  border-left: 3px solid var(--clr-gold);
  background-color: var(--clr-accent-soft);
  border-radius: 0 8px 8px 0;
}

.pull-quote p {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--clr-text);
  line-height: 1.8;
  margin-bottom: 0;
}

/* =============== PRINCIPLE CARDS =============== */
.principle-card {
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: var(--space-md);
  height: 100%;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* Hover: lift card + accent border */
.principle-card:hover {
  transform: translateY(-6px);
  border-color: var(--clr-gold);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.principle-number {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--clr-accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.principle-title {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  color: var(--clr-heading);
  margin-bottom: 0.75rem;
}

.principle-text {
  font-size: 0.95rem;
  color: var(--clr-text-muted);
  line-height: 1.75;
}

/* =============== CAROUSEL CUSTOMISATION =============== */
.carousel-caption-custom {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.carousel-caption-custom h5 {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  color: var(--clr-heading);
}

.carousel-caption-custom p {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
}

.mobile-carousel-caption {
  background-color: var(--clr-surface);
  padding: 0.9rem 1rem 1rem;
  text-align: center;
}

.mobile-carousel-caption h5 {
  font-family: var(--ff-display);
  font-size: 1rem;
  color: var(--clr-heading);
  margin-bottom: 0.35rem;
}

.mobile-carousel-caption p {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--clr-text-muted);
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.4;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.carousel-indicators .active {
  opacity: 1;
  transform: scale(1.3);
}

/* =============== STATISTICS SECTION =============== */
.personal-stats {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
}

.stat-item {
  padding: var(--space-sm);
}

.stat-number {
  display: block;
  font-family: var(--ff-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--clr-gold);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-text-muted);
}

/* =============== FOOTER =============== */
.site-footer {
  background-color: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-heading {
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-heading);
  margin-bottom: var(--space-sm);
}

.footer-text {
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  margin-bottom: 0.5rem;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--clr-text-muted);
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
}

/* Custom bullet using pseudo-element */
.footer-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--clr-gold);
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--clr-text-muted);
  margin-bottom: 0;
}

/* =============== RESPONSIVE: Tablets (max-width: 768px) =============== */
@media (max-width: 768px) {
  .hero-section {
    background-attachment: scroll; /* fix iOS parallax issue */
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .section-padding {
    padding: var(--space-lg) 0;
  }

  .story-block {
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .story-heading {
    font-size: 1.5rem;
  }

  .principle-card {
    padding: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* =============== RESPONSIVE: Mobile (max-width: 576px) =============== */
@media (max-width: 576px) {
  .carousel-indicators {
    display: none;
  }

  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .pull-quote {
    padding: 1rem;
  }

  .pull-quote p {
    font-size: 1rem;
  }

  .principle-number {
    font-size: 2rem;
  }

  .personal-stats {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }
}

/* =============== RESPONSIVE: Large screens (min-width: 1200px) =============== */
@media (min-width: 1200px) {
  .story-text {
    font-size: 1.1rem;
  }

  .section-intro {
    font-size: 1.2rem;
  }
}

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

  .bounce-arrow {
    animation: none;
  }

  .image-wrapper img {
    transition: none;
  }

  .principle-card {
    transition: none;
  }
}
