/* ==========================================================================
   components.css — Component-Level Styles
   Justin Psaila Portfolio
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page Views (SPA routing)
   -------------------------------------------------------------------------- */
.page-view {
  display: none;
  min-height: 100vh;
  animation: pageFadeIn 0.35s ease forwards;
}

.page-view.is-active {
  display: block;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes pageFadeIn {
    from { opacity: 1; transform: none; }
    to   { opacity: 1; transform: none; }
  }
}

/* --------------------------------------------------------------------------
   2. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 5rem 1rem;
}

@media (min-width: 576px) {
  .hero { padding: 6rem 1.5rem; }
}

@media (min-width: 992px) {
  .hero { padding: 8rem 1.5rem; }
}

.hero__overline {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero__headline {
  max-width: 80rem;
  margin-bottom: 2rem;
}

.hero__description {
  max-width: 28rem;
  color: var(--muted-foreground);
  line-height: 1.625;
  margin-bottom: 0;
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 576px) {
  .hero__ctas {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hero__ctas .btn {
    width: auto;
  }
}

.hero__content-row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 64rem;
}

@media (min-width: 768px) {
  .hero__content-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 4rem;
  }
}

/* --------------------------------------------------------------------------
   3. Section Wrappers
   -------------------------------------------------------------------------- */
.section--grey {
  background-color: var(--secondary);
}

.section--white {
  background-color: var(--background);
}

.section-padding {
  padding: 4rem 1rem;
}

@media (min-width: 576px) {
  .section-padding { padding: 4rem 1.5rem; }
}

@media (min-width: 992px) {
  .section-padding { padding: 6rem 1.5rem; }
}

/* --------------------------------------------------------------------------
   4. Section Heading Block
   -------------------------------------------------------------------------- */
.section-heading-block {
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .section-heading-block { margin-bottom: 3.5rem; }
}

.section-heading-block__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   5. Project Cards
   -------------------------------------------------------------------------- */
.project-card {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
  display: block;
  color: var(--foreground);
  text-decoration: none;
}

.project-card:hover,
.project-card:focus-visible {
  color: var(--foreground);
  text-decoration: none;
  outline: none;
}

.project-card:focus-visible .project-card__frame {
  box-shadow: 0 0 0 3px var(--accent);
}

.project-card__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--muted);
  margin-bottom: 1rem;
  transition: box-shadow 0.3s ease;
}

@media (min-width: 576px) {
  .project-card__frame { margin-bottom: 1.25rem; }
}

.project-card__image {
  width: 100%;
  height: 14rem;
  object-fit: cover;
  display: block;
  transition: transform 0.7s ease;
  background-color: var(--muted);
}

@media (min-width: 576px) {
  .project-card__image { height: 16rem; }
}

@media (min-width: 992px) {
  .project-card__image { height: 18rem; }
}

.project-card:hover .project-card__image,
.project-card:focus-visible .project-card__image {
  transform: scale(1.04);
}

/* Password-protected badge */
.project-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  background-color: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.project-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.project-card__title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--foreground);
  margin: 0;
  transition: color 0.3s ease;
}

.project-card:hover .project-card__title,
.project-card:focus-visible .project-card__title {
  color: var(--accent);
}

.project-card__arrow {
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: color 0.3s ease, transform 0.3s ease;
  margin-top: 0.125rem;
}

.project-card:hover .project-card__arrow,
.project-card:focus-visible .project-card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-card__description {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. Back Button
   -------------------------------------------------------------------------- */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.25s ease;
  margin-bottom: 2rem;
  text-decoration: none;
}

