@font-face {
  font-family: 'Chalkboard';
  src: url('/z8Kp2Lm9Qx7AG5MQ9/z8Kp2Lm9Qx7AG5MQ9-font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Nord Color Palette */
  --nord0: #2e3440; /* Polar Night 1 */
  --nord1: #3b4252; /* Polar Night 2 */
  --nord2: #434c5e; /* Polar Night 3 */
  --nord3: #4c566a; /* Polar Night 4 */
  
  --nord4: #d8dee9; /* Snow Storm 1 */
  --nord5: #e5e9f0; /* Snow Storm 2 */
  --nord6: #eceff4; /* Snow Storm 3 */
  
  --nord7: #8fbcbb; /* Frost 1 - Teal Light */
  --nord8: #88c0d0; /* Frost 2 - Ice Blue */
  --nord9: #81a1c1; /* Frost 3 - Sky Blue */
  --nord10: #5e81ac; /* Frost 4 - Royal Blue */
  
  --nord11: #bf616a; /* Aurora 1 - Red */
  --nord12: #d08770; /* Aurora 2 - Orange */
  --nord13: #ebcb8b; /* Aurora 3 - Yellow */
  --nord14: #a3be8c; /* Aurora 4 - Green */
  --nord15: #b48ead; /* Aurora 5 - Purple */
  
  /* Background Sampled from Image */
  --bg-sampled: #473b49;
  --bg-sampled-dark: #322833;
}

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

body {
  background-color: var(--bg-sampled);
  /* CSS radial and linear gradients to simulate a chalkboard texture */
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.02) 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 3px, transparent 3px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
  background-size: 40px 40px, 60px 60px, 120px 120px, 100% 100%;
  font-family: 'Chalkboard', 'Comic Sans MS', cursive, system-ui, sans-serif;
  color: var(--nord6);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.back-nav-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.48rem 0.78rem;
  background-color: rgba(69, 57, 71, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 12px 22px 10px 18px / 18px 10px 16px 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  color: var(--nord6);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.back-nav-btn:hover {
  transform: translate(-2px, -2px);
  background-color: var(--nord8);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.34);
  color: var(--nord0);
}

.back-nav-btn:focus-visible {
  outline: 3px solid var(--nord13);
  outline-offset: 3px;
}

/* Linktree Container Card */
.container {
  width: 100%;
  max-width: 480px;
  background-color: rgba(69, 57, 71, 0.85); /* Semitransparent matching sampled background */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px 30px 15px 40px / 30px 15px 40px 20px; /* Sketchy vector-sharp wobbly borders */
  padding: 2.5rem 1.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
              8px 8px 0px var(--bg-sampled-dark);
  position: relative;
  transition: transform 0.3s ease;
}

/* Card Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-container {
  width: 120px;
  height: 120px;
  border-radius: 48% 52% 47% 53% / 51% 49% 52% 48%; /* Hand-sketched circle look */
  border: 3px solid var(--nord6);
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3),
              3px 3px 0px rgba(0, 0, 0, 0.15);
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.05) rotate(3deg);
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title {
  font-size: 2.25rem;
  font-weight: bold;
  color: var(--nord6);
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.description {
  font-size: 1.1rem;
  color: var(--nord4);
  max-width: 90%;
  line-height: 1.4;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

/* Link Items List */
.links-list {
  display: flex;
  flex-direction: column;
}

/* Wobbly Hand-drawn Link Button */
.link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 12px 28px 10px 22px / 20px 12px 24px 14px; /* Vector-sharp wobbly borders */
  color: var(--nord6);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.25);
  outline: none;
}

.link-btn:last-child {
  margin-bottom: 0;
}

.link-btn-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.link-btn-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  transition: transform 0.25s ease;
}

.link-btn-arrow {
  font-size: 1rem;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.panic-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  opacity: 0.95;
}

.panic-rays-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.panic-siren-img {
  transform: scale(1.25);
}

/* Hover Accent Configurations (Nord System Colors) */
.link-btn:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.35);
  border-color: var(--nord6);
}

.link-btn:hover .link-btn-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.link-btn:hover .link-btn-icon {
  transform: scale(1.15) rotate(-5deg);
}

.link-blockers:hover {
  background-color: var(--nord8);
  color: var(--nord0);
}

.link-community:hover {
  background-color: var(--nord14);
  color: var(--nord0);
}

.link-education:hover {
  background-color: var(--nord9);
  color: var(--nord0);
}

.link-productivity:hover {
  background-color: var(--nord15);
  color: var(--nord0);
}

/* Panic Trigger Button (Nord Red) */
.link-panic {
  background-color: rgba(191, 97, 106, 0.1);
  border-color: var(--nord11);
  color: var(--nord11);
  margin-top: 1rem;
}

.link-panic:hover {
  background-color: var(--nord11);
  color: var(--nord6);
  border-color: var(--nord6);
}

.link-panic.panic-rattle {
  animation: panic-rattle 0.34s ease-in-out both;
}

