/* ── Global Styles ── */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

body {
  font-family: var(--font-sans);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--text-primary);
  background:
    radial-gradient(900px 600px at 15% -10%, var(--surface) 0%, transparent 60%),
    radial-gradient(800px 600px at 80% 10%, var(--surface) 0%, transparent 55%),
    var(--bg-white);
}

/* ── Typography ── */

h1 {
  font-family: var(--font-display);
  font-size: var(--font-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

h2 {
  font-family: var(--font-display);
  font-size: var(--font-h2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h3 {
  font-family: var(--font-sans);
  font-size: var(--font-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--font-h4);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

h5 {
  font-family: var(--font-sans);
  font-size: var(--font-h5);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

h6 {
  font-family: var(--font-sans);
  font-size: var(--font-h6);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-8);
  max-width: 65ch;
}

/* ── Layout Utilities ── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: var(--container-padding);
  width: 100%;
}

.section {
  padding-block: var(--section-padding);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full); /* Unifying to 12px as requested */
  font-size: var(--font-body-sm); /* Unified font size */
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-smooth),
              opacity var(--duration-normal) var(--ease-smooth),
              background-color var(--duration-normal) var(--ease-smooth),
              border-color var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
  border: 1px solid var(--border-default);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-neu-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-neu);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-neu-inset);
}

.btn--primary {
  background: var(--brand-accent);
  color: var(--text-primary);
  border: 1px solid var(--surface-stroke);
}

.btn--primary:hover {
  background: var(--brand-accent-strong);
}

.btn--secondary {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn--secondary:hover {
  background-color: var(--surface);
  /* Optional: change text/border color on hover if desired, 
     but request didn't specify. Keeping it simple. */
}

.btn--white {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn--white:hover {
  background-color: var(--surface);
}

/* ── Focus States ── */

:focus-visible {
  outline: 2px solid var(--brand-accent-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── Utilities ── */

.skip-link {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-white);
  padding: var(--space-4);
  z-index: 1000;
}

.skip-link:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.font-serif {
  font-family: var(--font-display);
}

.italic {
  font-style: italic;
}

.text-center {
  text-align: center;
}

/* ── Page Transitions ── */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--gradient);
  z-index: 999999999;
  pointer-events: none;
  /* Ensure background is stationary */
  transform: none !important;
  /* Initial state: Completely off-screen to the top-left */
  clip-path: polygon(-300% -100%, -100% -300%, 100% -100%, -100% 100%);
  transition: clip-path 0.6s ease-in-out;
  will-change: clip-path;
}

.page-transition-overlay.is-active {
  /* Active state: Covers the entire screen */
  clip-path: polygon(-100% 100%, 100% -100%, 300% 100%, 100% 300%);
}

.page-transition-overlay.is-exiting {
  /* Exit state: Continues off-screen to the bottom-right */
  clip-path: polygon(100% 300%, 300% 100%, 500% 300%, 300% 500%);
}

/* Ensure body doesn't jump during transition if necessary */
body.is-transitioning {
  overflow: hidden;
}

/* ── Unifying Tweaks ── */

/* 1. Glass Effect */
.glass-panel {
  background: var(--surface-glass) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-2xl) !important;
  box-shadow: var(--shadow-neu-sm) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bg-gradient-subtle {
  background: var(--gradient);
}

/* 4. Smooth Scroll Animations */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0, 0, 0.2, 1), transform 600ms cubic-bezier(0, 0, 0.2, 1);
  will-change: opacity, transform;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .btn {
    transition: none !important;
  }
}
