/**
 * OMPC Website Styles
 * Main stylesheet for Dr. Simon Overduin's clinic website
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Base colors */
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #f9fafb;
  --link: #1d4ed8;
  --max: 980px;
  --radius: 14px;
  --header-height: 76px;
  --bg-blur: 0px;

  /* Section backgrounds - alternating scheme */
  --section-light: rgba(255, 255, 255, 0.8);
  --section-light-hover: rgba(255, 255, 255, 0.98);
  --section-tinted: rgba(236, 244, 255, 0.8);
  --section-tinted-hover: rgba(230, 240, 255, 0.98);
  --section-border: rgba(229, 231, 235, 0.4);

  /* Unified card colors - works on both backgrounds */
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-bg-hover: rgba(255, 255, 255, 0.98);
  --card-border: rgba(209, 213, 219, 0.6);
  --card-border-hover: rgba(156, 163, 175, 0.7);

  /* Unified action/button colors */
  --action-bg: rgba(255, 255, 255, 0.92);
  --action-bg-hover: rgba(226, 251, 255, 0.329);
  --action-border: rgba(160, 203, 255, 0.8);
  --action-border-hover: rgba(96, 165, 250, 0.9);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  position: relative;
}

/* Parallax background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-image: url("/assets/1804e2fa864f426d8033c73ee4cba746.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: -1;
  filter: blur(var(--bg-blur));
  transition: filter 0.3s ease;
}

/* Overlay to darken background slightly */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
  pointer-events: none;
}

/* Smooth scrolling with proper offset for anchor links */
section {
  scroll-margin-top: var(--header-height);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: headerSlideDown 0.5s ease-out;
}

@keyframes headerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.nav-list a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 150ms ease, border-color 150ms ease;
}

.nav-list a:hover {
  background: var(--card);
  border-color: var(--border);
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

@media (max-width: 720px) {
  section {
    scroll-margin-top: calc(var(--header-height) + 10px);
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand toggle"
      "links links";
    align-items: center;
    gap: 10px;
  }

  .brand {
    grid-area: brand;
  }

  .nav {
    grid-area: toggle;
    justify-self: end;
    display: contents;
  }

  .nav-toggle {
    grid-area: toggle;
    display: inline-flex;
    justify-self: end;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    transition: background 150ms ease;
  }

  .nav-toggle:hover {
    background: var(--card);
  }

  .hamburger {
    width: 22px;
    height: 2px;
    background: var(--text);
    position: relative;
    display: inline-block;
    transition: background 150ms ease;
  }

  .hamburger::before,
  .hamburger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 200ms ease, top 200ms ease;
  }

  .hamburger::before {
    top: -7px;
  }

  .hamburger::after {
    top: 7px;
  }

  /* Hamburger animation when menu is open */
  .nav.is-open .hamburger {
    background: transparent;
  }

  .nav.is-open .hamburger::before {
    transform: rotate(45deg);
    top: 0;
  }

  .nav.is-open .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* Mobile menu list - hidden by default */
  .nav-list {
    grid-area: links;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  }

  .nav.is-open .nav-list {
    max-height: 400px;
    opacity: 1;
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }

  .nav-list li {
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(-8px);
    transition: transform 250ms ease, opacity 250ms ease;
  }

  .nav.is-open .nav-list li {
    transform: translateY(0);
    opacity: 1;
  }

  /* Staggered animation for menu items */
  .nav.is-open .nav-list li:nth-child(1) {
    transition-delay: 80ms;
  }
  .nav.is-open .nav-list li:nth-child(2) {
    transition-delay: 130ms;
  }
  .nav.is-open .nav-list li:nth-child(3) {
    transition-delay: 180ms;
  }
  .nav.is-open .nav-list li:nth-child(4) {
    transition-delay: 230ms;
  }

  .nav-list a {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    text-decoration: none;
    color: var(--text);
  }

  .nav-list a:active,
  .nav-list a:hover {
    background: var(--card);
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  position: relative;
}

.hero-content {
  max-width: 800px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hero on-load animations */
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin: 0 0 20px;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 0.8s ease-out 0.2s forwards;
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero p {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  margin: 0 0 40px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(25px);
  animation: heroFadeUp 0.7s ease-out 0.5s forwards;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp 0.6s ease-out 0.8s forwards;
}

.hero-button {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
  border: 2px solid white;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 200ms ease;
}

.hero-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.hero-button.primary {
  background: white;
  color: var(--text);
}

.hero-button.primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: scrollIndicatorFadeIn 0.5s ease-out 1.2s forwards,
    bounce 2s 1.7s infinite;
}

@keyframes scrollIndicatorFadeIn {
  to {
    opacity: 0.7;
  }
}

.scroll-indicator::after {
  content: "↓";
  font-size: 2rem;
  color: white;
  opacity: 0.7;
}

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

@media (max-width: 720px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-button {
    width: 100%;
    max-width: 300px;
  }
}

/* ==========================================================================
   Layout & Cards
   ========================================================================== */

.grid {
  display: grid;
  gap: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  overflow: visible;
}

/* Section headings */
.card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--link), rgba(29, 78, 216, 0.3));
  border-radius: 2px;
}

.card {
  padding: 32px 16px;
  box-shadow: none;
  position: relative;
  border: 1px solid var(--section-border);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out,
    background 200ms ease, box-shadow 200ms ease;
}

/* Round only the outer corners of first and last cards */
#about.card {
  border-radius: var(--radius) var(--radius) 0 0;
}

