/* Theme tokens */
:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #888888;
  --border: lightgray;
  --link: #0000ee;
  --link-visited: #551a8b;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #181818;
  --text: #ebebeb;
  --muted: #9b9b9b;
  --border: #444444;
  --link: #8ab4f8;
  --link-visited: #c6a4f5;
  color-scheme: dark;
}

html {
  background-color: var(--bg);
  /* scroll-behavior: smooth; */
}

/* Short cross-fade when the switch is flipped (not on page load).
   The switch itself is excluded: it has its own transitions below. */
.theme-transition,
.theme-transition *:not(.theme-toggle):not(.switch-thumb):not(.switch-thumb i) {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

#topbutton {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  display: none;
  z-index: 1000;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
#topbutton:hover {
  border: 1px solid var(--text);
}

/* Container */
.inter-body {
  padding: 0;
  margin: 0;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  background-color: var(--bg);
  color: var(--text);
}
.main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Navigation bar */
.header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}
.header-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0;
  padding: 0;
}
.header-container a {
  color: var(--text);
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  border: 1px solid transparent;
}
.header-container #nav {
  margin: 10px 10px 10px auto;
}
.header-container a:hover {
  border: 1px solid var(--text);
}
.icon, .icon i {
  display: none;
}
.logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  margin: 16px;
}
.logo > h1 {
  font-size: 40px;
  margin: 0;
}
.logo > p {
  font-size: 16px;
  color: var(--muted);
}
.active {
  background-color: #ddd;
  color: white;
}

/* Dark mode switch */
.theme-toggle {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  margin: 0 16px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  display: block;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.theme-toggle:hover {
  border-color: var(--text);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.switch-thumb {
  display: block;
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease,
    color 0.3s ease;
}
:root[data-theme="dark"] .switch-thumb {
  transform: translateX(22px);
}

/* Both icons share the same spot; only one is visible at a time.
   Selectors are scoped to .theme-toggle so they win over Font Awesome's
   own .fa-solid rules (its stylesheet loads after this one). */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transition:
    opacity 0.3s ease,
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle .icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
.theme-toggle .icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Profile card */
.sidebar {
  position: block;
  top: 0;
  left: 0;
  width: 350px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
}
.profile {
  position: fixed;
  display: flex;
  flex: 0 0 auto;
  max-width: 350px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile h1, h3, p {
  margin: 6px;
}
.profile-picture {
  overflow: hidden;
  width: 180px;
  height: 180px;
  border-radius: 50%;
}
.profile-picture img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.social-icons {
  display: flex;
  flex-direction: row;
}
.social-icons a {
  font-size: 18px;
  margin: 6px 6px;
  color: var(--text);
}
.email {
  font-family: "IBM Plex Mono", monospace;
}

/* Content */
.content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  max-width: 1400px;
  padding: 20px;
  margin: 0 auto;
}
.blog {
  flex: 1;
  min-width: 0;
}
.blog h1 {
  font-size: 50px;
}
.blog p {
  font-size: 16px;
  margin: 0;
}
.blog a {
  color: var(--link);
}
.blog a:visited {
  color: var(--link-visited);
}

/* News post */
.post {
  margin-bottom: 15px;
}
.news-post {
  margin-bottom: 40px;
}

.news-post h2 {
  font-size: 32px;
  margin-bottom: 5px;
}

.news-post .date {
  font-size: 14px;
  color: var(--muted);
}

.news-post img {
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
  margin: 10px 0;
}

.news-post p {
  font-size: 16px;
  line-height: 1.6;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 auto;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer p {
  margin: 40px;
}

/* Responsive */
@media (max-width: 900px) {
  .profile, .blog {
    width: 90%;
  }
  .content {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    height: auto;
    width: 100%;
    justify-content: center;
    margin: 0;
    padding: 0;
  }
  .profile {
    position: relative;
  }
  .header-container {
    display: block;
    overflow: hidden;
    position: relative;
  }
  .header-container #nav {
    display: none;
    margin: 0;
  }
  .header-container a {
    text-align: center;
    display: block;
  }
  .icon {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    margin: 16px;
    padding: 0 4px;
  }
  .icon i {
    display: block;
    font-size: 30px;
  }
  /* Sits just left of the menu icon */
  .theme-toggle {
    position: absolute;
    top: 18px;
    right: 68px;
    margin: 0;
  }
}

#nav.show {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .switch-thumb,
  .theme-toggle .icon-sun,
  .theme-toggle .icon-moon {
    transition: none;
  }
  .theme-transition,
  .theme-transition * {
    transition: none !important;
  }
}