/* ============================================
   Personal Website - Global Stylesheet
   ============================================ */

/* -------------------- CSS Custom Properties -------------------- */
:root {
  /* Colors */
  --color-hero-blue: #507AB1;
  --color-off-white: #FAFAF5;
  --color-text-dark: #1a1a1a;
  --color-text-mid: #4a4a4a;
  --color-border-subtle: #e0e0e0;
  
  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Tekniq', var(--font-system);
  --font-accent: 'Univers LT', var(--font-system);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Layout */
  --max-width-content: 65ch;
  --max-width-wide: 1200px;
  
  /* Transitions */
  --transition-normal: 200ms ease-in-out;
}

/* -------------------- Font Loading -------------------- */
@font-face {
  font-family: 'Tekniq';
  src: url('../fonts/tekniq.woff2') format('woff2'),
       url('../fonts/tekniq.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Univers LT';
  src: url('../fonts/UniversLT.woff2') format('woff2'),
       url('../fonts/UniversLT.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  font-size: 1rem;
  line-height: 1.6;
  color: #554615;
  background-color: #FAFAF5;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

/* -------------------- Typography -------------------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--spacing-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-hero-blue);
  text-decoration: none;
  transition: opacity var(--transition-normal);
}

a:hover {
  opacity: 0.7;
}

a:focus-visible {
  outline: 2px solid rgba(180, 220, 255, .95);
  outline-offset: 3px;
}

button:focus-visible {
  outline: 2px solid rgba(180, 220, 255, .95);
  outline-offset: 3px;
}

/* -------------------- Selection & Focus Styling -------------------- */
::selection {
  background: rgba(120, 180, 255, .45);
}

/* -------------------- Accessibility -------------------- */
.skip-to-content {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-hero-blue);
  color: white;
  text-decoration: none;
}

.skip-to-content:focus {
  left: 50%;
  top: var(--spacing-sm);
  transform: translateX(-50%);
}

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

/* -------------------- Hero Section (Home Page) -------------------- */
.hero {
  background-color: var(--color-hero-blue);
  color: white;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--spacing-lg);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg,
    rgba(255,255,255,.18),
    rgba(255,255,255,0) 45%);
  transform: rotate(-8deg);
  pointer-events: none;
}

.hero-container {
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm); /* Reduced spacing between logo, nav, and bio */
}

.hero-logo {
  max-width: 280px;
  margin-bottom: 0; /* Removed - using flex gap for uniform spacing */
}

.hero-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem; /* Reduced from var(--spacing-sm) */
  margin-bottom: 0; /* Removed - using flex gap for uniform spacing */
}

.hero-nav a {
  color: white;
  font-family: var(--font-display); /* Use Tekniq font */
  font-size: 1.5rem; /* Increased for readability */
  font-weight: normal;
  transition: transform var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem; /* Reduced gap between arrow and text */
}

.hero-nav a::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url('../images/arrow.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 10px; /* Push arrow down to align with text baseline */
  flex-shrink: 0;
}

.hero-nav a:hover {
  transform: translateX(4px);
  opacity: 1;
}

.hero-nav a:focus {
  outline-color: white;
}

.hero-bio {
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 50ch;
  margin-top: var(--spacing-md); /* Extra space above bio paragraph */
}

.hero-bio a {
  color: white;
  text-decoration: none;
}

.hero-bio a:hover {
  text-decoration: underline;
}

.hero-bio a:focus {
  outline-color: white;
}

.hero-social {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-md); /* Extra space above social links */
}

.hero-social a {
  color: white;
  font-size: 0.9375rem;
}

.hero-image-container {
  display: none; /* Hidden on mobile */
}

.hero-image-full {
  width: 100%;
  height: auto;
}

.hero-headshot {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
}