#contact.card {
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: 1px solid var(--section-border);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for child cards */
.card.is-visible .info-card,
.card.is-visible .action-card,
.card.is-visible .contact-card {
  opacity: 0;
  transform: translateY(15px);
  animation: cardChildFadeIn 0.4s ease-out forwards;
}

.card.is-visible .info-card:nth-child(1),
.card.is-visible .action-card:nth-child(1),
.card.is-visible .contact-card:nth-child(1) {
  animation-delay: 0.1s;
}
.card.is-visible .info-card:nth-child(2),
.card.is-visible .action-card:nth-child(2),
.card.is-visible .contact-card:nth-child(2) {
  animation-delay: 0.2s;
}
.card.is-visible .info-card:nth-child(3),
.card.is-visible .action-card:nth-child(3) {
  animation-delay: 0.3s;
}
.card.is-visible .info-card:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes cardChildFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.card-light {
  background: var(--section-light);
}

.card-light:hover {
  background: var(--section-light-hover);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.08);
}
.card-tinted {
  background: var(--section-tinted);
}
.card-tinted:hover {
  background: var(--section-tinted-hover);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.08);
}

/* Subtle left accent bar for visual rhythm */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  background: linear-gradient(
    180deg,
    rgba(29, 78, 216, 0.15) 0%,
    rgba(29, 78, 216, 0.4) 50%,
    rgba(29, 78, 216, 0.15) 100%
  );
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transform: scaleY(0.8);
  transition: opacity 250ms ease, transform 250ms ease;
}

/* ==========================================================================
   Flourish Dividers
   ========================================================================== */

.flourish-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  padding: 0 20px;
  pointer-events: none;
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease-out 0.2s;
}

.flourish-divider.is-visible {
  opacity: 1;
}

.flourish-divider::before,
.flourish-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  max-width: 200px;
}

.flourish-divider::before {
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(29, 78, 216, 0.15) 60%,
    rgba(29, 78, 216, 0.3) 100%
  );
}

.flourish-divider::after {
  background: linear-gradient(
    to left,
    transparent 0%,
    rgba(29, 78, 216, 0.15) 60%,
    rgba(29, 78, 216, 0.3) 100%
  );
}

.flourish-diamond {
  width: 8px;
  height: 8px;
  background: rgb(115, 143, 220);
  transform: rotate(45deg);
  margin: 0 12px;
  flex-shrink: 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.muted {
  color: var(--muted);
}

.small {
  margin: 0;
  font-size: 0.8rem;
}

.subhead {
  margin: 12px 0;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ==========================================================================
   Unified Info Cards
   ========================================================================== */

.info-card {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(5px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease;
}

.info-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.info-card li {
  margin: 4px 0;
  font-size: 0.95rem;
}

/* ==========================================================================
   Requirements Grid
   ========================================================================== */

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.requirement-header {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--link);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(29, 78, 216, 0.15);
}

.requirement-card ul {
  margin: 0;
  padding-left: 16px;
}

.requirement-card li {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text);
}

@media (max-width: 720px) {
  .requirements-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: center;
}

.about-bio {
  grid-column: 1 / -1;
}

.about-image {
  width: 100%;
  aspect-ratio: auto;
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7eb;
}

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

@media (max-width: 720px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-image {
    aspect-ratio: 16 / 9;
  }
}

/* ==========================================================================
   Unified Action Cards
   ========================================================================== */

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 6px;
}

.action-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--action-border);
  border-left: 3px solid var(--muted);
  border-radius: 14px;
  padding: 14px;
  padding-right: 36px;
  background: var(--action-bg);
  backdrop-filter: blur(5px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 150ms ease, transform 150ms ease,
    border-color 150ms ease, border-left-color 150ms ease, box-shadow 150ms ease;
}

.action-card::after {
  content: "→";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.35;
  font-size: 1.1rem;
  transition: opacity 150ms ease, transform 150ms ease;
}

.action-card:hover::after {
  opacity: 0.6;
  transform: translateY(-50%) translateX(3px);
}

.action-card:hover {
  background: var(--action-bg-hover);
  border-color: var(--action-border-hover);
  border-left-color: var(--link);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.12);
}

.action-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.action-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Patient Section
   ========================================================================== */

.patient-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.hours {
  margin: 12px 0 0;
}

.hours > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.hours > div:last-child {
  border-bottom: 0;
}

.hours dd {
  margin: 0;
  color: var(--text);
}

.location-card {
  grid-column: 1 / -1;
}

.map-wrap {
  margin-top: 10px;
  display: flex;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.location-image {
  flex: 0 0 auto;
  width: 280px;
  min-height: 300px;
}

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

.map-iframe {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  border: 0;
}

@media (max-width: 720px) {
  .patient-layout {
    grid-template-columns: 1fr;
  }

  .location-card {
    grid-column: auto;
  }

  .map-wrap {
    flex-direction: column;
  }

  .location-image {
    width: 100%;
    min-height: 200px;
    max-height: 250px;
  }

  .map-iframe {
    height: 300px;
  }
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-grid {
  display: grid;
  margin-top: 8px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-card {
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(5px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease;
}

.contact-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.footer-content {
  color: var(--text);
  text-align: center;
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero h1,
  .hero p,
  .hero-cta,
  .scroll-indicator {
    opacity: 1;
    transform: none;
  }

  .card {
    opacity: 1;
    transform: none;
  }

  .flourish-divider {
    opacity: 1;
  }
}
