/*
 * Portfolio Site Stylesheet
 *
 * Defines dark and light theme variables, base layout, navigation bar,
 * hero sections, card layouts, and responsive grids for highlights and projects.
 */

/* Theme variables */
:root {
  --bg-color: #121212;
  --text-color: #e6e6e6;
  --card-bg: #1e1e1e;
  --accent-color: #4FC3F7;
  --accent-color-2: #00B8D9;
  --nav-bg: rgba(18,18,18,0.9);
  --footer-bg: #0f0f0f;
  --link-hover-bg: var(--accent-color);
  --link-hover-color: #101010;
  --hero-overlay: rgba(0,0,0,0.55);
  --about-overlay: rgba(0,0,0,0.30);
}
.light-theme {
  --bg-color: #f7f7f7;
  --text-color: #1a1a1a;
  --card-bg: #ffffff;
  --nav-bg: rgba(255,255,255,0.85);
  --footer-bg: #ffffff;
  --link-hover-bg: #0EA5E9;
  --link-hover-color: #ffffff;
  --hero-overlay: rgba(255,255,255,0.65);
  --about-overlay: rgba(255,255,255,0.1);
}

/* Base resets */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}
main { flex: 1 0 auto; }

/* Navigation bar */
nav {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(6px);
  z-index: 10;
}
nav .nav-inner {
  display: flex;
  align-items: center;
  padding-block: 0.75rem;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  margin-left: auto;
  align-items: center;
}
nav a {
  opacity: 0.85;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: opacity 0.2s ease, color 0.2s ease;
}
nav a:hover,
nav a.active {
  opacity: 1;
  color: var(--accent-color);
}
.theme-toggle, .lang-toggle {
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-color);
}

/* Hero section */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 70vh;
  background-size: cover;
  background-position: center;
  margin-bottom: 2rem;
}
.media-dimmed::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}
.hero .lead {
  font-size: 1.1rem;
  max-width: 800px;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Card styles */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
}
.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.card-body {
  padding: 1rem;
  flex: 1;
}
.card-body h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}
.card-body p {
  font-size: 0.95rem;
  color: #b5b5b5;
}
.about-card-img {
  object-position: top;
}
.btn {
  margin-top: 0.6rem;
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: var(--accent-color-2);
  color: #fff;
  font-weight: 600;
  transition: background 0.3s ease;
}
.btn:hover {
  background: var(--accent-color);
}

/* Highlights and Projects grids */
.highlights,
.projects {
  display: grid;
  gap: 1.5rem;
  margin-block: 2rem;
  justify-content: center;
  justify-items: center;
}
.highlights {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.projects {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
  .projects {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Fill grid track completely to match spacing */
.highlights .card {
  width: 100%;
  max-width: 520px;
}

/* Page header styling for section titles on subpages */
.page-header {
  text-align: center;
  margin-block: 2rem;
}
.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.page-header .lead {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

/* About page layout */
.about-block {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 5rem;
  margin-block: 2rem;
  padding-inline: 1rem;
  align-items: start;
}
.about-content {
  display: flex;
  flex-direction: column;
  /* Allow custom spacing between elements in about-content. Users can adjust
     --paragraph-spacing to increase or decrease spacing between paragraphs and
     other items. */
  gap: var(--paragraph-spacing, 0.1rem);
  max-width: 720px;
}
.about-visual {
  position: relative;
  align-self: center;
  background: var(--bg-color);
  overflow: hidden;
  /* Set a default aspect ratio for media containers so videos crop correctly */
  aspect-ratio: 16 / 9;
}
.about-visual img {
  width: 100%;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.35);
}

/* Ensure videos within the about-visual behave similarly to images but fill and center crop */
.about-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.35);
  border: none;
}
.about-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--about-overlay);
  /* Place the overlay above the media for tinting but allow click-through */
  z-index: 1;
  pointer-events: none;
}
.about-visual.about-raw-visual {
  background: transparent;
}
.about-visual.about-raw-visual::before {
  background: transparent;
}
@media (max-width: 900px) {
  .about-block {
    grid-template-columns: 1fr;
  }
  .about-visual {
    margin-top: 1.5rem;
    background-position: center;
  }
}

/* List styling */
.list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.list li {
  position: relative;
  margin: 0.4rem 0;
  padding-left: 1.3rem;
}
.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
}

/* Footer */
footer {
  margin-top: auto;
  background: var(--footer-bg);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  opacity: 0.85;
}