/*
  Optimized Portfolio Stylesheet
  Author: Robin Bailey
  Date: 2024
  Description: A consolidated and refactored stylesheet for the portfolio.
*/

/* 1. VARIABLES (CSS CUSTOM PROPERTIES)
-------------------------------------------------- */
:root {
  /* Colors - Light Mode */
  --color-background: #ffffff;
  --color-background-offset: #f4f4f5;
  --color-background-rgb: 255, 255, 255;
  --color-text-primary: #2d3748;
  --color-text-primary-rgb: 45, 55, 72;
  --color-text-secondary: #545a63;
  --color-text-subtle: #858d98;
  --color-link: #ff6b35;
  --color-link-rgb: 255, 107, 53;
  --color-border: rgba(255, 107, 53, 0.3);
  --color-dash: #ea580c;
  --shadow-color: rgba(255, 107, 53, 0.15);
  --success: #10b981;

  /* Typography */
  --font-family-base: "Inter", system-ui, -apple-system, Segoe UI, Roboto,
    Ubuntu, sans-serif;
  --font-family-tagline: "EB Garamond", serif;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;
}

/* Dark Mode Color Overrides */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #26282b;
    --color-background-offset: #303235;
    --color-background-rgb: 38, 40, 43;
    --color-text-primary: #f3f4f6;
    --color-text-primary-rgb: 243, 244, 246;
    --color-text-secondary: #a3abb7;
    --color-text-subtle: #858d98;
    --color-link: #56a2ff;
    --color-link-rgb: 86, 162, 255;
    --color-border: rgba(243, 244, 246, 0.2);
    --color-dash: #868d97;
    --shadow-color: rgba(0, 0, 0, 0.2);
  }
}

/* 2. FONT-FACE DEFINITIONS
    -------------------------------------------------- */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/Inter-Regular.woff2) format("woff2"),
    url(../assets/fonts/Inter-Regular.woff) format("woff");
}

@font-face {
  font-family: Inter;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/Inter-Italic.woff2) format("woff2"),
    url(../assets/fonts/Inter-Italic.woff) format("woff");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/Inter-SemiBold.woff2) format("woff2"),
    url(../assets/fonts/Inter-SemiBold.woff) format("woff");
}

/* 3. BASE & RESET STYLES
    -------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  position: relative;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-background);
  color: var(--color-text-secondary);
  transition: background-color 0.3s ease, color 0.3s ease,
    padding-left 0.3s ease;
  line-height: 1.6;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  transition: transform 0.3s ease;
}

h1:hover {
  transform: scale(1.02);
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-normal);
}
h3 {
  font-size: 1.75rem;
  letter-spacing: -0.013em;
  transition: color 0.3s ease;
}
h4 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
h5 {
  font-size: 1rem;
  letter-spacing: inherit;
}
h6 {
  font-size: 1rem;
  letter-spacing: 0.008em;
}

p {
  margin-bottom: 1rem;
  max-width: 65ch; /* Improve readability */
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ol,
ul {
  list-style: none;
}

/* 4. LAYOUT
    -------------------------------------------------- */
.container {
  width: 100%;
  max-width: 64rem; /* 1024px */
  margin: 0 auto;
  padding: 0 var(--space-s);
}

@media (min-width: 48em) {
  /* 768px */
  .container {
    padding: 0 var(--space-m);
  }
}

.section {
  padding-top: var(--space-l);
  padding-bottom: var(--space-l);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  animation: fadeInUp 0.6s ease-out;
}

.section--grey {
  background-color: var(--color-background-offset);
  position: relative;
  overflow: hidden;
}

/* 5. COMPONENTS
    -------------------------------------------------- */

/* --- Header --- */
.header {
  text-align: center;
}

.header__profile {
  width: 5rem;
  height: 5rem;
  background-image: url(assets/images/Original_Grey.png);
  background-size: cover;
  border-radius: 20%;
  margin: 0 auto 1.5rem;
  border: 3px solid transparent;
  position: relative;
}

