/**
 * ============================================================================
 * SUPERAWESOME - Theme Stylesheet
 * ============================================================================
 *
 * Custom styles for superaweso.me. Tailwind handles utility classes;
 * this file provides component styles, animations, and design system elements.
 *
 * TABLE OF CONTENTS
 * -----------------
 * DESIGN TOKENS ............... CSS custom properties (--popup-width)
 * 1. BASE STYLES .............. Body typography, screen reader utilities
 * 2. TYPOGRAPHY ............... Section labels and headlines
 * 3. BUTTONS .................. Skeuomorphic CTA buttons, icon buttons, tooltips
 * 4. LOGO ..................... Logo hover effect
 * 5. PORTFOLIO ................ Grid items, CTAs, lightbox, image loading
 * 6. TEXT LINKS ............... Auto-styled links in body text
 * 7. CONTACT DIALOGUE ......... WhatsApp quick-message popup
 * 8. TEXT INVERSE ............. White text overrides for dark backgrounds
 * 9. POPUP .................... Generic popup card component
 * 10. CONTACT FORM ............ Form fields, spinner, success state
 * 11. HERO .................... Intro animations, light leak effects
 * 12. MISC .................... Footer background, icon skew, skip button
 * 13. SERVICE ILLUSTRATIONS ... Large decorative section illustrations
 *
 * DESIGN PHILOSOPHY
 * -----------------
 * - Skeuomorphic buttons with physical-feeling hover/active states
 * - Subtle shadows that build up depth through multiple layers
 * - Smooth 200-300ms transitions for interactive elements
 * - Mobile-first responsive with breakpoints at 640px, 768px, 1024px
 *
 * ============================================================================
 */


/* ==========================================================================
   DESIGN TOKENS
   CSS custom properties for consistent values across components.
   ========================================================================== */

:root {
  /* Popup/dialogue panel width - used by contact-dialogue-card and popup-card */
  --popup-width: 340px;
}


/* ==========================================================================
   1. BASE STYLES
   Foundation typography applied to body, inherited by all elements.
   ========================================================================== */

/* Base styles - inherit to all elements */
body {
  font-family: 'Space Grotesk', sans-serif;
  color: black;
  font-size: 1rem;
  line-height: 1.625;
  background-color: #eef2f7;
}

/* Visually hidden - for screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
  }
}


/* ==========================================================================
   2. TYPOGRAPHY
   Section labels and headlines with Space Mono font.
   ========================================================================== */

/* Section labels - small uppercase text above headlines */
.section-label {
  font-family: 'Space Mono', monospace;
  font-weight: 500;
  color: rgba(0,0,0,0.3);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.section-label-sm {
    font-size: 0.8rem;
}

@media (min-width: 768px) {
  .section-label { font-size: 1.25rem; }
  .section-label-sm { font-size: 0.8rem; }
}

/* Section headlines */
.section-headline {
  font-family: 'Space Mono', monospace;
  font-weight: 300;
  text-transform: uppercase;
  line-height: 1.1;
  font-size: 1.875rem;
}

@media (min-width: 640px) { .section-headline { font-size: 2.25rem; } }
@media (min-width: 768px) { .section-headline { font-size: 3rem; } }
@media (min-width: 1024px) { .section-headline { font-size: 57px; } }


/* ==========================================================================
   3. BUTTONS
   Skeuomorphic button system with physical depth and tactile feedback.

   Design rationale:
   - Multi-stop gradients create a lit-from-above appearance
   - Inset shadows add inner depth (highlight top, shadow bottom)
   - Text shadow makes text feel embossed into the button
   - Transform on hover creates physical "raising" effect
   - Layered box-shadows build realistic depth (near + far shadows)
   ========================================================================== */

/*
 * Primary CTA Button (Blue)
 * Three-stop gradient: light top → mid → dark bottom
 * Creates the illusion of a 3D button lit from above
 */
.cta-button {
  position: relative;
  background: linear-gradient(to bottom, #4d8fff 0%, #1d6aff 10%, #0c4fd0 100%);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.cta-button:hover::after {
  opacity: 1;
}

.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.2),
    0 6px 12px rgba(0, 0, 0, 0.12),
    0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  outline: none;
}

.cta-button:focus-visible::after {
  opacity: 1;
}