.btn-back:hover,
.btn-back:focus-visible {
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.btn-back:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   7. About Snippet Section
   -------------------------------------------------------------------------- */
.about-snippet__body {
  max-width: 44rem;
}

.about-snippet__body p {
  font-size: 1.0625rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   8. Bio Page
   -------------------------------------------------------------------------- */
.bio-page__container {
  max-width: 56rem;
  margin: 0 auto;
}

.bio-page__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bio-page__body p {
  font-size: 1.0625rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0;
}

.bio-page__body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. Work Page
   -------------------------------------------------------------------------- */
.work-page__intro {
  max-width: 42rem;
}

/* --------------------------------------------------------------------------
   10. Case Study — Shared Container
   -------------------------------------------------------------------------- */
.case-study-container {
  max-width: 56rem;
  margin: 0 auto;
}

/* Metadata row */
.case-study__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.case-study__meta-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.case-study__meta-item span {
  font-size: 0.9375rem;
  color: var(--foreground);
  font-weight: 500;
}

/* Hero image */
.case-study__hero-img {
  width: 100%;
  height: 20rem;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

@media (min-width: 768px) {
  .case-study__hero-img { height: 26rem; }
}

/* Tools list */
.case-study__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. Case Study — Chapter-Based Layout
   -------------------------------------------------------------------------- */
.cs-chapter {
  position: relative;
  padding: 5rem 0;
}

@media (min-width: 768px) {
  .cs-chapter { padding: 6rem 0; }
}

/* Large watermark number */
.cs-chapter__watermark {
  position: absolute;
  top: 0;
  left: -1rem;
  font-size: 11.25rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.03;
  color: var(--foreground);
  pointer-events: none;
  user-select: none;
  line-height: 11.25rem;
}

@media (max-width: 575.98px) {
  .cs-chapter__watermark { font-size: 7rem; line-height: 7rem; }
}

/* Chapter label */
.cs-chapter__label {
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--chapter-grey);
  margin-bottom: 0.75rem;
}

/* Heading row with extending divider */
.cs-chapter__heading-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.cs-chapter__heading-row h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
  margin: 0;
}

.cs-chapter__divider {
  flex: 1;
  height: 1px;
  background-color: var(--divider);
}

/* Coral accent bar (Chapter 01 only) */
.cs-chapter__accent-bar {
  width: 4rem;
  height: 4px;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  margin-top: 1.5rem;
}

/* Chapter body text */
.cs-chapter__body {
  margin-top: 2rem;
}

.cs-chapter__body p {
  font-size: 1.125rem;
  line-height: 1.625;
  letter-spacing: -0.01em;
  color: var(--text-body-dark);
  margin-bottom: 1.5rem;
}

.cs-chapter__body p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   12. Bordered Text Block (Challenge)
   -------------------------------------------------------------------------- */
.challenge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .challenge-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.bordered-text-block {
  border-left: 4px solid var(--accent);
  padding-left: 2.25rem;
  position: relative;
}

@media (max-width: 575.98px) {
  .bordered-text-block { padding-left: 1.5rem; }
}

.bordered-text-block p {
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--text-body-dark);
  margin: 0;
}

.challenge-image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 18rem;
}

.challenge-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   13. Key Features Grid
   -------------------------------------------------------------------------- */
.key-features {
  margin-top: 3rem;
}

.key-features__label {
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--chapter-grey);
  margin-bottom: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 576px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.feature-item__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background-color: rgba(240, 96, 64, 0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
}

.feature-item__icon svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-item__text {
  font-size: 1rem;
  line-height: 1.625;
  letter-spacing: -0.01em;
  color: var(--text-body-dark);
  margin: 0;
}

/* --------------------------------------------------------------------------
   14. Solution Images (Showcase)
   -------------------------------------------------------------------------- */
.solution-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .solution-images { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

.solution-images img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

@media (min-width: 768px) {
  .solution-images img { height: 20rem; }
}

/* --------------------------------------------------------------------------
   15. Metrics / Results Cards
   -------------------------------------------------------------------------- */
.results-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .results-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 992px) {
  .results-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Numeric metric card (e.g. "95% improvement") */
.metric-card {
  border: 1px solid var(--divider);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background-color: var(--background);
}

.metric-card__number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin: 0;
}

@media (min-width: 576px) {
  .metric-card__number { font-size: 3rem; }
}