/* Desktop hero layout */
@media (min-width: 768px) {
  .hero {
    min-height: 0; /* Remove min-height constraint */
    padding: 0 0 0 var(--spacing-lg); /* Remove top/bottom/right padding */
  }
  
  .hero-container {
    max-width: none; /* Remove max-width constraint */
    width: 100%;
  }
  
  .hero-content {
    flex-direction: row;
    align-items: stretch; /* Changed from center to stretch */
    gap: var(--spacing-2xl);
  }
  
  .hero-left {
    flex: 0 0 auto;
    max-width: 600px;
    padding: var(--spacing-xl) 0; /* Add vertical padding to left content only */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .hero-image-container {
    display: flex;
    flex: 1;
    align-items: stretch; /* Changed from center to stretch */
    justify-content: flex-end;
  }
  
  .hero-image-full {
    display: block;
    height: 100%; /* Fill container height */
    width: auto;
    max-width: 100%;
    max-height: 87vh; /* Limit height to 87% of viewport */
    object-fit: contain;
    object-position: right bottom; /* Align to right and bottom */
  }
  
  .hero-headshot {
    display: none; /* Hide headshot on desktop */
  }
  
  .hero-logo {
    max-width: 280px; /* Larger on desktop */
  }
  
  .hero-nav a {
    font-size: 1.75rem; /* Larger on desktop for better readability */
  }
}

/* -------------------- Main Content Sections -------------------- */
main {
  padding: var(--spacing-xl) var(--spacing-lg);
}

.content-section {
  max-width: var(--max-width-content);
  margin: 0 auto var(--spacing-2xl);
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-section h2 {
  margin-bottom: var(--spacing-md);
}

.content-section ul {
  list-style: disc;
  padding-left: 2rem;
  margin-bottom: var(--spacing-sm);
}

.content-section li {
  margin-bottom: 0.25rem; /* Minimal spacing for single-spaced appearance */
}

/* -------------------- Newsletter Section -------------------- */
.newsletter-section {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  padding: var(--spacing-xl);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.2);
  box-shadow:
    0 2px 0 rgba(255,255,255,.7) inset,
    0 -2px 0 rgba(0,0,0,.1) inset,
    0 4px 12px rgba(0,0,0,.08);
  max-width: var(--max-width-content);
  margin: var(--spacing-2xl) auto;
}

.newsletter-section h2 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.newsletter-section iframe {
  display: block;
  margin: 0 auto; /* Center the iframe */
}

/* -------------------- Static Page Header -------------------- */
.site-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-subtle);
  background: linear-gradient(to bottom, rgba(80, 122, 177, 0.03), transparent);
}

.site-header-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.site-header-logo {
  max-width: 140px;
  height: auto;
}

.site-header a {
  font-weight: 500;
  color: var(--color-hero-blue);
  transition: opacity var(--transition-normal);
}

.site-header a:hover {
  opacity: 0.7;
}

/* Static page main content */
.static-page-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

.static-page-content h1 {
  margin-bottom: var(--spacing-lg);
  color: var(--color-hero-blue);
  border-bottom: 3px solid var(--color-hero-blue);
  padding-bottom: var(--spacing-sm);
  display: inline-block;
}

.static-page-content h2 {
  color: var(--color-hero-blue);
  margin-top: var(--spacing-xl);
}

.static-page-content ul {
  list-style: disc;
  padding-left: 2rem;
  margin-bottom: var(--spacing-sm);
}

.static-page-content li {
  margin-bottom: 0.25rem;
}

.static-page-content ul ul {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  padding-left: 2rem; /* Additional indent for nested lists */
}

.static-page-content ul ul li {
  list-style: circle; /* Different bullet style for nested items */
}

.page-updated {
  color: var(--color-text-mid);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-lg);
}

/* -------------------- Footer -------------------- */
.site-footer {
  padding: var(--spacing-xl) var(--spacing-lg);
  border-top: 1px solid var(--color-border-subtle);
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.footer-copy {
  color: var(--color-text-mid);
  font-size: 0.875rem;
}

/* -------------------- Y2K Touches (Subtle) -------------------- */
/* Custom scrollbar (webkit browsers) */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-off-white);
}

::-webkit-scrollbar-thumb {
  background: #d0d0c8;
  border-radius: 6px;
  border: 2px solid var(--color-off-white);
}

::-webkit-scrollbar-thumb:hover {
  background: #b0b0a8;
}

/* Subtle inset borders on certain elements */
.inset-border {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* -------------------- Utility Classes -------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center {
  text-align: center;
}

/* -------------------- Desktop Typography Enhancements -------------------- */
@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 1.875rem;
  }
  
  .hero-bio {
    font-size: 1.25rem;
  }
  
  main {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }
}

