/* Base tokens */
:root {
  --font-header: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;

  --color-bg: #f6faff;
  --color-text: #262a2e;
  --color-accent: #6c63ff;
  --color-atags: #4ee0cb;
  --color-lightblue: #a4c8f0;
  --color-shadow: #c8e8f8;

  --base-font-size: 1rem;
  --H2H3P-Colour: #2fbbaa;
  --H1-Colour: #4F46E5;
}

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

html {
  min-height: 100%;
  background: linear-gradient(135deg, #e7d6ff 0%, #e4f8f2 45%, #f6faff 100%);
}

/* Body sits on top of gradient */
body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--color-text);
  min-height: 100vh;
  background: transparent;
  padding: 20px;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.wrapper {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1rem;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-header);
  letter-spacing: -0.25px;
}

h1 {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--H1-Colour);
}

.home-hero h1 {
 text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 10px rgba(47, 187, 170, 0.30),
    0 0 22px rgba(47, 187, 170, 0.18);
}

header h1 {
  margin-bottom: 0.75rem;
}

h2 {
  font-weight: 600;
  font-size: var(--base-font-size);
  letter-spacing: 0.25em;
  color: #249988;
}

p {
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Links */
a {
  text-decoration: none;
  font-family: var(--font-body);
  color: var(--color-text);
  transition: color 0.25s ease;
}

a:hover {
  color: var(--color-text);
}

h1 strong {
  color: var(--color-atags);
}

/* Utilities */
.hidden {
  display: none;
}

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  /* keep consistent */
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  backdrop-filter: blur(6px);
  box-shadow: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.nav-menu a {
  color: var(--color-atags);
  transition: background 0.25s ease, color 0.25s ease;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.nav-menu a:hover {
  background: rgba(47, 187, 170, 0.15);
  color: var(--color-text);
}

.nav-menu .nav-link.active {
  background: rgba(47, 187, 170, 0.6);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Auth button */
.auth-container {
  margin-left: auto;
}

.nav-auth-btn {
  margin-left: 1rem;
  padding: 6px 14px;
  border-radius: 20px;
}

.auth-btn {
  background: rgba(47, 187, 170, 0.15);
  border: 1px solid rgba(47, 187, 170, 0.35);
  color: #249988;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-btn:hover {
  background: rgba(47, 187, 170, 0.35);
  color: var(--color-text);
}

/* Auth primary loading state */
.auth-primary.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
  opacity: 0.8;
}

.auth-primary.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  transform: translate(-50%, -50%);
  animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Tagline */
.tag-line {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--H2H3P-Colour);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* Tags */
.tag {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid rgba(47, 187, 170, 0.4);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: none;
}

.tag:hover {
  background-color: rgba(47, 187, 170, 0.12);
  box-shadow: 0 0 10px rgba(47, 187, 170, 0.35);
  transform: scale(1.02);
}

.tag.active {
  background-color: rgba(47, 187, 170, 0.25);
  color: #262a2e;
  border-color: rgba(47, 187, 170, 0.7);
}

/* Footer */
footer {
  margin-top: auto;
}

.icons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-flow: row wrap;
  gap: 2rem;
  justify-content: center;
  /* only affects icon list */
}

.icons svg {
  width: 25px;
  height: 25px;
}

.social {
  fill: var(--H1-Colour);
}

.social:hover {
  fill: var(--H2H3P-Colour);
}

.copyright {
  margin-top: 0.75rem;
  padding-top: 0.25rem;
  font-size: 0.75rem;
  color: rgba(38, 42, 46, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Toast messages */
.messages-wrapper {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-banner {
  background: #198754;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.message-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.message-banner.error,
.message-banner.danger {
  background: #dc3545;
}

.message-banner.warning {
  background: #ffc107;
  color: #212529;
}

.message-banner.info {
  background: #0dcaf0;
}

.message-banner.success {
  background: #198754;
}

/* Comments modal */
.comments-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.comments-modal.is-open {
  display: flex;
}

.comments-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.comments-modal__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  max-height: 80vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 1.75rem 2rem;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(22, 42, 65, 0.25);
}

.comments-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.comments-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}

.comments-panel__header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #283593;
}

.comments-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comments-form__field textarea,
.comments-form__field textarea:focus {
  width: 100%;
  min-height: 90px;
  border-radius: 10px;
  border: 1px solid #cfe9f4;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  box-shadow: none;
}

.comments-form__field textarea:focus {
  border-color: #3ad1c1;
  box-shadow: 0 0 0 2px rgba(58, 209, 193, 0.15);
}

.comments-form__actions {
  display: flex;
  justify-content: flex-end;
}

.comments-btn-primary {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #3ad1c1, #76e7ff);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s ease;
}

.comments-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.comments-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.comment-delete-btn {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #3ad1c1, #76e7ff);
  color: #249988;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s ease;
}

.comment-delete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.comment-delete-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.comment-btn {
  background: rgba(47, 187, 170, 0.1);
  border: 1px solid rgba(47, 187, 170, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.85rem;
  color: #249988;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: none;
}

.comment-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-controls form {
  display: inline;
  margin: 0;
}

.comments-signin-note {
  font-size: 0.9rem;
  color: #6b7b8f;
}

.comments-scroll {
  flex: 1;
  margin-top: 0.5rem;
  padding-right: 0.25rem;
  max-height: 45vh;
  overflow-y: auto;
}

.comments-scroll::-webkit-scrollbar {
  width: 6px;
}

.comments-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.comments-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.comment-card {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.comment-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
}

.comment-card__meta-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.comment-card__author {
  font-weight: 600;
  font-size: 0.9rem;
  color: #2c7a7b;
}

.comment-card__date {
  font-size: 0.75rem;
  color: #8a9bb0;
}

.comment-card__body {
  margin: 0;
  font-size: 0.95rem;
  color: #3a4a5f;
  line-height: 1.4;
}

.comments-empty {
  font-size: 0.9rem;
  color: #8a9bb0;
  text-align: center;
  margin-top: 1rem;
}

.comment-delete-form {
  margin: 0;
}

.comment-delete-btn {
  background: transparent;
  border: none;
  color: #e11d48;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.comment-delete-btn:hover {
  color: #be123c;
  text-decoration: underline;
}

.comment-edit-btn {
  background: transparent;
  border: none;
  color: #3b82f6;
  font-size: 14px;
  cursor: pointer;
  margin-right: 8px;
  padding: 0;
  transition: color 0.2s ease;
}

.comment-edit-btn:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Auth modal */
.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.auth-modal__content {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  width: min(420px, 92vw);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
  z-index: 1;
  text-align: left;
}

.auth-modal__close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

#auth-form input[type="email"],
#auth-form input[type="password"] {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 0.9rem;
}

.auth-primary {
  background: #2fbbaa;
  border: none;
  color: #fff;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.3rem;
}

.auth-switch {
  margin-top: 0.6rem;
  font-size: 0.78rem;
}

.auth-switch button {
  background: none;
  border: none;
  color: #2fbbaa;
  cursor: pointer;
  font-weight: 500;
}

/* Layout */
main {
  margin-top: 20px;
}

/* Responsive nav */
@media (max-width: 542px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.93);
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu li a {
    text-align: left;
  }
}

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

  .wrapper {
    padding: 0.5rem;
  }

  main {
    margin-top: 1rem;
  }

  header {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  header h2 {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
  }

  header h1 {
    font-size: clamp(1.9rem, 7vw, 2.35rem);
  }

  .tag-line {
    max-width: 34rem;
    margin: 0.15rem auto 0.4rem;
  }

  .tag-line p {
    font-size: 0.75rem;
    line-height: 1.2;
    color: rgba(38, 42, 46, 0.75);
    margin: 0 auto;
    max-width: 48ch;
  }
}

/* Project Info Modal */
.project-info-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.project-info-modal.active {
  display: flex;
}

.project-info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.project-info-modal__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
  border-radius: 18px;
  padding: 1.75rem 2rem;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(22, 42, 65, 0.25);
  animation: modal-slide-in 0.3s ease-out forwards;
}

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-info-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.project-info-modal__close:hover {
  color: #000;
}

#project-info-modal-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #283593;
  margin-bottom: 0.75rem;
}

#project-info-modal-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.5rem;
}

/* Fix: your link id in index.html is project-info-github */
#project-info-github {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid rgba(47, 187, 170, 0.4);
  background-color: transparent;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

#project-info-github:hover {
  background-color: rgba(47, 187, 170, 0.12);
  box-shadow: 0 0 10px rgba(47, 187, 170, 0.35);
  transform: scale(1.02);
}

#project-info-github:active {
  background-color: rgba(47, 187, 170, 0.25);
  color: #262a2e;
  border-color: rgba(47, 187, 170, 0.7);
}