/* ==========================================================================
   Design System & Tokens - Alphi Gabriel Portfolio
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-primary: #fcfaf6;
  --bg-secondary: #e9e8e4;
  --bg-card: #ffffff;
  --bg-dark: #181c20;
  --bg-navy: #003a6c;
  --bg-navy-dark: #002647;
  --bg-navy-light: #00559e;
  
  --text-main: #181c20;
  --text-muted: #59616a;
  --text-light: #fcfaf6;
  --text-light-muted: #d0d7de;
  
  --accent-teal: #0d9488;
  --accent-teal-hover: #0f766e;
  --accent-teal-light: #14b8a6;
  --accent-blue: #0284c7;
  --accent-green: #059669;
  --accent-amber: #d97706;
  --accent-purple: #7c3aed;
  
  --border-light: rgba(24, 28, 32, 0.12);
  --border-dark: rgba(255, 255, 255, 0.15);
  
  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Josefin Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  
  /* Layout & Spacing */
  --container-max-width: 1200px;
  --header-height: 80px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px rgba(13, 148, 136, 0.3);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-navy);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-normal), padding var(--transition-fast);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Dropdown Menu */
.nav-item-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.nav-item-dropdown:hover .dropdown-icon,
.nav-item-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  color: var(--text-main);
  min-width: 260px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  border: 1px solid var(--border-light);
  z-index: 110;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu,
.nav-item-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.dropdown-link:hover,
.dropdown-link.active {
  background-color: var(--bg-secondary);
  color: var(--bg-navy);
  transform: translateX(4px);
}

.dropdown-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-secondary);
  font-size: 1rem;
}

.header-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: all var(--transition-fast);
}

.nav-social-link:hover {
  background: var(--accent-teal);
  transform: translateY(-2px);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 26px;
  padding: 0;
  z-index: 120;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2.5px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ==========================================================================
   Hero & Headers for Subpages
   ========================================================================== */
.page-hero {
  padding: 4.5rem 0 3rem;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.page-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 720px;
}

/* ==========================================================================
   Witty Under Construction Blocks
   ========================================================================== */
.witty-construction-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.witty-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.status-indicator.building {
  background-color: #fef3c7;
  color: #92400e;
}

.status-indicator.simmering {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-indicator.untapped {
  background-color: #e0f2fe;
  color: #075985;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulseAnimation 1.5s infinite;
}

/* Terminal Component (Programming Projects) */
.terminal-window {
  background-color: #0f1419;
  border-radius: var(--radius-md);
  color: #e6edf3;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.terminal-topbar {
  background-color: #1e252d;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.terminal-dot.red { background-color: #ff5f56; }
.terminal-dot.yellow { background-color: #ffbd2e; }
.terminal-dot.green { background-color: #27c93f; }

.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #8b949e;
}

.terminal-body {
  padding: 1.5rem;
  line-height: 1.8;
}

.terminal-line {
  margin-bottom: 0.4rem;
}

.terminal-prompt {
  color: #58a6ff;
}

.terminal-success {
  color: #3fb950;
}

.terminal-warn {
  color: #d29922;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #58a6ff;
  animation: cursorBlink 1s infinite;
  vertical-align: middle;
}

/* Culinary Kitchen Widget (Epicurean Explorations) */
.culinary-stage {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  align-items: center;
  background: #fffbf7;
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px dashed #d97706;
}

.pot-animation-box {
  width: 120px;
  height: 120px;
  background: #faebe0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
}

.kitchen-log {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fde68a;
  color: #78350f;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

/* MTG Card Tilt Widget (Cardboard Curiosities) */
.mtg-stage {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  padding: 1.5rem 0;
}

.mtg-card-mockup {
  width: 290px;
  height: 410px;
  background: linear-gradient(135deg, #1c1c24 0%, #2b2b36 100%);
  border: 7px solid #111115;
  border-radius: 14px;
  color: #f1f1f1;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform-style: preserve-3d;
  cursor: pointer;
}

.mtg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #393e46;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

.mtg-mana {
  display: flex;
  gap: 3px;
}

.mana-symbol {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.mana-u { background: #0ea5e9; color: #fff; }
.mana-r { background: #ef4444; color: #fff; }
.mana-g { background: #22c55e; color: #fff; }
.mana-colorless { background: #94a3b8; color: #000; }

.mtg-card-art {
  height: 140px;
  background: #1e293b;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  border: 1px solid #475569;
  text-align: center;
  padding: 0.5rem;
}

.mtg-card-type {
  background: #393e46;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.mtg-card-textbox {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  font-family: serif;
}

.mtg-card-flavor {
  font-style: italic;
  margin-top: 0.35rem;
  border-top: 1px solid #ccc;
  padding-top: 0.35rem;
  color: #555;
}

.mtg-card-footer {
  display: flex;
  justify-content: flex-end;
}

.mtg-pt {
  background: #393e46;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.85rem;
}

/* ==========================================================================
   Template Sections & Modular Showcase
   ========================================================================== */
.template-section {
  padding: 4rem 0;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.section-title-group h2 {
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.filter-btn:hover {
  background: #dad8d2;
}

.filter-btn.active {
  background: var(--bg-navy);
  color: #ffffff;
}

/* Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  position: relative;
}

.content-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-media {
  height: 200px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.content-card:hover .card-media img {
  transform: scale(1.05);
}

.media-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(24, 28, 32, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
}

.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer-action {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Template Blueprint Banner */
.blueprint-guide {
  background: #f0f7ff;
  border: 1px solid #b9dcff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.blueprint-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.blueprint-text h4 {
  color: #03457d;
  margin-bottom: 0.35rem;
}

.blueprint-text p {
  color: #2b5579;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.code-snippet {
  background: #0f1419;
  color: #e6edf3;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--accent-teal);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
}

.btn-primary:hover {
  background-color: var(--accent-teal-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.38);
  color: #fff;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-main);
}

.btn-navy {
  background-color: var(--bg-navy);
  color: #ffffff;
}

.btn-navy:hover {
  background-color: var(--bg-navy-light);
  color: #fff;
}

/* ==========================================================================
   Global Footer
   ========================================================================== */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 4.5rem 0 2.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand h3 {
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.footer-brand p {
  color: var(--text-light-muted);
  max-width: 360px;
  font-size: 0.95rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-light-muted);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-contact-item {
  color: var(--text-light-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-navy-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .main-nav.active {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    margin-top: 0.5rem;
    display: none;
  }

  .nav-item-dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-link {
    color: rgba(255, 255, 255, 0.85);
  }

  .dropdown-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }

  .culinary-stage {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pot-animation-box {
    margin: 0 auto;
  }

  .kitchen-log {
    align-items: center;
  }

  .mtg-stage {
    flex-direction: column;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }
}