.header__profile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20%;
  animation: profile-glow 10s ease-in-out infinite;
  z-index: -1;
}

.header__headings {
  margin-bottom: 1.5rem;
}

.header__description {
  max-width: 65ch;
  margin: 0 auto 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.header__description .tagline {
  font-family: var(--font-family-tagline);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  margin-top: 1.5rem;
  color: var(--color-link);
}

.expertise {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  justify-content: center;
  margin: 2rem auto;
  max-width: 65ch;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.expertise__group {
  flex: 1;
  min-width: 250px;
  text-align: center;
}

.expertise__title {
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.expertise__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  justify-content: center;
}

/* --- MODIFIED: Tag System --- */

/* Base .tag class (acts as Skill Tag style) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background-color: transparent;
  color: var(--color-text-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease-in-out;
  cursor: default;
  text-decoration: none;
}

.tag:hover {
  background-color: var(--color-link);
  color: var(--color-background);
  border-color: var(--color-link);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--shadow-color);
}

/* NEW: .tag--feature modifier (for filled Category Tags) */
.tag--feature {
  background-color: var(--color-link);
  color: var(--color-background);
  border-color: var(--color-link);
  padding: 0.4rem 0.8rem 0.4rem 0.6rem; /* Adjust padding for icon */
}

/* In dark mode, use a lighter text for filled tags for better contrast */
[data-theme="dark"] .tag--feature {
  color: #121212;
}

.tag--feature:hover {
  background-color: var(--color-link);
  color: var(--color-background);
  filter: brightness(1.1);
}

.tag--feature i {
  font-size: 0.7em;
  opacity: 0.8;
}

.dash {
  border-bottom: 3px solid var(--color-dash);
  width: 40px;
  margin: 1.5rem auto;
  transition: width 0.3s ease, border-color 0.3s ease;
}

.header:hover .dash {
  width: 60px;
  border-color: var(--color-link);
}

.header__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.header__links .link {
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.header__links .link:hover {
  color: var(--color-link);
  border-bottom-color: var(--color-link);
  text-decoration: none;
  transform: translateY(-2px);
}

.header__links .link i {
  margin-right: 0.5em;
  transition: transform 0.3s ease;
}

.header__links .link:hover i {
  transform: scale(1.2);
}

.arrow-holder {
  display: inline-block;
  margin-top: var(--space-m);
  color: var(--color-text-subtle);
  transition: transform 0.3s ease;
}

.arrow-holder:hover {
  transform: scale(1.1);
  text-decoration: none;
}

.arrow {
  animation: bounce 2s infinite;
  transition: color 0.3s ease;
  color: var(--color-link);
}

.arrow-holder:hover .arrow {
  animation-play-state: paused;
}

/* --- About Section --- */
.about__grid {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 48em) {
  /* 768px */
  .about__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about__category h4 {
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
  font-size: 0.75rem;
  letter-spacing: 0.125em;
  margin-bottom: 1.5rem;
  color: var(--color-text-subtle);
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.3s ease;
}

.about__category h4 i {
  transition: transform 0.3s ease;
}

.about__list {
  display: grid;
  gap: 2rem;
}

.about__item {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--color-background);
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.about__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow-color);
  background: var(--color-background-offset);
  border-color: var(--color-link);
}

.about__item h6 {
  font-weight: var(--font-weight-semibold);
  transition: color 0.3s ease;
}

.about__item:hover h6 {
  color: var(--color-link);
}

.about__item h6 small {
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-normal);
}

.about__description {
  margin-top: 0.5rem;
}

.about__date {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* --- Related Projects in Experience (NEW STYLES) --- */
.about__item-projects {
  margin-top: auto; /* Pushes this section to the bottom */
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.projects__title {
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.projects__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-background);
  color: var(--color-text-secondary);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}

.project-tag:hover {
  background-color: var(--color-link);
  color: var(--color-background);
  border-color: var(--color-link);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 4px 10px var(--shadow-color);
}

/* Pip/dot for the project tag */
.project-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-text-subtle);
  margin-right: 0.5rem;
  transition: background-color 0.2s ease-in-out;
}

