/* **************************************
   PORTFOLIO WEBSITE STYLESHEET
   **************************************
   Project: Home page and contact page
   Author: Naïka C. Estriplet
   Stack: Vanilla HTML, CSS, JavaScript
   
   DESIGN SYSTEM
   **************************************
   Color Palette:
   - Background: Dark with gradient overlay (creates depth and readability)
   - Text: Muted tan rgba(189, 187, 165) - warm but not harsh on eyes
   - Accent: White - provides contrast for navigation and borders
   
   Typography:
   - Display fonts: Dorsa (geometric, modern, clean) - used for headings
   - Body fonts: Martel Sans (readable, professional) - used for body text
   - Hero number: 17rem on desktop, scales down responsively
   
   Spacing System:
   - --spacing-xs: 0.5rem - small gaps between elements
   - --spacing-sm: 1rem - standard small spacing
   - --spacing-md: 2rem - medium spacing between sections
   - --spacing-lg: 3rem - large spacing, used for top offsets
   - --spacing-xl: 4rem - extra large spacing
   
   Animation System:
   - Page transitions: 600ms (slideUp/slideOut)
   - Subtle effects: 6s (pulse animation)
   - Must match JavaScript timeout values
   ***************************************/

/* **************************************
   CSS VARIABLES - Design System & Configuration
   ***************************************/
:root {
  /* Spacing scale - all layout spacing derives from these values */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Layout positioning - desktop defaults */
  --layout-side-padding: 4rem;
  --layout-offset-top: 8rem;
  --layout-availability-left: 71rem;
  --layout-bio-top: 4rem;
  --layout-contact-top: 18rem;

  /* Animation durations - must match JavaScript timeouts */
  --animation-page-transition: 600ms;
  --animation-pulse-duration: 6s;

  /* Colors */
  --color-text: rgba(189, 187, 165, 1);
  --color-text-light: rgba(189, 187, 165, 0.75);
  --color-border: rgba(189, 187, 165, 1);
  --color-bg-overlay: rgba(0, 0, 0, 0.6);

  /* Fonts */
  --font-display: "Dorsa", sans-serif;
  --font-body: "Martel Sans", sans-serif;

  /* Font sizes - desktop defaults */
  --font-size-hero: 17rem;
  --font-size-month: 6rem;
  --font-size-status: 1.5rem;
  --font-size-button: 2rem;
}

/* **************************************
   GLOBAL STYLES
   ***************************************/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  color: var(--color-text);
  font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
}

/* Background image with gradient overlay for better text readability */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.25)),
    url(https://n4ika.github.io/my-portfolio/images/nc_portfolio-bg.jpg);
  background-size: cover;
  background-attachment: fixed;
  z-index: -1;
}

/* **************************************
   LAYOUT (Grid, Flex, Positioning)
   ***************************************/

/* Fixed header stays at top of viewport during scroll */
header {
  position: fixed;
  width: 100%;
  padding: var(--spacing-md);
  top: 0;
  z-index: 10;
}

/* Flex layout for title alignment (name and role) */
.title {
  display: flex;
  align-items: flex-end;
}

/* Account for fixed header height */
main {
  padding-top: 5rem;
}

/* Navigation list layout */
nav ul {
  display: flex;
  list-style: none;
}

/* Availability widget - displays current status and date
   Fixed positioning on right side of desktop layout */
#availability {
  display: flex;
  gap: var(--spacing-xs);
  height: 20rem;
  width: 15rem;
  position: relative;
  top: var(--layout-offset-top);
  left: var(--layout-availability-left);
}

/* Bio section - introduction text and content */
#bio {
  position: relative;
  top: var(--layout-bio-top);
  left: var(--layout-side-padding);
  height: 6rem;
  width: 40rem;
}

/* Home page container - takes up full viewport */
#home {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100vh;
  z-index: 10;
}

/* Contact page container - positioned below viewport initially */
#contact-page {
  position: relative;
  left: 8rem;
  top: 20rem;
}

