/* --- Base Styles & Variables --- */
:root {
  --bg-color: #f4f4f4;
  --text-color: #333;
  --link-color: #0077cc;
  --border-color: #ddd;
  --header-color: #111;
  --subtle-color: #666;
  --code-bg-color: #e9e9e9;
  --pre-bg-color: #fafafa;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --link-color: #58a6ff;
  --border-color: #333;
  --header-color: #f0f0f0;
  --subtle-color: #999;
  --code-bg-color: #2a2a2a;
  --pre-bg-color: #1e1e1e;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol";
  line-height: 1.7;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  opacity: 0;
  animation: fadeInBody 0.5s ease-in forwards;
}

@keyframes fadeInBody {
  to {
    opacity: 1;
  }
}


/* --- Typography --- */
h1,
h2,
h3,
h4 {
  color: var(--header-color);
  line-height: 1.3;
  font-weight: 600;
}

/* Homepage h1 */
h1 {
  font-size: 2.2rem;
}

/* Homepage section headers */
h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Homepage project titles */
h3 {
  font-size: 1.25rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

p {
  margin-bottom: 1rem;
}

ul {
  list-style-position: inside;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  background-color: var(--code-bg-color);
  color: var(--subtle-color);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

pre {
  background-color: var(--pre-bg-color);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow-x: auto;
}


/* --- Layout --- */

/* This is for the HOMEPAGE ONLY */
.site-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

/* This is for SINGLE PAGES (projects, posts) ONLY */
.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem; /* The original had padding on the body, this correctly applies it only to single pages */
}


.left-panel {
  flex: 1 1 320px;
  max-width: 380px;
  position: sticky;
  top: 4rem;
}

.main-content {
  flex: 2 1 600px;
}


/* --- Components (Homepage) --- */
.portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border-color);
}

.intro {
  margin-top: 1rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  color: var(--text-color);
  font-weight: 400;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.contact-links a:hover {
  background-color: var(--code-bg-color);
  color: var(--header-color);
  text-decoration: none;
}

.contact-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.education-item p {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--subtle-color);
}
.education-item .degree {
  font-weight: 500;
  color: var(--text-color);
  font-size: 1rem;
}

.wave-emoji {
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}

.wave-emoji:hover {
  animation: wave 0.5s ease-in-out;
}

@keyframes wave {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

.tech-tags code {
  margin-right: 5px;
  margin-bottom: 5px;
  display: inline-block;
}

.project {
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.project.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project:first-of-type {
  padding-top: 0;
}
.project:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.project-title a {
  color: var(--header-color);
}
.project-oneliner {
  font-style: italic;
  color: var(--subtle-color);
  margin: 0.5rem 0 1rem 0;
}
.project-meta p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
.project-meta strong {
  color: var(--header-color);
  min-width: 80px;
  display: inline-block;
}

footer {
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--subtle-color);
}

/* --- Components (Single Pages) --- */

/* Single page headings, to match original */
.container h1 {
  font-size: 2.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
}
.container h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 2rem;
}
.container h3 {
  font-size: 1.4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
}
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin: 2rem 0;
  border-radius: 8px;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.project-links a {
  margin-right: 1.5rem;
}

/* --- Global Components --- */
.theme-switcher {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 36px;
  height: 36px;
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1;
}

/* --- Responsive Styles --- */
@media (max-width: 960px) {
  .site-wrapper {
    flex-direction: column;
    padding: 3rem 1.5rem;
    gap: 0;
  }
  .left-panel {
    position: static;
    width: 100%;
    max-width: none;
    padding-bottom: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
  }
}

@media (max-width: 600px) {
  /* Homepage responsive font size */
  h1 {
    font-size: 1.8rem;
  }
  .site-wrapper {
    padding: 2rem 1rem;
  }
  .container {
    padding: 1.5rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

/* Add this to the end of static/style.css */

.contact-buttons {
  display: flex;
  gap: 0.5rem; /* Adds space between the buttons */
  flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
  align-items: center;
  margin-top: 0.5rem;
}

.contact-buttons a {
  text-decoration: none; /* Removes underline on hover for badges */
}

.contact-buttons img {
  transition: opacity 0.2s ease-in-out;
}

.contact-buttons img:hover {
  opacity: 0.85;
}