.metric-card__label {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary-dark);
  margin: 0;
}

/* Text-only impact card (no leading number) */
.impact-card {
  border: 1px solid var(--divider);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--background);
}

.impact-card__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background-color: rgba(200, 64, 48, 0.08);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-card__icon svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.impact-card__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-body-dark);
  margin: 0;
}

/* Impact image */
.impact-image {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.impact-image img {
  width: 100%;
  height: 18rem;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   16. Challenges & Learnings
   -------------------------------------------------------------------------- */
.c-l-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .c-l-grid { grid-template-columns: repeat(2, 1fr); }
}

.c-l-column__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.c-l-column__title svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.c-l-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.c-l-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Icon circle — mirrors .feature-item__icon for visual consistency */
.c-l-list__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background-color: rgba(200, 64, 48, 0.08);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
}

.c-l-list__icon svg {
  width: 0.8rem;
  height: 0.8rem;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   17. Gallery
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background-color: var(--muted);
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  display: block;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

/* Hover overlay with expand icon */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  background-color: rgba(0, 0, 0, 0.28);
}

.gallery-item__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
  color: #fff;
}

.gallery-item:hover .gallery-item__icon,
.gallery-item:focus-visible .gallery-item__icon {
  opacity: 1;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   18. Lightbox
   -------------------------------------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
  user-select: none;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Chrome buttons (close, prev, next) ── */
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background-color 0.2s ease;
  min-height: 44px;
  min-width: 44px;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox-nav:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* Position */
.lightbox-close {
  top: 1rem;
  right: 1rem;
  padding: 0.5rem;
}

.lightbox-nav--prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.625rem;
}

.lightbox-nav--next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.625rem;
}

/* Tuck nav buttons in on small screens */
@media (max-width: 575.98px) {
  .lightbox-nav--prev { left: 0.375rem; }
  .lightbox-nav--next { right: 0.375rem; }
}

/* ── Counter ── */
.lightbox-counter {
  position: absolute;
  top: 1.125rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Image wrapper ── */
.lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 9rem);
  max-height: 90vh;
}

@media (max-width: 575.98px) {
  .lightbox-img-wrap { max-width: calc(100vw - 2.5rem); }
}

/* ── Image ── */
.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  transition: opacity 0.2s ease;
  display: block;
}

.lightbox-img.is-loading { opacity: 0; }

/* ── Spinner ── */
.lightbox-spinner {
  position: absolute;
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: lb-spin 0.65s linear infinite;
  display: none;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-spinner  { animation-duration: 0.01ms; }
  .lightbox-img      { transition: none; }
  .lightbox-overlay  { transition: none; }
}

/* --------------------------------------------------------------------------
   19. Password Modal Customisation (Bootstrap override)
   -------------------------------------------------------------------------- */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.modal-header {
  border-bottom: none;
  padding: 1.5rem 1.5rem 0.75rem;
}

.modal-body {
  padding: 1rem 1.5rem 1.5rem;
}

