/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  font-family: 'Fira Code', monospace;
  background-color: white;
  color: black;
  touch-action: pan-y;
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Header/Nav */
.header {
  padding: 1.25rem 1rem;
  border-bottom: 2px solid black;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: sticky;
  top: 0;
  z-index: 500;
}

.header-logo {
  height: 60px;
  width: auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid black;
  background: white;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Layout Utilities */
.section {
  padding: 2rem 1rem;
  border-bottom: 2px solid black;
}

.section-with-game {
  padding: 2rem 1rem;
  border-bottom: 2px solid black;
  position: relative;
}

/* Typography with better hierarchy */
.main-heading {
  font-size: 1.75rem;
  font-weight: bold;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.main-heading-flex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.main-heading-subtitle {
  font-size: 1.125rem;
  line-height: 1.4;
}
.section-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.text-large {
  font-size: 1rem;
  line-height: 1.6;
}

.text-neutral {
  color: #666;
  font-size: 0.875rem;
}

/* Lists with better spacing */
.section-intro {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.25rem;
  max-width: 38rem;
}

.feature-list {
  list-style: none;
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 42rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: black;
  font-weight: bold;
}


/* Links and Buttons with micro-interactions */
.link-violet {
  font-size: 1rem;
  text-decoration: underline;
  color: #6b46c1;
  transition: all 0.2s ease;
  display: inline-block;
}

.link-violet:hover {
  text-decoration: none;
  transform: translateX(3px);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #6b46c1;
  color: white;
  border: 2px solid #6b46c1;
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Fira Code', monospace;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-top: 40px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 rgba(107, 70, 193, 0.3);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(107, 70, 193, 0.3);
}

.cta-button-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.cta-button:hover .cta-button-icon {
  transform: rotate(15deg);
}

.contact-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Grid Layout with better cards */
.project-grid {
  display: grid;
  gap: 1.25rem;
}

.project-card {
  border: 2px solid black;
  padding: 1.5rem;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: black;
  display: block;
  background: white;
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #6b46c1;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.project-card:hover::before {
  transform: scaleY(1);
  transform-origin: top;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
  color: white;
  border-color: #6b46c1;
}

.project-card-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  transition: color 0.3s ease;
}

.project-card-desc {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.project-card:hover .project-card-desc {
  color: rgba(255, 255, 255, 0.9);
}

/* Game Area with better framing */
.game-intro {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.game-context {
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
  margin-bottom: 1.25rem;
}

.game-area {
  position: relative;
  height: 18rem;
  width: 100%;
  max-width: 50rem;
  margin-top: 1rem;
  border: 2px solid black;
  overflow: hidden;
  background-color: #fafafa;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.05);
}

.game-instruction {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.8rem;
  font-weight: bold;
  padding-right: 4rem;
  line-height: 1.3;
  user-select: none;
  -webkit-user-select: none;
}

.game-message {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
  max-width: 130px;
  text-align: right;
  line-height: 1.3;
}

/* Game Elements */
.box {
  width: 38px;
  height: 38px;
  background: black;
  position: absolute;
  cursor: grab;
  z-index: 100;
  touch-action: none;
  transition: background 0.2s ease;
}

.box:active {
  cursor: grabbing;
}

.box-position {
  top: 180px;
  left: 15px;
}

.slotFake,
.slotReal {
  font-size: 12px;
  font-weight: 700;
  position: absolute;
  -webkit-user-select: none;
  user-select: none;
  padding: 6px 10px;
  border: 2px dashed #999;
  background: #f5f5f5;
}

.decoy-slot-position {
  top: 120px;
  left: 200px;
}

.hiddenSlot {
  font-size: inherit;
  font-weight: 700;
  position: relative;
  display: inline;
  -webkit-user-select: none;
  user-select: none;
  padding: 0 0.25rem;
}

/* Modal with better UX */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  width: 100%;
  max-width: 32rem;
  position: relative;
  border: 2px solid black;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.1);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.5rem;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: black;
  transform: rotate(90deg);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-input,
.form-textarea {
  width: 100%;
  border: 2px solid #ddd;
  padding: 0.875rem;
  font-size: 0.95rem;
  font-family: 'Fira Code', monospace;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: black;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.05);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-submit {
  width: 100%;
  padding: 1rem 1.5rem;
  color: white;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #6b46c1;
  border: 2px solid #6b46c1;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Fira Code', monospace;
  position: relative;
  overflow: hidden;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 rgba(107, 70, 193, 0.3);
}

.form-submit:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(107, 70, 193, 0.3);
}

/* Footer */
.footer {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  border-top: 2px solid black;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive Design - Tablet */
@media (min-width: 640px) {
  .header {
    padding: 1.5rem 2rem;
  }
  
  .status-badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
  
  .section {
    padding: 3rem 2rem;
  }
  
  .section-with-game {
    padding: 3rem 2rem;
  }
  
  .main-heading {
    font-size: 2.25rem;
  }
  
  .main-heading-flex {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }
  
  .main-heading-subtitle {
    font-size: 1.375rem;
  }
  
  .main-heading-archive {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .text-large {
    font-size: 1.125rem;
  }
  
  .text-neutral {
    font-size: 1rem;
  }
  
  .feature-list {
    font-size: 1.125rem;
  }
  
  .link-violet {
    font-size: 1.25rem;
  }
  
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .project-card {
    padding: 2rem;
    font-size: 1.125rem;
  }
  
  .project-card-desc {
    font-size: 1rem;
  }
  
  .game-intro {
    font-size: 1.125rem;
  }
  
  .game-area {
    height: 22rem;
  }
  
  .game-instruction {
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    padding-right: 5rem;
  }
  
  .game-message {
    top: 1rem;
    right: 1rem;
    font-size: 0.875rem;
    max-width: none;
  }
  
  .box {
    width: 45px;
    height: 45px;
  }
  
  .slotFake,
  .slotReal {
    font-size: 16px;
    padding: 8px 12px;
  }
  
  .modal-content {
    padding: 2.5rem;
  }
  
  .contact-links {
    gap: 1.5rem;
  }
  
  .footer {
    padding: 2.5rem 2rem;
  }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
  .header {
    padding: 1.5rem 3rem;
  }
  
  .section {
    padding: 4rem 3rem;
  }
  
  .section-with-game {
    padding: 4rem 3rem;
  }
  
  .main-heading {
    font-size: 2.75rem;
  }
  
  .main-heading-subtitle {
    font-size: 1.625rem;
  }
  
  .main-heading-archive {
    font-size: 1.125rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .text-large {
    font-size: 1.25rem;
  }
  
  .text-neutral {
    font-size: 1.125rem;
  }
  
  .feature-list {
    font-size: 1.25rem;
  }
  
  .link-violet {
    font-size: 1.5rem;
  }
  
  .project-card {
    font-size: 1.25rem;
  }
  
  .game-intro {
    font-size: 1.25rem;
  }
  
  .game-area {
    height: 26rem;
  }
  
  .game-instruction {
    font-size: 1.125rem;
  }
  
  .slotFake,
  .slotReal {
    font-size: 18px;
  }
  
  .footer {
    padding: 3rem;
  }
}

/* First section specific padding */
.hero-section {
  padding: 2rem 1rem;
  border-bottom: 2px solid black;
  position: relative;
}

@media (min-width: 640px) {
  .hero-section {
    padding: 3rem 2rem;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    padding: 4rem 3rem;
  }
}