/* Active state - button "pressed down" slightly */
.cta-button:active {
  transform: translateY(-1px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/*
 * Dark Button Variant (Black/Gray)
 * Same skeuomorphic style, darker palette
 */
.btn-dark {
  position: relative;
  background: linear-gradient(to bottom, #4a4a4a 0%, #2a2a2a 10%, #1a1a1a 100%);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.btn-dark:hover::after {
  opacity: 1;
}

.btn-dark:hover,
.btn-dark:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.25),
    0 6px 12px rgba(0, 0, 0, 0.18),
    0 3px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  outline: none;
}

.btn-dark:focus-visible::after {
  opacity: 1;
}

.btn-dark:active {
  transform: translateY(-1px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/*
 * Button Sizes
 * Three sizes for different contexts: sm (navigation), md (primary CTA), lg (hero)
 */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1rem;
}

.btn-md {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.25rem;
}

/*
 * Icon Button
 * Circular button for icon-only actions (close, toggle, etc.)
 * Add to existing button variant: .cta-button.btn-icon.btn-md
 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  aspect-ratio: 1;
}

.btn-icon svg {
  width: 50%;
  height: 50%;
  fill: currentColor;
}

/* Icon Button Sizes */
.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.btn-icon.btn-md {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
}

.btn-icon.btn-lg {
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
}

/*
 * Tooltip
 * Shows on hover/focus via ::before pseudo-element.
 * Usage: <button class="has-tooltip" data-tooltip="Label">
 */
.has-tooltip {
  position: relative;
}

.has-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.375rem 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
  z-index: 50;
}

.has-tooltip:hover::before,
.has-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   4. LOGO
   Subtle hover lift effect for logo links.
   ========================================================================== */

.logo-link {
  font-style: italic;
  display: inline-block;
  transform: translateY(0);
  transition: transform 0.2s ease;
}

.logo-link:hover,
.logo-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}


/* ==========================================================================
   5. PORTFOLIO
   Grid items with hover-reveal CTAs, lazy-loaded images, and lightbox.

   Layout:
   - Portfolio items can be full-width (fw) or half-width (hw)
   - CTA buttons appear on hover (desktop) or tap (mobile)
   - Grid lines only visible on md+ screens
   ========================================================================== */

/* Portfolio item container */
.portfolio-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0.5rem;
}

@media (min-width: 768px) {
  .portfolio-item {
    padding: 3rem 2.5rem;
  }
}

@media (min-width: 1024px) {
  .portfolio-item {
    padding: 4rem;
  }
}

/* Portfolio CTA wrapper - handles positioning and visibility */
.portfolio-cta-wrap {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .portfolio-cta-wrap {
    bottom: 4.5rem;
  }
}

@media (min-width: 1024px) {
  .portfolio-cta-wrap {
    bottom: 6rem;
  }
}

/* Desktop: show on hover or keyboard focus */
.portfolio-item:hover .portfolio-cta-wrap,
.portfolio-item:focus-within .portfolio-cta-wrap,
.portfolio-cta-wrap:has(:focus),
.portfolio-cta-wrap:has(:focus-visible) {
  opacity: 1;
  pointer-events: auto;
}

/* Hide CTA when dialogue is open */
.portfolio-item.active .portfolio-cta-wrap {
  opacity: 0;
  pointer-events: none;
}

/* Mobile: tap to reveal */
.portfolio-item.tapped .portfolio-cta-wrap {
  opacity: 1;
  pointer-events: auto;
}

/* Portfolio CTA button */
.portfolio-cta {
  text-decoration: none;
  white-space: nowrap;
}

/* Ensure portfolio CTA is visible when focused */
.portfolio-cta:focus,
.portfolio-cta:focus-visible {
  outline: 2px solid var(--blue-primary);
  outline-offset: 2px;
}

/* Portfolio grid lines - mobile */
@media (max-width: 767px) {
  .portfolio-item {
    border-bottom: 1px solid #c9d5e3;
  }

  .portfolio-item:last-child {
    border-bottom: none;
  }
}