.project-tag:hover::before {
  background-color: var(--color-background);
}

/* --- Speaking Section Specifics --- */
.speaking__item {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.speaking__item h6 {
  font-weight: var(--font-weight-bold);
  font-size: 1.1rem;
}

.speaking__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.speaking__topic {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background-color: var(--color-background-offset);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--color-link);
}

.speaking__topic i {
  color: var(--color-link);
  margin-top: 0.25rem;
}

.speaking__topic .about__description {
  margin: 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.about__item.speaking__item:hover {
  background: var(--color-background);
}

.about__item.speaking__item:hover .speaking__topic {
  background-color: var(--color-background);
}

/* =================================================================== */
/* START: MODIFIED WORK SECTION STYLES */
/* =================================================================== */
.work__header {
  text-align: center;
  margin-bottom: var(--space-l);
}

.work__header h5 {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-normal);
}

.work__grid {
  display: grid;
  gap: 2rem;
  padding-top: 1rem;
}

@media (min-width: 37.5em) {
  .work__grid:not(.work__grid--prominent) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 62em) {
  .work__grid:not(.work__grid--prominent) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work__grid--prominent {
  grid-template-columns: 1fr;
  gap: var(--space-l);
}

.work__item {
  background-color: var(--color-background);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 2rem;
}

.work__item:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px var(--shadow-color);
  border-color: var(--color-link);
}

.work__item-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.work__item-link:hover {
  text-decoration: none;
}

.work__item-image-wrapper {
  overflow: hidden;
  position: relative;
}

.work__item-image-wrapper img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.work__item:hover .work__item-image-wrapper img {
  transform: scale(1.05);
}

.work__item-image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(
    28,
    30,
    34,
    0.25
  ); /* Dark, semi-transparent background for the glass effect */
  backdrop-filter: blur(8px); /* The blur effect */
  -webkit-backdrop-filter: blur(8px); /* For Safari */
  z-index: 2;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  /* Use a mask to apply the effect only at the bottom and fade it out */
  mask-image: linear-gradient(to top, black 30%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, black 30%, transparent 90%);
}

