/* ========================================
   shared.css - Global styles for jonathanpufall.com
   ======================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Core surfaces — near-black, minimal */
  --color-bg-primary: #000000;
  --color-bg-secondary: #111111;
  --color-panel: rgba(18, 18, 18, 0.8);
  --color-panel-hover: rgba(28, 28, 28, 0.85);
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-muted: #86868b;
  --color-border: rgba(255, 255, 255, 0.08);

  /* Brand accent (default — overridden per page) */
  --color-accent: #4a6ee0;
  --color-accent-light: #7eaaff;

  /* Page-specific accent */
  --color-page-accent: var(--color-accent);
  --color-page-accent-light: var(--color-accent-light);
  --color-page-bg: #000000;

  /* Neutral surfaces */
  --color-header-bg: rgba(17, 17, 17, 0.92);
  --color-nav-bg: rgba(17, 17, 17, 0.72);
  --color-footer-bg: #0a0a0a;

  /* Elevation — clean, no inset glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Transitions — Apple-style easing */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-normal: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Border radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ---------- Page-Specific Accent Overrides ---------- */
body.page-home {
  --color-page-accent: #e04050;
  --color-page-accent-light: #ff6b7a;
  --color-page-bg: #000000;
}

body.page-about {
  --color-page-accent: #e05a6a;
  --color-page-accent-light: #ff7a8a;
  --color-page-bg: #000000;
}

body.page-business {
  --color-page-accent: #4a6ee0;
  --color-page-accent-light: #7eaaff;
  --color-page-bg: #000000;
}

body.page-artistic {
  --color-page-accent: #9c27b0;
  --color-page-accent-light: #ba68c8;
  --color-page-bg: #000000;
}

body.page-technical {
  --color-page-accent: #2e7d32;
  --color-page-accent-light: #4caf50;
  --color-page-bg: #000000;
}

body.page-contact {
  --color-page-accent: #e05a6a;
  --color-page-accent-light: #ff7a8a;
  --color-page-bg: #000000;
}

/* ---------- Base Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  text-align: center;
  margin: 0;
  padding: 0;
  background: var(--color-page-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Header ---------- */
header {
  background: var(--color-header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--color-text-primary);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

header .logo {
  position: absolute;
  left: 20px;
}

header .logo img {
  width: 52px;
  height: auto;
  transition: opacity var(--transition-normal);
}

header .logo img:hover {
  opacity: 0.7;
}

header div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-grow: 1;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

header p {
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 20px 0;
  }

  header .logo {
    position: relative;
    left: auto;
    margin-bottom: 12px;
  }

  header div {
    width: 100%;
    padding: 0 20px;
  }

  header h1 {
    margin: 8px 0 0;
    font-size: 1.6em;
  }

  header p {
    margin: 4px 0;
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

/* ---------- Navigation — frosted glass ---------- */
nav {
  display: flex;
  justify-content: center;
  background-color: var(--color-nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 14px 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-toggle {
  display: none;
}

.nav-toggle-wrapper {
  display: none;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  margin: 0 2px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 980px;
  transition: color var(--transition-normal), background var(--transition-normal);
  background-color: transparent;
  border: none;
  letter-spacing: -0.01em;
}

.nav-links li a:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links li a.active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.1);
}

@media screen and (max-width: 1100px) {
  nav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    z-index: 100;
  }

  .nav-toggle-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    z-index: 20;
  }

  .menu-label {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 0.95rem;
  }

  .nav-toggle {
    display: inline-block;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
  }

  .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links.show {
    max-height: 500px;
  }

  .nav-links li {
    margin: 4px 0;
  }

  .nav-links li a {
    width: 100%;
    font-size: 1rem;
    padding: 10px 16px;
    text-align: center;
    border-radius: var(--radius-sm);
  }
}

/* ---------- Footer ---------- */
footer {
  background: var(--color-footer-bg);
  color: var(--color-text-muted);
  text-align: center;
  padding: 28px 20px;
  margin-top: 80px;
  border-top: 1px solid var(--color-border);
}

footer p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
}

footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

footer a:hover {
  color: var(--color-text-primary);
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pageReveal {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Scroll Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-reveal="up"]    { transform: translateY(30px); }
[data-reveal="down"]  { transform: translateY(-30px); }
[data-reveal="left"]  { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="fade"]  { transform: none; }

[data-reveal].revealed {
  opacity: 1;
  transform: translate(0, 0);
}

/* Staggered children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-reveal-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0.06s; }
[data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 0.12s; }
[data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 0.18s; }
[data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 0.24s; }
[data-reveal-stagger].revealed > *:nth-child(5) { transition-delay: 0.30s; }
[data-reveal-stagger].revealed > *:nth-child(6) { transition-delay: 0.36s; }

/* ---------- Page Transition Overlay ---------- */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.page-transition-overlay.fade-in {
  opacity: 1;
}

.page-transition-overlay.entering {
  opacity: 1;
  animation: pageReveal 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) 0.05s forwards;
}

/* ---------- Shared Overview Section ---------- */
.overview {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 32px;
  text-align: left;
  color: var(--color-text-primary);
  background: var(--color-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  position: relative;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.overview:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.overview h2 {
  font-size: 2em;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--color-page-accent), var(--color-page-accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInDown 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.overview p {
  font-size: 1.05em;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin: 16px 0;
  animation: fadeInUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) 0.2s forwards;
  opacity: 0;
}

/* ---------- Shared Button Styles ---------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: 980px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-normal), opacity var(--transition-normal);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-page-accent);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  opacity: 0.85;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- Section Heading Utility ---------- */
.section-heading {
  font-size: 2em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--color-page-accent), var(--color-page-accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }

  .page-transition-overlay {
    display: none;
  }
}

/* ---------- Screenreader 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;
}
