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

:root {
  /* Boitano-inspired colors */
  --pink: #ffd4eb;
  --dark: #161515;
  --light: #fff;
  --accent-pink: #ffb3d9;
}

body {
  font-family: 'BoitanoFont', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  font-size: 24px;
  line-height: 1.6;
  background: var(--pink);
  color: var(--dark);
}

main {
  width: 100%;
}

/* Logo */
.logo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  z-index: 1001;
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 0.7;
}

/* Navigation arrows */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 21, 21, 0.2);
  color: var(--dark);
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.nav-arrow:hover {
  background: rgba(22, 21, 21, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.nav-prev {
  left: 2rem;
}

.nav-next {
  right: 2rem;
}

.slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 3rem;
  background: var(--pink);
  color: var(--dark);
  animation: slide-in-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}

.slide h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.slide h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.slide p {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  max-width: 800px;
}

.li-button-style {
  color: var(--dark);
  text-decoration: none;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: absolute;
  bottom: 3rem;
}

.li-button-style::before {
  content: "↳";
  position: absolute;
  left: 0;
  color: var(--dark);
  font-weight: bold;
}

.slide ul {
  list-style: none;
  font-size: 1.5rem;
  max-width: 800px;
}

.slide ul li {
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
}

.slide ul li::before {
  content: "↳";
  position: absolute;
  left: 0;
  color: var(--dark);
  font-weight: bold;
}

/* Fun slide animations - pure CSS on page load */
@keyframes slide-in-bounce {
  0% {
    transform: translateY(50px) scale(0.95) rotate(2deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Stagger animation for list items */
.slide ul li {
  opacity: 0;
  animation: fade-in-up 0.5s ease-out forwards;
}

.slide ul li:nth-child(1) { animation-delay: 0.1s; }
.slide ul li:nth-child(2) { animation-delay: 0.2s; }
.slide ul li:nth-child(3) { animation-delay: 0.3s; }
.slide ul li:nth-child(4) { animation-delay: 0.4s; }
.slide ul li:nth-child(5) { animation-delay: 0.5s; }
.slide ul li:nth-child(6) { animation-delay: 0.6s; }
.slide ul li:nth-child(7) { animation-delay: 0.7s; }
.slide ul li:nth-child(8) { animation-delay: 0.8s; }

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animate heading */
.slide h1 {
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes pop-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Custom Prism theme overrides for pink background */
pre[class*="language-"] {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid rgba(22, 21, 21, 0.08);
  box-shadow: 0 2px 8px rgba(22, 21, 21, 0.05);
}

code[class*="language-"] {
  color: #161515;
  text-shadow: none;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #d73a49;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #005cc5;
}

.token.punctuation {
  color: #24292e;
}

.token.function,
.token.class-name {
  color: #6f42c1;
}

.token.atrule,
.token.keyword {
  color: #d73a49;
}

/* Keyboard navigation hint */
@media (hover: hover) {
  .nav-arrow::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-radius: 50%;
    transition: border-color 0.3s;
  }

  .nav-arrow:focus-visible::after {
    border-color: white;
  }
}

/* Dialog styles */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  border-radius: 16px;
  padding: 3rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(22, 21, 21, 0.4);
  background: white;
  text-align: center;
}

dialog::backdrop {
  background: rgba(22, 21, 21, 0.6);
  backdrop-filter: blur(8px);
}

dialog h2 {
  margin: 0 0 1.5rem 0;
  font-size: 2.2rem;
  color: var(--dark);
  font-weight: 700;
}

dialog p {
  margin: 0 0 2rem 0;
  color: var(--dark);
  line-height: 1.8;
  font-size: 1.1rem;
}

/* Spinner animation (slide 3) */
.spinner {
  width: 80px;
  height: 80px;
  border: 8px solid rgba(22, 21, 21, 0.1);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-top: 2rem;
}

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

/* Carousel styles (slide 11) */
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  width: 100%;
  max-width: 700px;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--dark) transparent;
}

.carousel::-webkit-scrollbar {
  height: 8px;
}

.carousel::-webkit-scrollbar-track {
  background: rgba(22, 21, 21, 0.1);
  border-radius: 4px;
}

.carousel::-webkit-scrollbar-thumb {
  background: var(--dark);
  border-radius: 4px;
}

.carousel-item {
  scroll-snap-align: center;
  flex: 0 0 600px;
  height: 250px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Button styles (slide 12) */
.open-dialog-btn {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--dark);
  color: var(--pink);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'BoitanoFont', sans-serif;
}

.open-dialog-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 21, 21, 0.3);
}

.open-dialog-btn:active {
  transform: translateY(0);
}

.close-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'BoitanoFont', sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
}

.close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 21, 21, 0.3);
}

.close-btn:active {
  transform: translateY(0);
}

/* Comparison grid (slide 12) */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
}

.comparison-item {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.comparison-item h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--dark);
}

