/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* Color Palette - Minimalist Premium Gallery Vibe */
  --bg-main: #000000;
  --bg-card: #0a0a0a;
  --bg-header: rgba(10, 10, 10, 0.75);
  --bg-footer: #050505;
  --bg-hero-start: #111111;
  --bg-hero-end: #000000;

  --text-main: #ffffff;
  --text-muted: #8e8e93;
  --text-dim: #48484a;

  /* Accent Branding System */
  --accent: #00ff85;         /* Neon Growth Green */
  --accent-hover: #00cc6a;
  --accent-gallery: #00bcd4; /* Structural Technical Cyan */
  --accent-glow: rgba(0, 188, 212, 0.15);

  /* Typography */
  --font-main: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --fs-xl: 2.25rem;
  --fs-lg: 1.25rem;
  --fs-base: 1rem;
  --fs-nav: 0.9rem;
  --fs-sm: 0.85rem;

  /* Layout, Spacing & Animation tokens */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;

  --max-width: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;

  --border-clean: 1px solid #1c1c1e;
  --transition-smooth: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   BASE & STRUCTURE SETUP
   ========================================================================== */
html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/*TRANSITION BETWEEN PAGES*/
@view-transition {
    navigation: auto;
}
::view-transition-group(page-content) {
animation-duration: 1s;
animation-timing-function: ease;
}
::view-transition-old(page-content) {
    animation-name: slide-out;
}
::view-transition-new(page-content) {
    animation-name: slide-in;
}
main {
    view-transition-name: page-content;
}

@keyframes slide-out {
    to{
        opacity: 0;
    }
}
@keyframes slide-in {
    from{
        translate: 100vw;
        opacity: 1;
    }
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  margin: 0 auto;
  padding: 0 var(--space-sm);
  max-width: var(--max-width);
  width: 100%;
}

section {
  display: flex;
  flex-direction: column;
  min-height: 80dvh;
  width: 100%;
  margin-top: var(--space-lg);
  opacity: 0;
  transform: translateY(15px);
  animation: viewReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   NAVIGATION HEADER ARCHITECTURE
   ========================================================================== */
header {
  position: sticky;
  top: 12px;
  z-index: 100;
  max-width: var(--max-width);
  height: 56px;
  margin: 12px auto;
  padding: 0 var(--space-md);
  
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--border-clean);
  border-radius: var(--radius-md);
}

header h1 {
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
  color: #fff;
}

nav a {
  font-size: var(--fs-nav);
  font-weight: 500;
  margin-left: 24px;
  color: var(--text-muted);
  transition: color var(--transition-smooth);
  position: relative;
  padding: 4px 0;
}

nav a:hover {
  color: #fff;
}

nav a.active {
  color: var(--accent) !important;
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* ==========================================================================
   HERO / DISPLAY AREA
   ========================================================================== */
#hero {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: var(--space-lg) var(--space-sm);
  background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  border: var(--border-clean);
  border-radius: var(--radius-md);
}

#hero h2 {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  margin: 0;
}

#hero p {
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin: 0 0 var(--space-sm) 0;
}

#hero p a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#hero h2 span::after {
  content: "";
  animation: tickerSwitch 12s infinite;
}

@keyframes tickerSwitch {
  0%, 25% { content: "space"; color: var(--accent-gallery); }
  26%, 50% { content: "labs"; color: var(--accent); }
  51%, 75% { content: "foundry"; color: #ff3b30; }
  76%, 100% { content: "universe"; color: #af52de; }
}

/* ==========================================================================
   GENERIC CARD CONTAINER SHELL
   ========================================================================== */
.cards {
  background: var(--bg-card);
  border: var(--border-clean);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  margin-top: 0;
  margin-bottom: var(--space-md);
}

/* About Section Typographic Spacing */
#about p {
  color: var(--text-muted);
  font-size: calc(var(--fs-base) * 1.05);
  max-width: 720px;
  margin: 0 auto var(--space-sm) auto;
  text-align: left;
}

/* ==========================================================================
   SKILLS MATRIX ENHANCEMENTS (Eliminating Dead Space)
   ========================================================================== */
#skills {
  max-width: 760px; /* Restricts layout expansion on desktop */
  margin: var(--space-lg) auto;
  padding: var(--space-lg);
}

#skills h2 {
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
  align-self: center;
}

#skills h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-gallery);
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  text-align: left; /* Swapped to left-align to anchor content structurally */
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  border-bottom: 1px solid #1c1c1e;
  padding-bottom: 4px;
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Creates a tight responsive grid */
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--space-md) auto;
}

.skills-list div {
  background: #050505;
  color: var(--text-muted);
  border: var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 12px var(--space-sm); /* Increased padding to give blocks physical weight */
  font-size: var(--fs-nav);
  font-weight: 500;
  text-align: center;
  transition: all var(--transition-smooth);
}

.skills-list div:hover {
  color: #fff;
  border-color: var(--accent);
  background: #0a0a0a;
  transform: translateY(-2px);
}

