:root {
  --clr-background: #0d0d0d;
  --clr-text: #ffffff;
  --clr-link: #a61508;
  --clr-hover-link: #f2f2f2;
  --fs-h1: 2.986rem;
  --fs-h2: 2.488rem;
  --fs-h3: 2.074rem;
  --fs-h4: 1.728rem;
  --fs-h5: 1.44rem;
  --fs-h6: 1.2rem;
  --fs-p: 1rem;
  --fs-small: 0.833rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Fira Sans Condensed", "Racing Sans One", sans-serif;
  background-color: var(--clr-background);
  color: var(--clr-text);
  font-size: var(--fs-h6);
  line-height: 1.5;
  /* Sticky footer layout-flex container with column direction */
  display: flex;
  flex-direction: column;
  /* Ensures the body takes at least 100% viewport height */
  min-height: 100vh;
  /* Ensures full viewport width coverage */
  width: 100%;
}

/* Header section */

/* link styling */
a {
  color: var(--clr-link);
  text-decoration: none;
  /* Creates a smooth transition for all property changes */
  transition: all 0.3s ease;
}

/* Change color and add underline when hovered*/
a:hover {
  color: var(--clr-hover-link);
  border-bottom: 2px solid var(--clr-hover-link);
}

/* Emphasize click when active*/
a:active {
  color: var(--clr-link);
  border-bottom: 3px solid var(--clr-link);
  opacity: 0.8;
}

/* Accessibility outline for keyboard navigation */
a:focus {
  outline: 2px solid var(--clr-link);
  outline-offset: 2px;
}

/* Nav styling with flex layout */
nav ul {
  display: flex;
  gap: 1rem;
  list-style-type: none;
  justify-content: end;
}

/* Active navigation link styling */
nav a.active {
  color: var(--clr-hover-link);
  border-bottom: 3px solid var(--clr-link);
  font-weight: 600;
}

/* full width layout with flex properties */
header {
  /* Padding for responsive spacing */
  padding: 1.5rem 2rem;
  /* Auto height for content */
  height: auto;
  min-height: 150px;
  /* Full viewport width */
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Prevents the header from shrinking in flex layout */
  flex-shrink: 0;
}

/* Headings with improved whitespace */
h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  /* Creates room below heading */
  margin-bottom: 1rem;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  /* Create larger margin for secondary headings */
  margin-bottom: 1.5rem;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
  /* Consistent spacing for h3 headings */
  margin-bottom: 1rem;
}

/* Heading level 4 with standard font weight */
h4 {
  font-size: var(--fs-h4);
  font-weight: 400;
}

/* Paragraph text styling with readability */
p {
  font-size: var(--fs-p);
  line-height: 1.6;
}

/* main content layout with flex growth for sticky footer */
main {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  /* Padding for whitespace */
  padding: 3rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  /* Pushes footer to bottom by expanding main content */
  flex: 1;
}
/* Hero section with whitespace */
.hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero text container with centered layout */
.hero-text {
  text-align: center;
  max-width: 650px;
}

/* Hero heading margins for improved spacing */
.hero-text h1,
.hero-text h2 {
  /* Bottom margin creates proper spacing between headings */
  margin-bottom: 1rem;
}

.hero-text h3 {
  margin-bottom: 1.5rem;
  color: var(--clr-link);
}

/* Call-to-action buttons with whitespace */
.links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* Button styling with interactions */
.links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--clr-link);
  border-radius: 4px;
  transition: all 0.3s ease;
  /* Shows that the element is clickable */
  cursor: pointer;
}

/* Fill with color and add shadow when hovered */
.links a:hover {
  background-color: var(--clr-link);
  color: var(--clr-background);
  box-shadow: 0 4px 12px rgba(166, 21, 8, 0.3);
}

/* Click feedback with animation when active*/
.links a:active {
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Keyboard nav outline */
.links a:focus {
  outline: 2px solid var(--clr-hover-link);
  outline-offset: 2px;
}

/* Profile image container with spacing */
.headshot {
  margin-top: 1.5rem;
}

/* Profile image styling with circular border */
.headshot img {
  max-width: 200px;
  border-radius: 50%;
  border: 3px solid var(--clr-link);
}

/* Content sections with readability */
section {
  grid-column: 1 / -1;
  /* 65 characters per line for optimal reading (40-80 char range) */
  max-width: 65ch;
  /* Margin space for visuals */
  margin: 3rem auto;
  /* Padding for a less daunting appearance */
  padding: 2.5rem;
}

/* Section styling with a border */
#about,
#contact,
#skills,
#databases,
#tools {
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 4px solid var(--clr-link);
}

/* Paragraph spacing within sections */
section p {
  /* Bottom margin between paragraphs */
  margin-bottom: 1.5rem;
}

/* Skill icons grid container for responsive layout */
.skill-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 1.5rem 0;
}