/* Portfolio grid lines - large screens */
@media (min-width: 768px) {
  .portfolio-item {
    border-bottom: 1px solid #c9d5e3;
  }

  /* Vertical line only between HW pairs (left item of pair) */
  .portfolio-item.hw-left {
    border-right: 1px solid #c9d5e3;
  }

  /* Remove bottom border from last row */
  .portfolio-item:last-child {
    border-bottom: none;
  }
}

/* Progressive image loading fade-in */
.portfolio-item img {
  max-width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portfolio-item img.loaded {
  opacity: 1;
}

/* Portfolio image lightbox - desktop only */
@media (min-width: 768px) {
  .portfolio-item img.loaded {
    cursor: zoom-in;
  }
}

.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.portfolio-lightbox.visible {
  opacity: 1;
  visibility: visible;
}

.portfolio-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.portfolio-lightbox.visible img {
  transform: scale(1);
}


/* ==========================================================================
   6. TEXT LINKS
   Auto-styled links within body text elements.
   Uses :where() for zero-specificity, easy to override.
   Underline grows and turns blue on hover.
   ========================================================================== */

:where(p, li, address, dd, td, figcaption) a {
  position: relative;
  text-decoration: none;
}

:where(p, li, address, dd, td, figcaption) a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: currentColor;
  z-index: -1;
  transition: height 0.15s ease, background-color 0.15s ease;
}

:where(p, li, address, dd, td, figcaption) a:hover::after,
:where(p, li, address, dd, td, figcaption) a:focus-visible::after {
  height: 0.5em;
  background-color: #0057ff;
}

:where(p, li, address, dd, td, figcaption) a:focus-visible {
  outline: none;
}


/* ==========================================================================
   7. CONTACT DIALOGUE
   WhatsApp quick-message popup triggered from portfolio CTAs.
   Positioned over the clicked button, slides up on open.

   Mobile: Full-screen bottom sheet
   Desktop: Floating card anchored to CTA button
   ========================================================================== */

.contact-dialogue {
  position: fixed;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom center;
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0.15s;
}

.contact-dialogue.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.3s;
}

/* Card - shares base styles with .popup-card */
.contact-dialogue-card {
  position: relative;
  width: var(--popup-width);
  max-height: calc(100dvh - 2rem);
  padding: 1.5rem;
  background: linear-gradient(165deg, #ffffff 0%, #fafbff 100%);
  border-radius: 1.25rem;
  border: 1px solid rgba(0, 87, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 16px 32px rgba(0, 87, 255, 0.08),
    0 32px 64px rgba(0, 87, 255, 0.06);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Close button */
.contact-dialogue-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  transition: color 0.15s ease, transform 0.15s ease;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.contact-dialogue-close:hover,
.contact-dialogue-close:focus-visible {
  color: rgba(0, 0, 0, 0.6);
  outline: none;
}

.contact-dialogue-close:active {
  transform: scale(0.92);
}

/* Illustration */
.contact-dialogue-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Header */
.contact-dialogue-header {
  margin-bottom: 1rem;
  text-align: center;
}

.contact-dialogue-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0057ff;
}

/* Message area */
.contact-dialogue-message-wrap {
  margin-bottom: 1.25rem;
}

/* Speech bubble */
.contact-dialogue-bubble {
  position: relative;
  background: #eef2f7;
  border-radius: 1rem;
  padding: 1rem;
}

.contact-dialogue-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #eef2f7;
}

.contact-dialogue-textarea {
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: black;
  resize: none;
  text-align: center;
}

.contact-dialogue-textarea::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.contact-dialogue-textarea:focus {
  outline: none;
}

/* Footer */
.contact-dialogue-footer {
  margin: 1rem 0 0 0;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.35);
}

