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

body {
  font-family: "Adwaita Sans", "Cantarell", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: #d8d0c4;
  background: #1d1714 url('/bg.png') no-repeat center center fixed;
  background-size: cover;
  padding: 20px;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 40px 0;
}

.cv header {
  text-align: left;
  margin-bottom: 2em;
}

.cv h1 {
  font-size: 2.5em;
  margin-bottom: 0.3em;
  color: #d4a054;
}

.cv-section {
  background: #241d19;
  border: 1px solid #2e2521;
  border-radius: 8px;
  padding: 1em 1.5em 1em 1.5em;
  margin-bottom: 1.5em;
}

.cv h2 {
  font-size: 1.8em;
  margin-top: 0;
  margin-bottom: 0.5em;
  color: #d4a054;
}

.cv h3 {
  font-size: 1.3em;
  margin-top: 1em;
  margin-bottom: 0;
  color: #d8d0c4;
}

/* For non-experience items, use float layout */
.cv h3:not(.experience-item h3) {
  float: left;
  clear: both;
}

.cv h3:not(.experience-item h3)+p {
  margin-top: 1em;
  text-align: right;
  overflow: hidden;
}

.cv h3:not(.experience-item h3)+p+p,
.cv h3:not(.experience-item h3)+p+ul {
  clear: both;
}

/* Experience items use grid layout */
.experience-item h3 {
  grid-column: 1;
  margin-bottom: 0;
}

.experience-item>p:first-of-type {
  grid-column: 2;
  text-align: right;
  margin-top: 1em;
  margin-bottom: 0;
}

.experience-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1em;
  margin-bottom: 1.5em;
  clear: both;
  transition: opacity 0.2s ease, max-height 0.3s ease;
}

.experience-item>p:first-of-type strong {
  font-weight: 400;
  color: #a89888;
  font-size: 0.9em;
}

.experience-item>p:not(:first-of-type),
.experience-item>ul {
  grid-column: 1 / -1;
  margin-top: 0.5em;
}

.cv h4 {
  font-size: 1.1em;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  font-weight: 600;
}

.cv p {
  margin-bottom: 0.8em;
}

.cv ul {
  margin-left: 2em;
  margin-bottom: 1em;
}

.cv li {
  margin-bottom: 0.5em;
}

.cv-section hr {
  border: none;
  border-top: 1px solid #584838;
  margin: 1em -1.5em;
}

.accent {
  color: #d4a054;
}

.me {
  color: #d4a054;
}

.award {
  font-weight: 600;
  color: #d4a054;
}

.cv a {
  color: #d06840;
  text-decoration: none;
  font-weight: 500;
}

.cv a:hover {
  color: #d4a054;
  text-decoration: underline;
}

.cv strong {
  font-weight: 600;
}

.cv em {
  font-style: italic;
}

/* Font selector */
.font-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: #241d19;
  padding: 0.5em 1em;
  border-radius: 6px;
  border: 1px solid #2e2521;
}

.font-selector label {
  font-size: 0.85em;
  color: #a89888;
}

.font-selector select {
  background: #1d1714;
  color: #d8d0c4;
  border: 1px solid #2e2521;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.font-selector select:focus {
  outline: none;
  border-color: #d06840;
}

/* Experience filters */
.experience-filters {
  float: right;
  padding: 0.6em 1em;
  background: #1d1714;
  border: 1px solid #2e2521;
  border-radius: 4px;
  display: flex;
  gap: 1.5em;
  margin-left: 1em;
}

.experience-filters label {
  color: #d8d0c4;
}

.experience-filters label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.95em;
}

.experience-filters input[type="checkbox"] {
  cursor: pointer;
}

.experience-item.hidden {
  display: none;
}

/* Collapsible sections */
.cv h2.collapsible {
  margin: 0;
  user-select: none;
  transition: color 0.2s ease;
}

.cv h2.collapsible:hover {
  color: #d4a054;
}

.cv h2.collapsible .toggle-indicator {
  font-size: 0.7em;
  color: #d4a054;
  margin-left: 0.5em;
}

.collapsible-content {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  margin: 0 -1.5em;
  padding: 0 1.5em;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.cv-footer {
  text-align: center;
  padding: 2em 0 1em;
  color: #a89888;
  font-size: 0.9em;
}

.cv-footer a {
  color: #d06840;
  text-decoration: none;
}

.cv-footer a:hover {
  color: #d4a054;
  text-decoration: underline;
}

/* Homepage */
.home {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.home-spacer {
  height: 90vh;
}

.home-footer {
  text-align: center;
  padding: 0;
  color: #786858;
  font-size: 0.85em;
}

.home-footer a {
  color: #a89888;
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-footer a:hover {
  color: #d06840;
}

.home-card {
  background: rgba(36, 29, 25, 0.8);
  border: 1px solid #2e2521;
  border-radius: 12px;
  padding: 0.9em 1.3em 1em 1.3em;
  display: flex;
  gap: 2.5em;
  align-items: center;
  max-width: 720px;
  /* backdrop-filter: blur(12px); */
}

.home-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  border: 2px solid #2e2420;
}

.home-info h1 {
  font-size: 1.8em;
  color: #d4a054;
  /* margin-bottom: 0.4em; */
}

.home-blurb {
  color: #c8b8a8;
  font-size: 0.95em;
  line-height: 1.7;
  margin-bottom: 0.6em;
}

.home-blurb a {
  color: #d06840;
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-blurb a:hover {
  color: #d4a054;
}

.home-links {
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex-wrap: wrap;
}

.home-links a {
  color: #d06840;
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-links a:hover {
  color: #d4a054;
}

.home-links a.emoji-link {
  font-size: 1.2em;
  text-decoration: none;
}

.home-links a.emoji-link:hover {
  text-decoration: none;
}

.link-sep {
  color: #584838;
}

/* Homepage font selectors */
.home-font-selectors {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 0.8em;
  z-index: 10;
}

.home-font-selector {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background: #241d19;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  border: 1px solid #2e2521;
}

.home-font-selector label {
  font-size: 0.8em;
  color: #a89888;
}

.home-font-selector select {
  background: #1d1714;
  color: #d8d0c4;
  border: 1px solid #2e2521;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
}

.home-font-selector select:focus {
  outline: none;
  border-color: #d4a054;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  main {
    padding: 10px;
  }

  .cv h1 {
    font-size: 2em;
  }

  .cv h2 {
    font-size: 1.5em;
  }

  .home-card {
    flex-direction: column;
    padding: 0.5em 1em;
  }

  .home-font-selectors {
    position: static;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1em;
  }
}