.comparison-item p {
  margin: 0 0 1.5rem 0;
  color: var(--dark);
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Accordion styles (slide 13) */
.accordion-demo {
  width: 100%;
  max-width: 700px;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.accordion-demo details {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(22, 21, 21, 0.1);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s;
}

.accordion-demo details[open] {
  border-color: var(--dark);
}

.accordion-demo summary {
  cursor: pointer;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dark);
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}

.accordion-demo summary::-webkit-details-marker {
  display: none;
}

.accordion-demo summary::before {
  content: "→";
  display: inline-block;
  margin-right: 0.75rem;
  transition: transform 0.3s;
  font-size: 1.2rem;
}

.accordion-demo details[open] summary::before {
  transform: rotate(90deg);
}

.accordion-demo summary:hover {
  background: rgba(22, 21, 21, 0.05);
}

.accordion-demo details p {
  padding: 0 1.5rem 1.5rem 3.25rem;
  margin: 0;
  color: var(--dark);
  line-height: 1.6;
  animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Anchor positioning styles (slide 14) */
.anchor-intro {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.anchor-demo {
  display: flex;
  gap: 3rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  min-height: 200px;
}

/* Dropdown menu anchor positioning */
#menu-trigger {
  anchor-name: --menu;
}

.dropdown-trigger {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'BoitanoFont', sans-serif;
  transition: transform 0.2s;
}

.dropdown-trigger:hover {
  transform: translateY(-2px);
}

.dropdown-trigger:hover + .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dropdown-menu {
  position: fixed;
  position-anchor: --menu;
  top: anchor(bottom);
  left: anchor(left);
  margin-top: 8px;

  background: white;
  border: 2px solid var(--dark);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(22, 21, 21, 0.2);

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 100;
}

.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-item {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--dark);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
}

.menu-item:hover {
  background: rgba(22, 21, 21, 0.05);
}

.menu-divider {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid rgba(22, 21, 21, 0.1);
}

/* Popover global styles (used in slide 12) */
[popover] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: white;
  border: 2px solid var(--dark);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(22, 21, 21, 0.3);
  max-width: 400px;
  text-align: center;
}

[popover]::backdrop {
  background: rgba(22, 21, 21, 0.5);
  backdrop-filter: blur(4px);
}

[popover] h3 {
  margin: 0 0 1rem 0;
  color: var(--dark);
  font-size: 1.5rem;
}

[popover] p {
  margin: 0 0 1rem 0;
  color: var(--dark);
  line-height: 1.6;
}

/* Form validation styles (slide 15) */
.validation-demo {
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid rgba(22, 21, 21, 0.2);
  border-radius: 6px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--dark);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #d73a49;
}

.form-group input:valid:not(:placeholder-shown) {
  border-color: #28a745;
}

.error-msg {
  display: none;
  color: #d73a49;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-group input:invalid:not(:placeholder-shown) ~ .error-msg {
  display: block;
}

.validation-demo button[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'BoitanoFont', sans-serif;
  transition: transform 0.2s;
}

.validation-demo button[type="submit"]:hover {
  transform: translateY(-2px);
}

/* Tabs styles (slide 16) */
.tabs-demo {
  width: 100%;
  max-width: 700px;
  margin-bottom: 2rem;
}

.tabs-demo input[type="radio"] {
  display: none;
}

.tab-labels {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0;
  border-bottom: 2px solid rgba(22, 21, 21, 0.1);
}

.tab-labels label {
  padding: 1rem 2rem;
  cursor: pointer;
  font-weight: 600;
  color: rgba(22, 21, 21, 0.6);
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  user-select: none;
}

.tab-labels label:hover {
  color: var(--dark);
  background: rgba(22, 21, 21, 0.05);
}

#tab1:checked ~ .tab-labels label[for="tab1"],
#tab2:checked ~ .tab-labels label[for="tab2"],
#tab3:checked ~ .tab-labels label[for="tab3"] {
  color: var(--dark);
  border-bottom-color: var(--dark);
}

.tab-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 0 0 12px 12px;
  min-height: 200px;
}

.tab-panel {
  display: none;
  animation: fade-in-up 0.4s ease-out;
}

#tab1:checked ~ .tab-content .tab-panel:nth-child(1),
#tab2:checked ~ .tab-content .tab-panel:nth-child(2),
#tab3:checked ~ .tab-content .tab-panel:nth-child(3) {
  display: block;
}

.tab-panel h3 {
  margin: 0 0 1rem 0;
  color: var(--dark);
  font-size: 1.8rem;
}

.tab-panel p {
  margin: 0;
  color: var(--dark);
  line-height: 1.6;
  font-size: 1.1rem;
}

/* JS needed slide (slide 17) */
.js-needed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 900px;
  margin-bottom: 2rem;
}

.need-item {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid rgba(22, 21, 21, 0.1);
  transition: transform 0.2s, border-color 0.2s;
}

.need-item:hover {
  transform: translateY(-4px);
  border-color: var(--dark);
}

.need-item h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  color: var(--dark);
}

.need-item p {
  margin: 0;
  color: var(--dark);
  opacity: 0.8;
  font-size: 0.95rem;
}

.conclusion {
  font-size: 1.2rem;
  font-weight: 600;
  max-width: 700px;
  line-height: 1.6;
  color: var(--dark);
  margin: 0;
}

/* HTMX demo slide (slide 18) */
.htmx-intro {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.htmx-popover {
  max-width: 90vw !important;
  width: 1200px !important;
  height: 80vh !important;
  padding: 0 !important;
  overflow: hidden;
}

.close-btn-popover {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn-popover:hover {
  transform: scale(1.1);
}

.demo-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* Datastar demo slide (slide 19) */
.slide-datastar {
  padding: 2rem;
}

.slide-datastar h1 {
  margin-bottom: 2rem;
}

#bad-apple-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.apple-frame {
  background: #000;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid var(--dark);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.apple-frame pre {
  color: #fff;
  white-space: pre;
  overflow: hidden;
}