/* QR toggle button */
.contact-dialogue-qr-toggle {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  transition: color 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.contact-dialogue-qr-toggle:hover,
.contact-dialogue-qr-toggle:focus-visible {
  color: rgba(0, 0, 0, 0.6);
  outline: none;
}

.contact-dialogue-qr-toggle:active {
  transform: scale(0.92);
}

.contact-dialogue-qr-toggle.active {
  color: #0057ff;
}

/* QR code view */
.contact-dialogue-qr-view {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  height: 100%;
}

/* Show as flex only when not hidden */
.contact-dialogue-qr-view:not(.hidden) {
  display: flex;
}

.contact-dialogue-qr-code {
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.25rem;
}

.contact-dialogue-qr-code img {
  display: block;
}

.contact-dialogue-qr-instructions {
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.5;
  max-width: 220px;
}

/* Mobile styles */
@media (max-width: 767px) {
  .contact-dialogue {
    top: 20px;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transform-origin: bottom center;
  }

  .contact-dialogue.visible {
    transform: translateY(0);
  }

  .contact-dialogue-card {
    width: 100%;
    max-width: none;
    max-height: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .contact-dialogue-close {
    display: flex;
  }

  .contact-dialogue-header {
    margin-bottom: 1.5rem;
  }

  .contact-dialogue-label {
    font-size: 0.875rem;
  }

  .contact-dialogue-message-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
  }

  .contact-dialogue-bubble {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .contact-dialogue-textarea {
    flex: 1;
    min-height: 120px;
    font-size: 1rem;
  }

  .contact-dialogue-footer {
    margin-top: 1.25rem;
  }
}


/* ==========================================================================
   8. TEXT INVERSE
   White text overrides for dark-background sections.
   Apply to a container to flip text, labels, and link colors.
   ========================================================================== */

.text-inverse {
  color: white;
}

.text-inverse .section-label {
  color: rgba(255, 255, 255, 0.5);
}

.text-inverse :where(p, li, address, dd, td, figcaption) a {
  color: inherit;
}

.text-inverse :where(p, li, address, dd, td, figcaption) a:hover::after {
  background-color: rgba(255, 255, 255, 0.5);
}


/* ==========================================================================
   9. POPUP
   Generic popup card component for contact forms.
   Similar to contact-dialogue but with form-specific features.

   Components:
   - .popup: Container with show/hide transitions
   - .popup-card: The visual card with shadows
   - .popup-close-icon / .popup-close-text: Two close button styles
   - .popup-header, .popup-label: Header content
   ========================================================================== */

.popup {
  position: fixed;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom center;
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0.15s;
}

.popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.3s;
}

/* Shares base styles with .contact-dialogue-card */
.popup-card {
  position: relative;
  width: var(--popup-width);
  max-height: calc(100dvh - 2rem);
  padding: 1.5rem;
  background: linear-gradient(165deg, #ffffff 0%, #fafbff 100%);
  border-radius: 1.25rem;
  border: 1px solid rgba(0, 87, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 16px 32px rgba(0, 87, 255, 0.08),
    0 32px 64px rgba(0, 87, 255, 0.06);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Popup close button - icon style (top right) */
.popup-close-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  transition: color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.popup-close-icon:hover,
.popup-close-icon:focus-visible {
  color: rgba(0, 0, 0, 0.6);
  outline: none;
}

.popup-close-icon:active {
  transform: scale(0.92);
}

.popup-close-icon.hidden {
  display: none;
}

/* Popup close button - text link style (bottom) */
.popup-close-text {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.4);
  text-align: center;
  transition: color 0.15s ease;
}

.popup-close-text:hover,
.popup-close-text:focus-visible {
  color: rgba(0, 0, 0, 0.7);
  outline: none;
}

.popup-close-text.hidden {
  display: none;
}

/* Popup illustration */
.popup-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Popup header */
.popup-header {
  margin-bottom: 1rem;
  text-align: center;
}

.popup-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0057ff;
}

/* Alternative popup label - larger */
.popup-label-lg {
  font-family: 'Space Mono', monospace;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0057ff;
  margin: 0 0 1em 0;
}

/* Mobile: full screen popup */
@media (max-width: 767px) {
  .popup {
    top: 20px;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transform-origin: bottom center;
  }

  .popup.visible {
    transform: translateY(0);
  }

  .popup-card {
    width: 100%;
    max-width: none;
    max-height: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .popup-header {
    margin-bottom: 1.5rem;
  }

  .popup-label {
    font-size: 0.875rem;
  }
}


/* ==========================================================================
   10. CONTACT FORM
   Email form styling: fields, validation, submit button, success state.
   Uses bottom-border-only input style for a clean, minimal look.
   ========================================================================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.5);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0 0 0.5rem 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid #e1e8f0;
  border-radius: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: black;
  transition: border-color 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: #0057ff;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.form-field textarea {
  field-sizing: content;
  min-height: 1lh;
  resize: none;
}

/* Form submit button spacing */
.contact-form button[type="submit"] {
  margin-top: 0.75rem;
}

/* Spinner */
.form-spinner {
  margin-left: 0.5rem;
  animation: spin 1s linear infinite;
}

.form-spinner.hidden {
  display: none;
}

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

/* Success state */
.popup-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.popup-success.hidden {
  display: none;
}

.success-icon {
  margin-bottom: 0.5rem;
}

.success-title {
  font-family: 'Space Mono', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0057ff;
}

.success-message {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.6);
}


/* ==========================================================================
   11. HERO
   Intro animations for the hero section.

   Animation sequence (controlled by JavaScript):
   1. Section fades in (0.8s)
   2. Light leak overlay fades in (after 800ms)
   3. Words appear one by one (15ms intervals)
   4. Footer slides up (after words complete)

   Portrait mode:
   - Hero footer becomes sticky to prevent text overflow on tall screens
   ========================================================================== */

/* Hero section - default/landscape */
#hero-section {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#hero-section.loaded {
  opacity: 1;
}

/* Light leak overlays */
#hero-light-leak,
#mission-light-leak {
  opacity: 0;
  transition: opacity 1s ease;
}