.work__item:hover .work__item-image-wrapper::after {
  background: rgba(28, 30, 34, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.work__item-title-group {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.work__item-title-group .work__item-title-on-image {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
}

.work__item-title-group .work__item-client-on-image {
  font-size: 0.9rem;
  font-weight: var(--font-weight-normal);
  color: #ffffff;
  margin-top: 0.25rem;
  opacity: 0.9;
}

.work__item-client-on-image i {
  margin-right: 0.5em;
}

.work__item-content {
  display: flex;
  flex-direction: row;
}

.work__item--prominent .work__item-image-wrapper {
  flex: 0 0 30%;
  min-height: 350px;
}

.work__item-details {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 2rem;
}

.work__item-highlights {
  flex: 0 0 35%;
  padding: 2rem;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--color-background-offset);
  transition: background-color 0.3s ease;
}

.work__item:hover .work__item-highlights {
  background-color: var(--color-background);
}

.work__item-section-title {
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
  display: inline-block;
}

.work__item-overview {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

.work__item-details .work__item-tags {
  margin-top: 1rem;
}

/* NEW: Feature Tags Container */
.work__item-feature-tags {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
}

.work__item-details .tag {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

.work__item-impact {
  display: grid;
  gap: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.work__item:hover .work__item-impact {
  opacity: 1;
}

.impact-metric {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.impact-metric i {
  color: var(--color-link);
  margin-top: 0.25rem;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.impact-metric strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}
.impact-metric span {
  display: block;
}

/* Styles for smaller work items */
.work__item:not(.work__item--prominent) .work__item-image-wrapper {
  position: relative;
  height: 200px;
}

.work__item:not(.work__item--prominent) .work__item-image-wrapper img {
  position: static;
  aspect-ratio: auto;
  height: 100%;
}

.work__item:not(.work__item--prominent) .work__item-image-wrapper::after {
  display: none;
}

.work__item-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

@media (min-width: 48em) {
  .work__item-body {
    padding: 1.5rem;
  }
}

.work__item-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.work__item-header h6 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  transition: color 0.3s ease;
  line-height: 1.4;
}

.work__item:hover .work__item-header h6 {
  color: var(--color-link);
}

.work__item-client {
  font-size: 0.9rem;
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.work__item-client i {
  margin-right: 0.5em;
  color: var(--color-link);
}

.work__item-divider {
  border-bottom: 1px solid var(--color-border);
  margin: 1rem 0;
}

@media (max-width: 62em) {
  /* 992px */
  .work__item-content {
    flex-direction: column;
  }

  .work__item--prominent .work__item-image-wrapper {
    flex-basis: auto;
    min-height: 250px;
  }

  .work__item-highlights {
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
}

/* =================================================================== */
/* END: MODIFIED WORK SECTION STYLES */
/* =================================================================== */

/* --- Project Page Specific Styles --- */
.project-nav {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-background);
  text-align: center;
}

.project-nav .link {
  font-weight: var(--font-weight-semibold);
  border-bottom: none;
  color: var(--color-text-secondary);
}

.project-nav .link:hover {
  color: var(--color-link);
  text-decoration: underline;
}

.project-header {
  padding-top: var(--space-m);
}

.project-header__client {
  font-size: 1.2rem;
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-normal);
  margin-top: 1rem;
  letter-spacing: 0;
}

.project-header__client i {
  margin-right: 0.5em;
}

.project-hero-image {
  border-radius: 12px;
  margin-bottom: var(--space-l);
  box-shadow: 0 10px 30px var(--shadow-color);
  border: 1px solid var(--color-border);
  width: 100%;
}

.project-gallery__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

.project-detail__grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 62em) {
  /* 992px */
  .project-detail__grid {
    grid-template-columns: 2fr 1fr;
  }
}

.project-detail__column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-detail__grid .about__item {
  cursor: default;
  height: 100%;
  width: 100%;
}

.project-detail__grid .about__item:hover {
  transform: none;
  box-shadow: 0 4px 12px var(--shadow-color);
  background: var(--color-background);
  border-color: var(--color-border);
}

.project-detail__grid .work__item-section-title {
  border-bottom: none;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* NEW: Style for feature tags on detail page */
.project-detail__grid .work__item-feature-tags {
  margin-top: 1.5rem;
}

.project-detail__grid .work__item-impact {
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 75em) {
  /* 1200px */
  .project-detail__grid .work__item-impact {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 48em) {
  /* 768px */
  .project-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-gallery__item img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: all 0.3s ease;
  border: 1px solid var(--color-border);
}

.project-gallery__item img:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px var(--shadow-color);
}

/* --- Contact Section --- */
.contact-container {
  text-align: center;
}

.contact-container h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.contact-container p {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* --- Footer Section (NEW MODERN DESIGN) --- */
.footer {
  padding: 0;
  background-color: #1c1e22; /* A deep, cool, theme-independent dark color */
  color: #a3abb7; /* A soft light grey for text */
}

.footer-wave {
  color: var(--color-background); /* Match the section above the footer */
  transition: color 0.3s ease;
}

.footer-wave svg {
  display: block;
  width: 100%;
  height: auto;
}

.footer-wave__fill {
  fill: currentColor;
}

.footer__container {
  padding-top: var(--space-m);
  padding-bottom: var(--space-m);
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: var(--space-m);
  margin-bottom: var(--space-m);
}

.footer__logo {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  margin: 0;
}

.footer__tagline {
  font-family: var(--font-family-tagline);
  font-style: italic;
  font-size: 1.1rem;
  color: #a3abb7;
  margin: 0.25rem 0 0 0;
}

.footer__links {
  display: flex;
  gap: 0.5rem;
}

.footer__link {
  color: #a3abb7;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.footer__link:hover {
  color: var(--color-link);
  background-color: rgba(var(--color-link-rgb), 0.1);
  transform: translateY(-3px);
  text-decoration: none;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__copyright p {
  margin: 0;
  font-size: 0.9rem;
}

.footer__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__location {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.9rem;
  color: #858d98;
}

.footer__time {
  font-weight: var(--font-weight-semibold);
  color: #a3abb7;
}

.footer__back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: #a3abb7;
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.footer__back-to-top:hover {
  color: #1c1e22; /* Dark text on hover */
  border-color: var(--color-link);
  background-color: var(--color-link);
  text-decoration: none;
}

.footer__back-to-top i {
  transition: transform 0.3s ease;
}

.footer__back-to-top:hover i {
  transform: translateY(-2px);
}

@media (max-width: 48em) {
  /* 768px */
  .footer__top,
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer__about {
    margin-bottom: 1.5rem;
  }
  .footer__meta {
    flex-direction: column;
    margin-top: 1rem;
  }
}

/* --- General Link Style --- */
.link {
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.link:hover {
  color: var(--color-link);
  border-bottom-color: currentColor;
  text-decoration: none;
  transform: translateY(-1px);
}

/* --- Reusable Button Style --- */
.btn {
  display: inline-block;
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  color: var(--color-text-primary);
  background-color: var(--color-background-offset);
  border: 2px solid var(--color-border);
  border-radius: 50px;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--color-background);
  border-color: var(--color-link);
  color: var(--color-link);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--shadow-color);
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--shadow-color);
}

/* 6. THEME PICKER
    -------------------------------------------------- */
.theme-picker {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.theme-picker__toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-picker__toggle:hover {
  transform: scale(1.1) rotate(15deg);
}

.theme-picker__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.theme-picker__panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-picker__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.theme-picker__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.theme-picker__option {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  overflow: hidden;
  margin: 0 auto;
}

.theme-picker__option:hover {
  transform: scale(1.1);
  border-color: var(--color-text-subtle);
}

.theme-picker__option.active {
  border-color: var(--color-link);
  transform: scale(1.1);
}

.theme-picker__option.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 1rem;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* 7. THEME COLOR DEFINITIONS
    -------------------------------------------------- */

/* Theme Color Swatches */
.theme-picker__option[data-theme="blue"] {
  background: linear-gradient(135deg, #56a2ff 0%, #667eea 100%);
}
.theme-picker__option[data-theme="purple"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.theme-picker__option[data-theme="green"] {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}
.theme-picker__option[data-theme="orange"] {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.theme-picker__option[data-theme="pink"] {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}
.theme-picker__option[data-theme="dark"] {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Blue theme */
[data-theme="blue"] {
  --color-link: #56a2ff;
  --color-link-rgb: 86, 162, 255;
  --color-border: rgba(84, 90, 99, 0.2);
  --color-dash: #868d97;
  --shadow-color: rgba(0, 0, 0, 0.06);
}

/* Purple theme */
[data-theme="purple"] {
  --color-link: #8b5cf6;
  --color-link-rgb: 139, 92, 246;
  --color-border: rgba(139, 92, 246, 0.3);
  --color-dash: #7c3aed;
  --shadow-color: rgba(139, 92, 246, 0.15);
}

/* Green theme */
[data-theme="green"] {
  --color-link: #10b981;
  --color-link-rgb: 16, 185, 129;
  --color-border: rgba(16, 185, 129, 0.3);
  --color-dash: #16a34a;
  --shadow-color: rgba(16, 185, 129, 0.15);
}

/* Orange theme */
[data-theme="orange"] {
  --color-link: #ff6b35;
  --color-link-rgb: 255, 107, 53;
  --color-border: rgba(255, 107, 53, 0.3);
  --color-dash: #ea580c;
  --shadow-color: rgba(255, 107, 53, 0.15);
}

/* Pink theme */
[data-theme="pink"] {
  --color-link: #f472b6;
  --color-link-rgb: 244, 114, 182;
  --color-border: rgba(244, 114, 182, 0.3);
  --color-dash: #db2777;
  --shadow-color: rgba(244, 114, 182, 0.15);
}

/* Dark theme */
[data-theme="dark"] {
  --color-background: #121212;
  --color-background-offset: #1e1e1e;
  --color-background-rgb: 18, 18, 18;
  --color-text-primary: #f5f5f5;
  --color-text-primary-rgb: 245, 245, 245;
  --color-text-secondary: #b3b3b3;
  --color-text-subtle: #737373;
  --color-link: #74b9ff;
  --color-link-rgb: 116, 185, 255;
  --color-border: rgba(116, 185, 255, 0.2);
  --color-dash: #74b9ff;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* 8. ANIMATIONS
    -------------------------------------------------- */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes profile-glow {
  0% {
    box-shadow: 5px -5px 25px 0px rgba(var(--color-link-rgb), 0.3);
    border-radius: 45% 55% 60% 40% / 65% 50% 50% 35%;
  }
  25% {
    box-shadow: -10px -8px 20px 2px rgba(var(--color-link-rgb), 0.5);
    border-radius: 65% 35% 40% 60% / 55% 60% 40% 45%;
  }
  50% {
    box-shadow: 0px 10px 28px 5px rgba(var(--color-link-rgb), 0.4);
    border-radius: 45% 55% 60% 40% / 35% 50% 50% 65%;
  }
  75% {
    box-shadow: 10px 8px 22px 3px rgba(var(--color-link-rgb), 0.6);
    border-radius: 35% 65% 60% 40% / 55% 40% 60% 45%;
  }
  100% {
    box-shadow: 5px -5px 25px 0px rgba(var(--color-link-rgb), 0.3);
    border-radius: 45% 55% 60% 40% / 65% 50% 50% 35%;
  }
}

/* --- Current Status --- */
.current-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

/* --- Tooltip Component (JS-Powered for HTML Content) --- */
.tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 2px dotted var(--color-text-subtle);
  transition: border-color 0.3s ease;
}

.tooltip-trigger:hover {
  border-bottom-color: var(--color-link);
  text-decoration: none;
}

.tooltip {
  position: absolute;
  background-color: var(--color-link);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  width: max-content;
  max-width: 300px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: bottom center;
  transform: translateY(-25px) scale(0.7) rotate(5deg); /* MODIFIED: Start from higher above */
  transition: opacity 0.3s ease,
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0s 0.4s;
  text-align: left;
}

.tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-15px) scale(1) rotate(-3deg); /* MODIFIED: Settle 10px higher */
  transition: opacity 0.3s ease 0.1s,
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
}

/* Tooltip Arrow */
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%; /* Position arrow at the bottom of the tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--color-link) transparent transparent transparent; /* This creates a downward-pointing arrow */
}

/* 9. TOP NAVIGATION
-------------------------------------------------- */
.top-nav {
  position: fixed;
  top: 2rem;
  /* This calculation positions the nav relative to the main content area on larger screens, 
     while ensuring it doesn't overlap on smaller screens by providing a minimum value.
     - 64rem is the max-width of the .container.
     - 10rem is an estimation of the nav width plus the desired gap.
     - 2rem is the minimum safe distance from the left edge of the viewport. */
  left: max(2rem, calc((100vw - 64rem) / 2 - 10rem));
  z-index: 1001;
  background-color: rgba(28, 28, 30, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: top 0.3s ease, bottom 0.3s ease, left 0.3s ease,
    transform 0.3s ease;
}

.top-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.top-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  color: #e8e8e8;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.top-nav .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.top-nav .nav-link.active {
  background-color: var(--color-link);
  color: white;
  box-shadow: 0 4px 12px var(--shadow-color);
}

@media (max-width: 48em) {
  /* 768px */
  .top-nav {
    top: auto;
    bottom: 1rem;
    width: calc(100% - 2rem);
    left: 1rem;
    transform: translateX(0);
    border-radius: 50px;
  }
  .top-nav ul {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
  }
  .top-nav .nav-link span {
    display: none;
  }
  .top-nav .nav-link {
    padding: 0.75rem;
    font-size: 1.1rem;
    border-radius: 50px;
  }
}
