/* ============================================================
   CSS CUSTOM PROPERTIES — edit these to theme your site!
   TODO: Try asking Copilot to suggest a color palette for you.
   ============================================================ */
:root {
  --color-bg: #f7f1ea;
  --color-bg-alt: #efe7dd;
  --color-text: #1f2933;
  --color-text-muted: #5f6b73;
  --color-accent: #8f4b3e;
  --color-accent-hover: #b16253;
  --color-border: #c65a11;
  --font-main: 'Segoe UI', system-ui, sans-serif;
  --font-display: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  --hero-image: url("./Images/daytime.gif");
  --radius: 10px;
  --shadow: 0 10px 30px rgba(31, 41, 55, 0.12);
  --transition: 0.2s ease;
}

  [data-theme="dark"] {
    --color-bg: #0b1220;
    --color-bg-alt: #111827;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-accent: #d8a15d;
    --color-accent-hover: #f0c07b;
    --color-border: #243042;
    --hero-image: url("./Images/nightime.gif");
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

h1, h2 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-rendering: geometricPrecision;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: #f5d79b;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-accent);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f5d79b;
  transition: transform var(--transition), background-color var(--transition), color var(--transition);
}

.dark-toggle:hover {
  transform: translateY(-1px);
  background: rgba(245, 215, 155, 0.12);
}

.dark-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.dark-toggle[data-state="off"] {
  color: #8e99a9;
}

.dark-toggle[data-state="off"]:hover {
  background: rgba(142, 153, 169, 0.14);
}

.torch-icon {
  width: 1.7rem;
  height: 1.7rem;
  display: block;
  shape-rendering: crispEdges;
}

.torch-handle,
.torch-cap,
.torch-flame,
.torch-spark {
  shape-rendering: crispEdges;
}

.torch-handle {
  fill: currentColor;
}

.torch-cap {
  fill: currentColor;
}

.torch-flame {
  fill: currentColor;
  transform-origin: center bottom;
}

.torch-spark {
  fill: #fff1a8;
  transform-origin: center bottom;
}

.dark-toggle[data-state="off"] .torch-flame,
.dark-toggle[data-state="off"] .torch-spark {
  opacity: 0;
}

.dark-toggle[data-state="lit"] .torch-flame {
  animation: torch-flicker 1.2s ease-in-out infinite alternate;
}

@keyframes torch-flicker {
  0% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(-1px) scale(1.03);
  }
}

/* TODO: The nav isn't responsive on mobile yet.
   Ask Copilot: "Make this navbar collapse into a hamburger menu on small screens" */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.72), rgba(11, 18, 32, 0.5)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
}

.hero-content {
  max-width: 700px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.highlight {
  color: #f5d79b;
}

.hero-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
}

.caret {
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 2rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-accent);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.btn:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent) !important;
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff !important;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.section-alt {
  background: var(--color-bg-alt);
  max-width: 100%;
  padding: 5rem 2rem;
}

.section-alt > * {
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.projects-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.projects-title::after {
  bottom: -6px;
}

.projects-icon {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: middle;
}

/* Accent underline on section headings */
h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-text p + p {
  margin-top: 1rem;
}

.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.project-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.project-links a {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-badge {
  padding: 0.5rem 1rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  /* TODO: Ask Copilot to add an emoji or icon prefix to each badge */
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-intro {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   RESPONSIVE
   TODO: This is a start, but there's more to do on mobile.
   Ask Copilot: "Improve the responsive styles for screens under 600px"
   ============================================================ */
@media (max-width: 600px) {
  .navbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-logo {
    font-size: 1.1rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .nav-links li {
    flex: 0 1 auto;
  }

  .hero {
    padding: 3rem 1.25rem;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    width: 100px;
    height: 100px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .section,
  .section-alt {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