/* Skill item with icon and label */
.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 8px;
  background-color: rgba(166, 21, 8, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

/* Skill items when hovered*/
.skill-item:hover {
  background-color: rgba(166, 21, 8, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(166, 21, 8, 0.2);
}

/* Icon styling within skill items */
.skill-item i {
  font-size: 2.5rem;
  color: var(--clr-link);
  margin-bottom: 0.75rem;
}

/* Label text for skill items */
.skill-item span {
  font-size: 0.9rem;
  color: var(--clr-hover-link);
  font-weight: 500;
}

/* Contact form styling */

/* Contact information container with form layout */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

/* Individual contact method with icon and link */
.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background-color: rgba(166, 21, 8, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Contact method icon styling */
.contact-method i {
  font-size: 1.5rem;
  color: var(--clr-link);
}

/* Contact method link styling */
.contact-method a {
  color: var(--clr-text);
  font-weight: 500;
  transition: all 0.3s ease;
}

/* Contact method link hover state */
.contact-method a:hover {
  color: var(--clr-hover-link);
  border-bottom: 2px solid var(--clr-hover-link);
}

/* Form container with proper spacing */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Individual form field container */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Form labels with consistent styling */
.form-group label {
  font-weight: 600;
  color: var(--clr-text);
  font-size: 0.95rem;
}

/* Input fields with proper styling and focus states */
.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(166, 21, 8, 0.3);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--clr-text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

/* Highlight border when in focus state */
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--clr-link);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(166, 21, 8, 0.15);
}

/* Input placeholder text styling */
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Submit button styling with interactive states */
.submit-btn {
  padding: 0.85rem 2rem;
  border: 2px solid var(--clr-link);
  border-radius: 4px;
  background-color: transparent;
  color: var(--clr-text);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Submit button when hovered */
.submit-btn:hover {
  background-color: var(--clr-link);
  color: var(--clr-background);
  box-shadow: 0 4px 12px rgba(166, 21, 8, 0.3);
}

/* Submit button when active */
.submit-btn:active {
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Submit button when focused */
.submit-btn:focus {
  outline: 2px solid var(--clr-hover-link);
  outline-offset: 2px;
}

/* Project card styling with interactive states */
.card {
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(166, 21, 8, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Shows that the card is interactive */
  cursor: pointer;
}

/* Lift card and enhance shadow when hovered */
.card:hover {
  transform: translateY(-8px);
  border-color: var(--clr-link);
  box-shadow: 0 12px 24px rgba(166, 21, 8, 0.3);
}

/* Button feedback when active */
.card:active {
  transform: translateY(-4px);
}

/* Card image scaling and display */
.card img {
  width: 100%;
  height: 200px;
  /* Specifies how contents should be placed */
  object-fit: cover;
  display: block;
}

/* Card heading with accent color */
.card h4 {
  padding: 1.5rem 1.5rem 0.5rem;
  color: var(--clr-link);
}

/* Card description with improved line spacing */
.card p {
  padding: 0 1.5rem 1.5rem;
  flex-grow: 1;
  color: rgba(255, 255, 255, 0.9);
  /* Better readability for card text */
  line-height: 1.6;
}

/* Footer: always at bottom of viewport */
footer {
  background-color: rgba(0, 0, 0, 0.4);
  border-top: 2px solid rgba(166, 21, 8, 0.3);
  padding: 2rem;
  /* Full viewport width */
  width: 100%;
  /* Pushed to bottom by main flex: 1 */
  margin-top: auto;
  text-align: center;
  /* Prevent footer from shrinking in flex layout */
  flex-shrink: 0;
}

/* Footer content layout */
.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

/* Social media icon container */
.social-icons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Social icon buttons with interactive states */
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(166, 21, 8, 0.2);
  transition: all 0.3s ease;
  /* Shows that the link is clickable */
  cursor: pointer;
}

/* Fill color and scale up when hovered */
.social-icons a:hover {
  background-color: var(--clr-link);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(166, 21, 8, 0.4);
}

/* Press down animation when active */
.social-icons a:active {
  transform: scale(0.95);
}

/* Footer paragraph text with muted color */
footer p {
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.7);
}

.upper-arrow {
  padding: 1em 1.5em;
  background-color: transparent;
  font-weight: 600;
  font-size: var(--fs-h5);
  position: fixed;
  bottom: 0;
  right: 0;
}

/* 
   Responsive design - Media Queries */

/* Mobile device responsiveness: single column layout */
@media (max-width: 600px) {
  /* Hide nav text on mobile, show icons only */
  nav span {
    display: none;
  }

  /* Adjusted header padding for mobile */
  header {
    padding: 1rem;
    min-height: 140px;
  }

  /* Reduce hero padding on small screens */
  .hero {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
  }

  /* Constrain hero text width for mobile */
  .hero-text {
    max-width: 90%;
  }

  /* Scale down headings for mobile readability */
  .hero-text h1 {
    font-size: var(--fs-h3);
  }

  .hero-text h2 {
    font-size: var(--fs-h4);
  }

  /* Stack buttons vertically on mobile */
  .links {
    flex-direction: column;
    gap: 1rem;
  }

  /* Full width buttons on mobile */
  .links a {
    width: 100%;
    justify-content: center;
  }

  /* Adjust section spacing for mobile */
  section {
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 90%;
  }

  /* Single column grid on mobile */
  main {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  /* Responsive form styling for mobile */
  .form-group input,
  .form-group textarea {
    padding: 0.75rem;
    font-size: 1rem;
  }

  /* Full width submit button on mobile */
  .submit-btn {
    width: 100%;
  }
}

/* Tablet device responsiveness: two-column grid layout */
@media (min-width: 601px) and (max-width: 1024px) {
  /* Two column grid for project cards */
  main {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Balanced hero padding for tablet */
  .hero {
    padding: 2rem 1rem;
  }
}

/* Desktop device responsiveness: three-column grid layout with full padding */
@media (min-width: 1025px) {
  /* Three column grid for optimal desktop display */
  main {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Full padding on desktop screens */
  .hero {
    padding: 3rem 2rem;
  }

  /* Enhanced section margins for desktop spacing */
  section {
    margin: 2.5rem auto;
  }
}
