@import url('https://fonts.googleapis.com/css2?family=Recursive:slnt,wght,CASL,CRSV@-3,300..800,1,1&display=swap');

:root {
  --brm: 1;
}

@supports (corner-shape: squircle) {
  :root {
    --brm: 2;
  }
}

/* Fonts */
@font-face {
  font-family: 'Arsenica';
  src: url('../fonts/Arsenica-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Arsenica';
  src: url('../fonts/Arsenica-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Arsenica';
  src: url('../fonts/Arsenica-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Benedict';
  src: url('../fonts/VujahdayScript-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  font-size: 20px;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
}

@media (max-width: 768px) {
  html {
    font-size: 12px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f5f5;
  color: #26473D;
  font-family: 'Recursive', monospace;
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Background */
.watercolor {
  background: url('../imgs/watercolor_large.webp') center no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

.brush {
  background: url('../imgs/brush.webp') center no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

@media (max-width: 768px) {
  .watercolor,
  .brush {
    background-attachment: scroll;
  }
}

/* Main layout */
main {
  flex: 1;
  min-height: 80vh;
  padding: 1rem;
  padding-top: 3rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@media (min-width: 768px) {
  main {
    padding: 5vh 15vw;
    padding-top: 4rem;
  }
}

/* Textbox - RSVP section style */
.textbox {
  min-height: 50vh;
  max-width: 60vw;
  background: rgba(252, 251, 244, .6);
  border-radius: calc(16px * var(--brm));
  corner-shape: squircle;
  padding: 2rem 3rem;
  text-align: center;
}

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

@media (max-width: 768px) {
  .textbox {
    max-width: 95vw;
    padding: 1.5rem;
  }
}

/* Typography */
h1, h2, h3, h4 {
  color: #26473D;
  font-family: 'Recursive', monospace;
  font-weight: 400;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
}

p {
  margin-bottom: 0.5rem;
  margin-top: 0.3rem;
  line-height: 1.6;
}

a {
  color: #26473D;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.fancy {
  font-family: 'Benedict', cursive;
}

/* Index page animations */
.textbox > h1 {
  opacity: 0;
  transform: translateY(-20px);
  animation: revealDown 0.5s ease-out forwards;
  animation-delay: 0.15s;
}

.textbox > p.fancy {
  opacity: 0;
  transform: translateY(-15px);
  animation: revealDown 0.4s ease-out forwards;
  animation-delay: 0.25s;
}

.content.fancy {
  font-size: 2rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .content.fancy {
    font-size: 1.8rem;
  }
}

/* Card list */
.card-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.card-list li {
  margin: 1rem 0;
  opacity: 0;
  transform: translateY(-15px);
  animation: revealDown 0.4s ease-out forwards;
}

.card-list li:nth-child(1) { animation-delay: 0.2s; }
.card-list li:nth-child(2) { animation-delay: 0.3s; }
.card-list li:nth-child(3) { animation-delay: 0.4s; }
.card-list li:nth-child(4) { animation-delay: 0.5s; }
.card-list li:nth-child(5) { animation-delay: 0.6s; }
.card-list li:nth-child(n+6) { animation-delay: 0.7s; }

.card-list a {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: rgba(38, 71, 61, 0.1);
  border-radius: calc(8px * var(--brm));
  corner-shape: squircle;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.card-list a:hover {
  background: rgba(38, 71, 61, 0.2);
  transform: scale(1.02);
}

.card-list a .spinner {
  display: none;
  width: 1em;
  height: 1em;
  margin-right: 0.5rem;
  border: 2px solid rgba(38, 71, 61, 0.3);
  border-top-color: #26473D;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.card-list a.loading .spinner {
  display: inline-block;
}

.card-list a.loading {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
footer {
  background: rgba(252, 251, 244, .6);
  padding: 1.5rem 2rem;
  text-align: center;
  color: #26473D;
  font-size: 1rem;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Images */
img {
  border-radius: calc(16px * var(--brm));
  corner-shape: squircle;
  max-width: 100%;
  height: auto;
}

/* Article layout */
article h1 {
  opacity: 0;
  transform: translateY(-20px);
  animation: revealDown 0.5s ease-out forwards;
  animation-delay: 0.2s;
}

.card-content {
  overflow: hidden;
}

.card-content img {
  display: block;
  object-fit: cover;
  max-height: 60vh;
  max-width: 100%;
  margin: 0 auto 1rem;
  opacity: 0;
  transform: translateY(-20px);
  animation: revealDown 0.5s ease-out forwards;
  animation-delay: 0.35s;
}

@media (min-width: 768px) {
  .card-content img {
    float: left;
    max-width: 60%;
    margin: 0 1.5rem 1rem 0;
  }
}

.card-text {
  font-family: 'Benedict', cursive;
  font-size: 1.5rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-20px);
  animation: revealDown 0.5s ease-out forwards;
  animation-delay: 0.5s;
}

.card-text p {
  margin: 0.5rem 0;
}


/* Progress bar */
.progress-container {
  position: fixed;
  top: 0.5rem;
  left: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .progress-container {
    left: 15vw;
    right: 15vw;
  }
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(38, 71, 61, 0.15);
  color: #26473D;
  border-radius: calc(6px * var(--brm));
  corner-shape: squircle;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  transition: background 0.2s;
  flex-shrink: 0;
}

.nav-btn:hover:not(.disabled) {
  background: rgba(38, 71, 61, 0.3);
}

.nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.progress-bar {
  flex: 1;
  height: 12px;
  background: rgba(38, 71, 61, 0.15);
  border-radius: calc(6px * var(--brm));
  corner-shape: squircle;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: rgba(38, 71, 61, 0.6);
  border-radius: calc(6px * var(--brm));
  corner-shape: squircle;
}

.debug-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.debug-counter {
  font-size: 0.8rem;
  color: #26473D;
}

.debug-clear-btn {
  padding: 0.2rem 0.5rem;
  background: rgba(38, 71, 61, 0.6);
  color: #fff;
  border: none;
  border-radius: calc(4px * var(--brm));
  corner-shape: squircle;
  cursor: pointer;
  font-size: 0.8rem;
}
