/* ========================================
   BASE STYLES - RESET & GLOBAL
======================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  transition: background-color 0.2s ease;
}

body {
  font-family: var(--font-body);
  color: var(--text-color);
  background-color: var(--dynamic-bg-color);
  line-height: 1.6;
  font-size: var(--font-size-body);
  font-weight: 400;
  max-width: 100vw;
  overflow-x: hidden;
  transition:
    background-color 0.2s ease,
    color 0.16s ease;
}

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

h1 {
  font-weight: 500;
  margin-bottom: 1.25rem;
}

h2 {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h3 {
  font-weight: 500;
  margin-bottom: 1rem;
}

h4 {
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* UI elements use Space Grotesk */
.btn,
.contact-label {
  font-family: var(--font-ui);
}

.about > h2,
.about > section,
.projects > h2,
.projects > div,
.skills > h2,
.skills > div,
.contact > h2,
.contact > p,
.contact > nav {
  max-width: 50rem;
  margin-inline: auto;
  padding: 0 1.5rem;
}

/* ========================================
   SCROLL AND TRANSITIONS
======================================== */

section {
  scroll-margin-top: 6.25rem;
}

header,
aside,
footer {
  transition:
    background-color 0.2s ease,
    border-color 0.18s ease;
}

.project-card,
.btn {
  transition:
    background-color 0.2s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

main > section {
  position: relative;
  padding: 7.5rem 0;
  margin-bottom: 2.5rem;
}

main > section.hero {
  padding: 0;
  margin-bottom: 0;
}

main > section:not(.hero):not(.about)::before {
  content: "";
  position: absolute;
  top: 2rem;
  left: 50%;
  width: 2.75rem;
  height: 0.25rem;
  transform: translateX(-50%);
  background: var(--selection-color);
  pointer-events: none;
}

.section-title {
  font-size: var(--font-size-h2);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  color: var(--text-color);
  transition:
    color 0.24s ease,
    opacity 0.24s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-color);
  text-decoration: none;
  font-size: var(--font-size-secondary);
  font-weight: 400;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--text-color);
  color: var(--text-color);
  text-decoration: none;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-surface);
  background: var(--background-color);
}

.card:hover {
  border-color: var(--text-color);
  transform: translateY(-2px);
}

/* Semantic list styles - remove default list styling */
ol.timeline,
ul.achievements-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Ensure timeline and achievement items maintain their styling */
li.timeline-item,
li.achievement-item {
  list-style: none;
}

/* Special styling for Human-Communication and Interaction text */
.hci-highlight {
  font-family: "Caveat", cursive;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 1.3em;
  transition: color 0.3s ease;
}

[data-theme="dark"] .hci-highlight {
  color: #60a5fa;
}

/* Global link styles - Improved for mobile accessibility */
a {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-color: var(--text-color);
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.1875rem;
  font-weight: inherit;
  transition:
    color 0.24s ease,
    text-decoration-color 0.24s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:hover {
  color: var(--text-color);
  text-decoration-color: var(--text-color);
}

a:focus-visible {
  outline: 0.125rem solid var(--text-color);
  outline-offset: 0.125rem;
}

a:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   SELECTION STYLES
======================================== */

::selection {
  background-color: var(--selection-color);
  color: var(--selection-text-color);
}

::-moz-selection {
  background-color: var(--selection-color);
  color: var(--selection-text-color);
}