/* Email section layout - displays email label and address */
#email {
  display: flex;
  gap: var(--spacing-xs);
  padding-top: 0.75rem;
}

/* ============================================
   COMPONENTS (Nav, Cards, Buttons, etc)
   ============================================ */

/* Hidden utility class for page transitions */
.hidden {
  display: none;
}

/* Navigation bar - horizontal layout with space between items */
nav {
  display: flex;
  justify-content: space-between;
  margin: 0 var(--spacing-md);
  border-bottom: 0.75px solid var(--color-border);
}

/* Navigation title styling - "Software Developer" text */
.title h2 {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-weight: 100;
  font-size: 1rem;
  line-height: 2rem;
  padding-bottom: 0.5rem;
}

/* Navigation list item spacing */
.navigation li {
  padding-left: var(--spacing-xs);
}

/* Navigation link styling - removes underline, adds hover effects */
.navigation a {
  text-decoration: none;
  color: inherit;
  font-weight: 300;
  transition: all 0.5s ease;
}

/* Navigation link hover state - strikethrough with italic */
.navigation a:hover {
  text-decoration: line-through;
  font-style: italic;
  opacity: var(--color-text-light);
}

/* Current day display - large hero number with pulse animation */
#current-day {
  font-family: "Limelight", sans-serif;
  font-size: var(--font-size-hero);
  animation: pulse var(--animation-pulse-duration) ease-in-out infinite;
  line-height: 1; /* Remove extra line-height space */
  margin: 0; /* Ensure no margin */
}

/* Details container - holds month and status information */
#details {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Status text - "available" and "for work" labels */
.status {
  font-family: var(--font-body);
  font-size: var(--font-size-status);
  line-height: 2rem;
}

/* Current month display - large text aligned with day */
#current-month {
  font-size: var(--font-size-month);
  letter-spacing: 0.5rem;
  font-weight: 700;
}

/* Bio section heading - introduces the portfolio content */
#bio h1 {
  font-size: 2rem;
  padding-bottom: 0.25rem;
  letter-spacing: 0.15rem;
}

/* Bio section body text - portfolio description */
#bio p {
  font-size: 1.25rem;
  font-weight: 300;
}

/* Contact CTA button - marquee text animation on hover
   Fixed width container ensures text scrolls properly */
#contact-me {
  position: relative;
  top: var(--layout-contact-top);
  left: var(--layout-side-padding);
  overflow: hidden; /* Clip overflowing marquee text */
  display: flex;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  width: 18rem; /* Fixed width for marquee container */
  height: 4rem; /* Accommodates 2rem font with padding */
  border-radius: 35px; /* Pill shape */
  justify-content: center;
  align-items: center;
  background-color: var(--color-bg-overlay);
}

/* Contact button text paragraphs - individual items in marquee */
#contact-me p {
  display: inline-block;
  position: relative;
  white-space: nowrap; /* Prevent text wrapping */
  margin: 0 var(--spacing-md);
}

/* Marquee animation - triggers on parent hover */
#contact-me:hover p {
  animation: marquee 5s linear infinite;
}

/* Contact button link styling */
#contact-me a {
  text-decoration: none;
  color: inherit;
  font-size: var(--font-size-button);
  font-weight: 700;
}

/* Return home link - contact page back button
   Positioned absolutely in top right corner of viewport */
#return-home {
  position: absolute;
  bottom: 35rem;
  left: 80rem;
  color: inherit;
  text-decoration: none;
  font-size: 1.5rem;
}

/* Return home hover state - adds italic style */
#return-home:hover {
  font-style: italic;
}

/* Email description text - explains contact purpose */
#email-description {
  width: 23rem;
}

/* Contact page main heading */
#contact-page h1 {
  font-size: 15rem;
}

/* Contact page section heading */
#contact-page h2 {
  font-size: 7rem;
  padding-bottom: var(--spacing-md);
}

/* Contact email link styling */
#email a {
  color: inherit;
}