@keyframes panic-rattle {
  0% { transform: translate(-3px, -3px) rotate(0deg); }
  18% { transform: translate(-5px, -3px) rotate(-0.7deg); }
  36% { transform: translate(-1px, -4px) rotate(0.8deg); }
  54% { transform: translate(-4px, -2px) rotate(-0.5deg); }
  72% { transform: translate(-2px, -4px) rotate(0.4deg); }
  100% { transform: translate(-3px, -3px) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .link-panic.panic-rattle {
    animation: none;
  }
}

/* Floating Utilities */
.share-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.share-btn {
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  color: var(--nord4);
  font-family: 'Chalkboard', sans-serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.share-btn:hover {
  border-color: var(--nord6);
  color: var(--nord6);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Panic Breathing Modal / Overlay */
.panic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(46, 52, 64, 0.97); /* Nord0 Polar Night */
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 2rem;
  text-align: center;
}

.panic-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.panic-title {
  font-size: 2.5rem;
  color: var(--nord11); /* Red */
  margin-bottom: 1rem;
}

.panic-subtitle {
  font-size: 1.25rem;
  color: var(--nord4);
  margin-bottom: 3rem;
  max-width: 400px;
}

/* Breathing Circle Indicator */
.breathing-ring-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
}

.breathing-circle {
  width: 140px;
  height: 140px;
  border-radius: 49% 51% 48% 52% / 52% 48% 51% 49%; /* Wobbly vector circle */
  background-color: var(--nord9); /* Sky Blue */
  opacity: 0.85;
  box-shadow: 0 0 40px rgba(129, 161, 193, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 4s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.breathing-circle.inhale {
  transform: scale(1.6);
  background-color: var(--nord7); /* Teal */
  box-shadow: 0 0 60px rgba(143, 188, 187, 0.6);
}

.breathing-circle.exhale {
  transform: scale(0.9);
  background-color: var(--nord10); /* Royal Blue */
  box-shadow: 0 0 30px rgba(94, 129, 172, 0.3);
}

.breathing-instruction {
  font-size: 1.5rem;
  color: var(--nord0);
  font-weight: bold;
}

/* Panic Exit Button */
.panic-exit {
  background: none;
  border: 2px solid var(--nord4);
  border-radius: 10px 22px 8px 18px / 18px 10px 16px 12px; /* Wobbly vector borders */
  color: var(--nord4);
  font-family: 'Chalkboard', sans-serif;
  font-size: 1.1rem;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panic-exit:hover {
  background-color: var(--nord4);
  color: var(--nord0);
  border-color: var(--nord6);
}

/* Footer styling */
.footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--nord3);
  text-align: center;
}

/* Responsive Overrides */
@media (max-width: 480px) {
  body {
    padding: 4.6rem 0.5rem 1rem;
  }
  .back-nav-btn {
    top: 0.8rem;
    left: 0.8rem;
  }
  .container {
    padding: 1.75rem 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 
                5px 5px 0px var(--bg-sampled-dark);
  }
  .title {
    font-size: 1.85rem;
  }
  .link-btn {
    font-size: 1.1rem;
    padding: 1rem 1.1rem;
  }
}

/* App Wrapper for Side-by-Side Desktop Layout */
.app-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  max-width: 1040px;
  width: 100%;
  transition: all 0.3s ease;
}

/* Side Preview Card Container */
.preview-container {
  flex: 0 1 480px;
  width: 100%;
  max-width: 480px;
  align-self: flex-start;
  background-color: rgba(69, 57, 71, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px 15px 40px 20px / 15px 40px 20px 30px; /* Hand-sketched preview wobbly borders */
  padding: 2.5rem 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
              8px 8px 0px var(--bg-sampled-dark);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.3s ease;
}

/* Squirrel & Image Icons */
.link-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: middle;
}

/* Placeholder Styling */
.preview-card-placeholder {
  text-align: center;
  color: var(--nord4);
}

.placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: bounce-gentle 2.5s ease-in-out infinite;
}

@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.preview-card-placeholder h3 {
  font-size: 1.6rem;
  color: var(--nord6);
  margin-bottom: 0.75rem;
}

.preview-card-placeholder p {
  font-size: 1.05rem;
  line-height: 1.5;
}

/* Active Content Layout */
.preview-card-content {
  animation: fade-in 0.4s ease;
}

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

#preview-title {
  font-size: 1.85rem;
  color: var(--nord6);
  margin-bottom: 1rem;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

#preview-desc {
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  line-height: 1.5;
  color: var(--nord4);
  margin-bottom: 1.5rem;
}

.preview-features-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--nord5);
  margin-bottom: 0.75rem;
}

#preview-features {
  list-style-type: none;
}

#preview-features li {
  font-size: clamp(0.82rem, 1.25vw, 1.05rem);
  color: var(--nord6);
  margin-bottom: 0.6rem;
  padding-left: 1.5rem;
  position: relative;
  overflow-wrap: anywhere;
}

#preview-features li::before {
  content: '★';
  position: absolute;
  left: 0;
  color: var(--nord13); /* Yellow star indicator */
}

.preview-reading-title {
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  font-weight: bold;
  color: var(--nord5);
  margin: 1.25rem 0 0.6rem;
}

.preview-reading-list {
  list-style-type: none;
}

.preview-reading-list li {
  margin-bottom: 0.55rem;
  padding-left: 1.25rem;
  position: relative;
}

.preview-reading-list li::before {
  content: '↗';
  position: absolute;
  left: 0;
  color: var(--nord8);
}

.preview-reading-list a {
  color: var(--nord4);
  font-size: clamp(12px, 1.05vw, 14px);
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px dashed rgba(216, 222, 233, 0.35);
  overflow-wrap: anywhere;
}

.preview-reading-list a:hover {
  color: var(--nord6);
  border-bottom-color: var(--nord6);
}

/* Responsive Grid/Flex Stacking */
@media (max-width: 1060px) {
  .app-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .preview-container {
    width: 100%;
    max-width: 480px;
    align-self: center;
    margin-inline: auto;
    min-height: auto;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 
                5px 5px 0px var(--bg-sampled-dark);
  }
}

@media (max-width: 480px) {
  .preview-container {
    padding: 1.6rem 1rem;
  }

  #preview-title {
    font-size: 1.5rem;
  }

  #preview-desc {
    margin-bottom: 1rem;
  }

  #preview-features li,
  .preview-reading-list li {
    margin-bottom: 0.45rem;
  }
}