#hero-light-leak.loaded,
#mission-light-leak.loaded {
  opacity: 1;
}

/* Hero footer animation */
#hero-footer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#hero-footer.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Hero text word animation */
#hero-text span {
  opacity: 0;
  transition: opacity 0.2s ease, text-shadow 0.2s ease;
  cursor: default;
}

#hero-text span.visible {
  opacity: 0.8;
}

#hero-text span.visible:hover {
  opacity: 1;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

#hero-text span.always-white.visible {
  opacity: 1;
}

/* Hero section - portrait/tall orientation adjustments (4:3 or taller) */
@media (max-aspect-ratio: 4/3) {
  #hero-section {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  #hero-footer {
    position: sticky;
    bottom: 0;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -2.5rem;
    padding: 3rem 1.5rem 2.5rem;
    background: linear-gradient(to top, #0057ff 50%, transparent);
  }
}

@media (max-aspect-ratio: 4/3) and (min-width: 768px) {
  #hero-footer {
    margin-left: -2.5rem;
    margin-right: -2.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (max-aspect-ratio: 4/3) and (min-width: 1024px) {
  #hero-footer {
    margin-left: -4rem;
    margin-right: -4rem;
    padding-left: 4rem;
    padding-right: 4rem;
  }
}


/* ==========================================================================
   12. MISC
   One-off utilities and component-specific styles.
   ========================================================================== */

/* Footer light leak background - decorative glow effect */
.footer-light-leak {
  background-image: url('../images/glitch-stream-03.webp');
}

/* Portfolio CTA icon skew - matches Superawesome logo angle */
.portfolio-cta-icon {
  transform: skewX(-8deg);
}

/* Skip Portfolio Button - accessibility skip link
   Mobile: fixed at bottom, appears while scrolling portfolio
   Desktop: hidden until focused (keyboard accessibility) */
.skip-portfolio-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

/* Always show on keyboard focus for accessibility */
.skip-portfolio-btn:focus-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-3px);
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Mobile: also show while scrolling through portfolio */
@media (max-width: 767px) {
  .skip-portfolio-btn.visible {
    opacity: 1;
    visibility: visible;
  }

  .skip-portfolio-btn:hover {
    transform: translateX(-50%) translateY(-3px);
  }

  .skip-portfolio-btn:active {
    transform: translateX(-50%) translateY(-1px);
  }
}


/* ==========================================================================
   13. SERVICE ILLUSTRATIONS
   Large decorative illustrations for service sections.

   Layout:
   - Desktop: Fixed height (92dvh), positioned on right side
   - Mobile: Centered, 80% width, placed after section heading
   ========================================================================== */

/* Wrapper for illustration - absolute positioning on desktop */
.service-illustration {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.service-illustration img {
  width: 80%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

/* Desktop: position on right side */
@media (min-width: 1024px) {
  .service-illustration {
    position: absolute;
    right: 4rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    pointer-events: none;
  }

  .service-illustration img {
    width: auto;
    height: 92dvh;
    max-height: none;
  }
}