/* Social media links - icon size and spacing */
#socials a {
  padding: 0 var(--spacing-xs);
  color: inherit;
  font-size: 1.5rem;
}

/* **************************************
   UTILITIES (Animations, Accessibility)
   ***************************************/

/* Subtle opacity pulse animation for availability widget
   Creates visual interest without being distracting */
@keyframes pulse {
  0%,
  100% {
    opacity: 0.7; /* Dimmed baseline state */
  }
  50% {
    opacity: 0.85; /* Slightly more visible at peak */
  }
}

/* Marquee scroll animation for contact button text
   Text scrolls from centered position off-screen to the left
   Duration: 5s (allows time for marquee effect to be noticed) */
@keyframes marquee {
  0% {
    right: calc(50% - 2rem); /* Start centered in container */
  }
  100% {
    right: -100%; /* Scroll off-screen to the left */
  }
}

/* Page transition animations - defined globally for all sections */

/* All sections inherit slideUp animation on initial load */
section {
  animation: slideUp var(--animation-page-transition) ease-in-out forwards;
}

/* Applied when section is leaving the viewport */
section.slide-out {
  animation: slideOut var(--animation-page-transition) ease-in-out forwards;
}

/* Slide out animation - moves section up and fades out */
@keyframes slideOut {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh); /* Move up by one viewport height */
    opacity: 0; /* Fade out during transition */
  }
}

/* Slide up animation - moves section in from below and fades in */
@keyframes slideUp {
  0% {
    transform: translateY(100vh); /* Start below viewport */
    opacity: 0; /* Start invisible */
  }
  100% {
    transform: translateY(0);
    opacity: 1; /* Fade in to full opacity */
  }
}

/* **************************************
   TABLET (768px - 1024px)
   ***************************************/
@media (max-width: 1024px) {
  #availability {
    left: 19rem;
  }

  #contact-me {
    left: 1rem;
  }

  #contact-page {
    left: 2rem;
  }

  #return-home {
    left: 2rem;
    position: relative;
    bottom: auto;
  }
}

/* **************************************
   MOBILE (under 768px)
   ***************************************/
@media (max-width: 768px) {
  main {
    padding-top: 5rem;
  }

  #availability {
    position: static;
    width: 100%;
    gap: 1rem;
    height: auto;
    justify-content: center;
    align-items: center;
    display: flex;
    margin-top: 8rem;
  }

  #current-day {
    font-size: 6rem;
  }

  #details {
    height: auto;
  }

  #current-month {
    font-size: 3rem;
    letter-spacing: 0.25rem;
  }

  .status {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  #bio {
    position: static;
    width: 100%;
    height: auto;
    padding: 0 1rem;
    margin-top: 3rem;
    text-align: center;
  }

  #bio h1 {
    font-size: 1.5rem;
  }

  #bio p {
    font-size: 1rem;
  }

  #contact-me {
    position: static;
    margin: 2rem auto;
    padding: 1rem;
    border-radius: 15px;
    flex-direction: column;
    gap: 1rem;
  }

  #contact-me p {
    margin: 0;
  }

  #contact-me a {
    font-size: 1.5rem;
  }

  #contact-page {
    position: static;
    width: 100%;
    padding: 1rem;
    top: auto;
    left: auto;
  }

  #return-home {
    position: static;
    bottom: auto;
    left: auto;
    margin-bottom: 2rem;
    font-size: 1rem;
  }

  #contact-page h1 {
    font-size: 3rem;
  }

  #contact-page h2 {
    margin-top: 3rem;
    font-size: 3rem;
    padding-bottom: 0.75rem;
  }

  #email-description {
    width: 100%;
    font-size: 1rem;
  }

  #email {
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
  }

  #socials {
    font-size: 0.9rem;
  }

  #socials a {
    padding: 0 0.25rem;
    font-size: 1.25rem;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    border-bottom: 1px solid;
  }

  .navigation {
    gap: 0.25rem;
  }

  .navigation li {
    padding-left: 0;
  }

  .title h2 {
    font-size: 0.75rem;
  }
}