:root {
  --blackboard: #2d4133;
  --chalk: rgba(255, 255, 255, 0.85);
  --paper: #fffef0;
  --ink: #1a1a1a;
  --tape-blue: rgba(100, 181, 246, 0.6);
  --tape-pink: rgba(240, 98, 146, 0.6);
  --tape-green: rgba(129, 199, 132, 0.6);
  --tape-amber: rgba(255, 183, 77, 0.6);
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle, #354a3b 0%, #1e2b22 100%);
  background-attachment: fixed;
  color: var(--chalk);
  margin: 0;
  padding: 2rem;
  line-height: 1.5;
  min-height: 100vh;
}

/* Chalk Texture Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('https://www.transparenttextures.com/patterns/chalkboard.png');
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-family: 'Lexend', sans-serif;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 10px rgba(255,255,255,0.2), 0 0 15px rgba(255,255,255,0.1);
  letter-spacing: 2px;
}

/* Search Bar - Chalk Pill */
#searchInput {
  width: 100%;
  max-width: 600px;
  padding: 1.2rem 2rem;
  font-family: 'Lexend', sans-serif;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 3px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  color: #fff;
  outline: none;
  backdrop-filter: blur(5px);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}

#searchInput:focus {
  border-style: solid;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
  transform: scale(1.02);
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 3rem;
  padding-top: 2rem;
}

/* Scrapbook Card */
.tax-card {
  background: var(--paper);
  color: var(--ink);
  padding: 2.5rem 2rem 2rem;
  border-radius: 2px; /* Square edges for paper feel */
  box-shadow: 5px 10px 30px rgba(0,0,0,0.4);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  /* Torn paper effect simulation */
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.tax-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 5px;
  background: linear-gradient(135deg, transparent 5px, var(--paper) 0) 0 5px,
              linear-gradient(-135deg, transparent 5px, var(--paper) 0) 0 5px;
  background-size: 10px 10px;
  transform: translateY(100%);
}

/* Washi Tape Effect */
.tax-card::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 120px;
  height: 35px;
  background: var(--tape-amber);
  opacity: 0.8;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  z-index: 2;
  border-left: 2px dotted rgba(0,0,0,0.1);
  border-right: 2px dotted rgba(0,0,0,0.1);
}

.tax-card:nth-child(even)::before {
  background: var(--tape-blue);
  transform: translateX(-50%) rotate(3deg);
}

.tax-card:nth-child(3n)::before {
  background: var(--tape-pink);
  transform: translateX(-50%) rotate(-1deg);
}

.tax-card:hover {
  transform: scale(1.03) rotate(0deg) !important;
  box-shadow: 10px 20px 40px rgba(0,0,0,0.5);
  z-index: 10;
}

.tax-card h2 {
  font-family: 'Lexend', sans-serif;
  font-size: 1.5rem;
  margin: 0;
  color: var(--ink);
  border-bottom: 2px solid rgba(0,0,0,0.05);
  padding-bottom: 0.5rem;
}

.tax-emoji {
  font-size: 2.5rem;
  position: absolute;
  top: 10px;
  right: 15px;
  opacity: 0.8;
}

.tax-label {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.4rem;
  display: block;
}

.tax-pill {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.1);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tax-risk {
  background: #fffafa;
  border: 1px dashed #ffcdd2;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #b71c1c;
  position: relative;
}

.tax-risk::before {
  content: "⚠️";
  margin-right: 5px;
}

/* Back Button */
.back-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  text-decoration: none;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  transition: 0.3s;
}

.back-btn:hover {
  background: #fff;
  color: var(--blackboard);
  box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

footer {
  margin-top: 5rem;
  padding: 3rem 1rem;
  text-align: center;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  opacity: 0.8;
  transition: 0.2s;
  border-bottom: 2px solid transparent;
}
.footer-email:hover {
  opacity: 1;
  border-bottom-color: var(--tape-green);
}

@media (max-width: 768px) {
  body { padding: 0.75rem; }
  h1 { font-size: 2rem; }
  header p { font-size: 0.95rem !important; }
  
  .back-btn { display: inline-block; margin-bottom: 2rem; font-size: 0.9rem; padding: 0.5rem 1rem; }
  
  .taxonomy-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .tax-card { padding: 2rem 1.5rem 1.5rem; }
  .tax-card h2 { font-size: 1.3rem; }
  .tax-emoji { font-size: 2rem; top: 5px; right: 10px; }
  
  footer { padding: 2rem 1rem; margin-top: 2rem; }
}