.modal-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Input */
.form-control {
  background-color: var(--input-background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  color: var(--foreground);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-control:focus {
  background-color: var(--input-background);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 96, 64, 0.15);
  outline: none;
  color: var(--foreground);
}

.form-control.is-invalid {
  border-color: var(--destructive);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(212, 24, 61, 0.15);
}

.invalid-feedback {
  display: none;
  font-size: 0.875rem;
  color: var(--destructive);
  margin-top: 0.375rem;
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* --------------------------------------------------------------------------
   20. Contact Form
   -------------------------------------------------------------------------- */
.contact-section {
  background-color: var(--secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

@media (min-width: 768px) {
  .contact-section { padding: 3rem; }
}

.contact-form .form-group {
  margin-bottom: 1.25rem;
}

.contact-form label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.375rem;
}

.contact-form label .required-mark {
  color: var(--accent);
  margin-left: 0.125rem;
}

.contact-form .form-hint {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.contact-form textarea.form-control {
  resize: vertical;
  min-height: 9rem;
}

.contact-form .form-success {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: rgba(240, 96, 64, 0.04);
}

.form-success__icon {
  width: 4rem;
  height: 4rem;
  background-color: rgba(240, 96, 64, 0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.form-success__icon svg {
  width: 2rem;
  height: 2rem;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Spinning loader inside submit button */
.btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 0.01ms; }
}

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

@media (min-width: 576px) {
  .site-footer { padding: 3rem 1.5rem; }
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
}

.site-footer__copy {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

@media (min-width: 576px) {
  .site-footer__links {
    flex-direction: row;
    gap: 1.5rem;
  }
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.25s ease;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

.site-footer__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   22. Scroll Progress Bar
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--accent);
  width: 0%;
  z-index: 1100;
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   24. 404 / Error State
   -------------------------------------------------------------------------- */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}

/* --------------------------------------------------------------------------
   25. Utility helpers (eliminates inline styles)
   -------------------------------------------------------------------------- */

.text-body-lg {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.btn-max-sm {
  max-width: 12rem;
}

.text-body-colour {
  color: var(--foreground);
}

/* Case study rendered content helpers */
.cs-story-image {
  margin: 0;
}

.cs-story-image__img {
  width: 100%;
  height: 22rem;
  object-fit: cover;
  display: block;
}

.cs-gallery-heading {
  font-size: 1.125rem;
}

.cs-nav__item--right {
  text-align: right;
}

.cs-description {
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.cs-hero-figure {
  margin: 0;
}

/* --------------------------------------------------------------------------
   26. Tooltip (Bootstrap override)
   -------------------------------------------------------------------------- */
.tooltip-inner {
  background-color: var(--foreground);
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   26. Case Study — Next / Previous Nav
   -------------------------------------------------------------------------- */
.cs-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-top: 3rem;
}

@media (min-width: 576px) {
  .cs-nav {
    flex-direction: row;
    justify-content: space-between;
  }
}

.cs-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-nav__direction {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.cs-nav__title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: color 0.25s ease;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  text-decoration: none;
}

.cs-nav__title:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   28. Password Gate (case study pages)
   -------------------------------------------------------------------------- */
.password-gate {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(0.85) brightness(0.94);
  -webkit-backdrop-filter: blur(18px) saturate(0.85) brightness(0.94);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.password-gate.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.password-gate[hidden] {
  display: none;
}

/* NOTE: .case-study-content--locked (blur overlay) is intentionally removed.
   Protected content is never rendered into the DOM before authentication —
   the gate now sits over a public teaser. No CSS-bypass is possible. */

/* Public teaser — visible beneath the password gate overlay */
.case-study-teaser {
  padding-bottom: 4rem;
}

.case-study-teaser__img {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.case-study-teaser__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(2px) brightness(0.92);   /* subtle treatment since gate sits on top */
}

.case-study-teaser__body {
  max-width: 720px;
  padding: 0 1rem;
}

.case-study-teaser__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.password-gate__card {
  width: 100%;
  max-width: 28rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.password-gate__icon {
  width: 3rem;
  height: 3rem;
  background-color: var(--secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.password-gate__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.password-gate__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.password-gate__hint {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.password-gate__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   29. Breadcrumb / site nav bar for standalone pages
   -------------------------------------------------------------------------- */
.site-nav {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 576px) {
  .site-nav { padding: 1rem 1.5rem; }
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav__brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.25s ease;
}

.site-nav__brand:hover { color: var(--accent); }

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav__link {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--accent);
}

.site-nav__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Mobile nav — must live here (after the flex rule above) so the cascade
   correctly overrides display:flex to display:none at narrow viewports.    */
@media (max-width: 767px) {
  .site-nav__toggle {
    display: flex;
  }

  .site-nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem;
    flex-direction: column;
    gap: 0;
    z-index: 1050;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  }

  .site-nav__links.is-open {
    display: flex;
  }

  .site-nav__link {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-nav__link:last-child {
    border-bottom: none;
  }
}