/* ==========================================================================
   THE SCYBUD GALLERY (MUSEUM WINGS)
   ========================================================================== */
.museum-header {
  text-align: center;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid #1c1c1e;
  padding-bottom: var(--space-sm);
}

.museum-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin: 4px 0 0 0;
}

.museum-wing {
  margin-bottom: var(--space-lg);
}

.wing-banner {
  border-left: 2px solid var(--accent-gallery);
  padding-left: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.wing-banner h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.wing-banner p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.project-artifact {
  background: #050505;
  border: var(--border-clean);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.project-artifact:hover {
  border-color: #3a3a3c;
  box-shadow: var(--shadow-hover);
}

/* Showcase pedestal optimization for TryTasty */
.project-artifact.commercial {
  border: 1px dashed var(--accent);
  background: linear-gradient(180deg, #050505 0%, #030d08 100%);
}

.project-artifact.commercial:hover {
  border-color: var(--accent);
}

.artifact-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-xs);
}

.project-artifact h4 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: #fff;
  margin: 0 0 var(--space-xs) 0;
}

.artifact-spec {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  background: #0c0c0e;
  border: 1px solid #151517;
  padding: 6px var(--space-xs);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.artifact-spec span {
  color: var(--accent-gallery);
}

.project-artifact p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-md) 0;
}

/* ==========================================================================
   BUTTONS AND INTERACTIVE PLACARDS
   ========================================================================== */
.btn, .btn-placard {
  display: inline-block;
  text-align: center;
  font-size: var(--fs-nav);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-smooth);
  text-decoration: none !important;
}

.btn {
  padding: 10px 20px;
  background: #ffffff;
  color: #000000;
}

.btn:hover {
  background: #e5e5ea;
}

.btn-placard {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 1px solid #2c2c2e;
  color: #fff;
}

.btn-placard:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* ==========================================================================
   CONTACT PORTAL ENHANCEMENTS (Compact Terminal Layout)
   ========================================================================== */
#contact {
  max-width: 500px; /* Pinpoints the form width to stop horizontal bleeding */
  margin: var(--space-lg) auto;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contact h2 {
  margin-bottom: var(--space-sm);
}

#contact > p:first-of-type {
  color: var(--text-muted);
  font-size: var(--fs-base);
  margin-bottom: var(--space-lg);
}

/* Metadata Panel Link Card */
.contact-card {
  width: 100%;
  background: #050505;
  border: var(--border-clean);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #111112;
}

.contact-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-value a {
  color: #fff;
  font-size: var(--fs-nav);
  font-weight: 500;
  transition: color var(--transition-smooth);
}

.contact-value a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Network Links Layout Footer Block */
.contactLinks {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  margin-top: var(--space-sm) !important;
}

.contactLinks a, .emailContact {
  margin: 0;
  padding: 8px 16px;
  background: #0a0a0a;
  border: var(--border-clean);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-muted) !important;
  transition: all var(--transition-smooth);
}

.contactLinks a:hover {
  color: #fff !important;
  border-color: #333333;
  background: #111111;
  text-decoration: none !important;
  transform: translateY(-1px);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .skills-list {
    grid-template-columns: 1fr 1fr; /* Retains clean 2-column distribution on small devices */
  }
  
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .contactLinks {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .contactLinks a {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   FOOTER ARCHITECTURE
   ========================================================================== */
footer {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  font-size: var(--fs-sm);
  background: var(--bg-footer);
  color: var(--text-dim);
  border-top: var(--border-clean);
  margin-top: var(--space-lg);
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTATIONS (MOBILE)
   ========================================================================== */
#menuicon {
  display: none;
}

@media (max-width: 800px) {
  header {
    justify-content: space-between;
    width: calc(100% - 24px);
    margin: 12px 12px;
  }

  #nav-links {
    display: none;
  }

  #menuicon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    cursor: pointer;
  }

  #menuicon span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform var(--transition-smooth);
  }

  /* Structural slideout layout overlay navigation drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100dvh;
    background: #050505;
    border-right: var(--border-clean);
    z-index: 1000;
    padding: var(--space-md);
    opacity: 0;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s linear;
  }

  .sidebar.show {
    left: 0;
    opacity: 1;
  }

  #cancelIcon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  #cancelIcon span {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #fff;
    top: 9px;
  }

  #top-bar { transform: rotate(45deg); }
  #bottom-bar { transform: rotate(-45deg); }
  #middle-bar { display: none; }

  .sidebar nav {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-lg);
    gap: 20px;
  }

  .sidebar nav a {
    margin-left: 0;
    font-size: var(--fs-lg);
  }
  
  .sidebar nav a.active::after {
    bottom: -4px;
  }
}

@media (max-width: 600px) {
  #hero h2 {
    font-size: var(--fs-lg);
  }
  
  .exhibit-grid {
    grid-template-columns: 1fr;
  }
}