/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  width: 100%;
}

/* CSS Variables */
:root {
  --bg: #F9F7F2;
  --text-primary: #2D2A26;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --text-light: #e4e4e7;
  --blue: #2563EB;
  --border-light: #e4e4e7;
  --card-bg: #ffffff;
  --input-bg: #fafafa;
  --placeholder-color: #71717a;
}

/* Layout & Flexbox */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1 1 0%;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

.gap-10 {
  gap: 2.5rem;
}

.gap-16 {
  gap: 4rem;
}

.gap-20 {
  gap: 5rem;
}

.space-x-10>*+* {
  margin-left: 2.5rem;
}

.space-x-12>*+* {
  margin-left: 3rem;
}

.space-y-5>*+* {
  margin-top: 1.25rem;
}

.space-y-6>*+* {
  margin-top: 1.5rem;
}

.space-y-8>*+* {
  margin-top: 2rem;
}

.space-y-10>*+* {
  margin-top: 2.5rem;
}

/* Grid */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.lg\:grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lg\:grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.lg\:col-span-4 {
  grid-column: span 4 / span 4;
}

.lg\:col-span-8 {
  grid-column: span 8 / span 8;
}

/* Display & Visibility */
.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.lg\:flex {
  display: flex;
}

.lg\:block {
  display: block;
}

/* Sizing */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.h-auto {
  height: auto;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-\[440px\] {
  max-width: 440px;
}

/* Typography */
.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-5xl {
  font-size: 3rem;
}

.text-6xl {
  font-size: 3.75rem;
}

.text-7xl {
  font-size: 4.5rem;
}

.text-9xl {
  font-size: 8rem;
}

.text-\[10px\] {
  font-size: 10px;
}

.text-\[3.2rem\] {
  font-size: 3.2rem;
}

.font-light {
  font-weight: 300;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.italic {
  font-style: italic;
}

.tracking-tighter {
  letter-spacing: -0.05em;
}

.tracking-widest {
  letter-spacing: 0.1em;
}

.tracking-\[0.3em\] {
  letter-spacing: 0.3em;
}

.tracking-\[0.2em\] {
  letter-spacing: 0.2em;
}

.leading-\[0.9\] {
  line-height: 0.9;
}

.leading-\[0.95\] {
  line-height: 0.95;
}

.leading-snug {
  line-height: 1.375;
}

.leading-relaxed {
  line-height: 1.625;
}

.leading-tight {
  line-height: 1.25;
}

.text-zinc-400 {
  color: #a1a1aa;
}

.text-zinc-500 {
  color: #71717a;
}

.text-zinc-800 {
  color: #27272a;
}

.text-zinc-900 {
  color: #18181b;
}

.text-blue-600 {
  color: #2563eb;
}

.text-white {
  color: #fff;
}

.text-\[10px\] {
  font-size: 10px;
}

.uppercase {
  text-transform: uppercase;
}

/* Colors & Backgrounds */
.bg-zinc-900 {
  background-color: #18181b;
}

.bg-zinc-50 {
  background-color: #fafafa;
}

.bg-white {
  background-color: #fff;
}

.border {
  border: 1px solid current;
}

.border-t {
  border-top: 1px solid current;
}

.border-zinc-100 {
  border-color: #f4f4f5;
}

.border-zinc-200 {
  border-color: #e4e4e7;
}

.border-blue-600 {
  border-color: #2563eb;
}

.border-zinc-200 {
  border-color: #e4e4e7;
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.drop-shadow-2xl {
  filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
}

/* Spacing */
.p-3 {
  padding: 0.75rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-5 {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.p-8 {
  padding: 2rem;
}

.p-24 {
  padding: 6rem;
}

.px-8 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.px-12 {
  padding-left: 3rem;
  padding-right: 3rem;
}

.py-5 {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-16 {
  margin-bottom: 4rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.pt-2 {
  padding-top: 0.5rem;
}

.pt-6 {
  padding-top: 1.5rem;
}

.pb-32 {
  padding-bottom: 8rem;
}

/* Borders & Radius */
.rounded-full {
  border-radius: 9999px;
}

.rounded-2xl {
  border-radius: 1rem;
}

.rounded-\[3rem\] {
  border-radius: 3rem;
}

.rounded-\[2.5rem\] {
  border-radius: 2.5rem;
}

/* Transitions & Transforms */
.transition {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-700 {
  transition-duration: 700ms;
}

.ease {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.hover\:bg-blue-600:hover {
  background-color: #2563eb;
}

.hover\:bg-zinc-900:hover {
  background-color: #18181b;
}

.hover\:text-blue-600:hover {
  color: #2563eb;
}

.hover\:text-white:hover {
  color: #fff;
}

.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

.group:hover .group-hover\:text-blue-600 {
  color: #2563eb;
}

.focus\:border-blue-600:focus {
  border-color: #2563eb;
}

.decoration-blue-600 {
  text-decoration-color: #2563eb;
}

/* Positioning */
.top-\[5%\] {
  top: 5%;
}

.left-\[-12%\] {
  left: -12%;
}

.bottom-\[20%\] {
  bottom: 20%;
}

.left-\[-15%\] {
  left: -15%;
}

.z-10 {
  z-index: 10;
}

.z-20 {
  z-index: 20;
}

/* Sticker specific tweaks */
.sticker {
  white-space: nowrap;
  display: inline-block;
}

/* Media Queries */
@media (max-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1024px) {
  .lg\:hidden {
    display: none;
  }

  .lg\:flex {
    display: flex !important;
  }

  .lg\:text-3xl {
    font-size: 1.875rem;
  }

  .lg\:text-6xl {
    font-size: 3.75rem;
  }

  .lg\:text-7xl {
    font-size: 4.5rem;
  }

  .lg\:text-9xl {
    font-size: 8rem;
  }

  .lg\:p-24 {
    padding: 6rem;
  }

  .lg\:flex-row {
    flex-direction: row;
  }

  .lg\:justify-end {
    justify-content: flex-end;
  }

  .lg\:pt-6 {
    padding-top: 1.5rem;
  }
}

/* Misc */
.underline {
  text-decoration-line: underline;
}

.underline-offset-8 {
  text-underline-offset: 2rem;
}

.pointer-events-none {
  pointer-events: none;
}

.resize-none {
  resize: none;
}

.outline-none {
  outline: none;
}

.overflow-hidden {
  overflow: hidden;
}

.cursor-pointer {
  cursor: pointer;
}

.will-change-transform {
  will-change: transform;
}

.object-contain {
  object-fit: contain;
}

.object-cover {
  object-fit: cover;
}

/* ===== SHARED COMPONENT STYLES ===== */

.font-serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

body {
  background-color: var(--bg);
  overflow: hidden;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(249, 247, 242, 0.9);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

#root-scaler {
  width: 111.11%;
  height: 111.11%;
  transform: scale(0.9);
  transform-origin: top left;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

#app-content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: -2rem;
}

.loaded #app-content {
  opacity: 1;
}

.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  pointer-events: none;
  opacity: 0.02;
  background-image:
    repeating-linear-gradient(45deg,
      transparent,
      transparent 1px,
      rgba(0, 0, 0, .02) 1px,
      rgba(0, 0, 0, .02) 2px);
}

section {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 8%;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.container-max {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

#hero {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#about {
  padding-top: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

#about .container-max {
  width: 100%;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4rem !important;
  align-items: center;
}

#projects {
  display: block !important;
  padding: 10rem 8% 10rem 8%;
  height: auto !important;
}

#store {
  display: block !important;
  padding: 8rem 8% 10rem 8%;
  height: auto !important;
  margin-top: 0;
}

#store h2 {
  margin-bottom: 3rem;
  font-size: 3.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

@media (max-width: 1024px) {
  #store h2 {
    font-size: 2.25rem;
  }
}

/* Enhanced Product Card Styling */
.project-card {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
}

/* Product name keeps serif font */
.project-card h4 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* Store page card improvements */
#store .project-card {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

#store .project-card:hover {
  transform: translateY(-12px);
}

#store .project-card a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
}

#store .project-card .img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eceae6;
  border-radius: 2.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

#store .project-card h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 !important;
  color: var(--text-primary);
  line-height: 1.4;
}

#store .project-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0 0 !important;
  line-height: 1.5;
  flex-grow: 1;
}

#store .project-card button {
  width: auto;
  background-color: transparent;
  color: #71717a;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

#store .project-card button:hover {
  color: #2563eb;
}

#project-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 3rem;
}

@media (min-width: 768px) {
  #project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #project-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
  }

  #hero {
    padding-top: 8rem;
  }
}

#category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

.category-btn {
  padding: 0;
  border: none;
  background-color: transparent;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  position: relative;
  padding-bottom: 0.25rem;
}

.category-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blue);
  transition: width 0.3s ease;
}

.category-btn:hover {
  color: var(--text-primary);
}

.category-btn:hover::after {
  width: 100%;
}

.category-btn.active {
  color: var(--text-primary);
}

.category-btn.active::after {
  width: 100%;
}

.project-card {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-12px);
}

.project-card a {
  text-decoration: none;
  color: inherit;
}

.nav-link {
  transition: all 0.3s ease;
  color: #a1a1aa;
  position: relative;
}

.nav-link:hover {
  color: #2D2A26;
}

.nav-link.active {
  color: var(--blue) !important;
  font-weight: 600;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blue);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

.form-message {
  padding: 1rem;
  border-radius: 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: none;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.form-message.show {
  display: block;
}

.form-message.success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-message.error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.form-fieldgroup {
  position: relative;
}

.form-fieldgroup.invalid input,
.form-fieldgroup.invalid textarea {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

.form-error {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

.form-fieldgroup.invalid .form-error {
  display: block;
}

.form-button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.sticker {
  position: absolute;
  font-size: 3.2rem;
  pointer-events: none;
  z-index: 20;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eceae6;
  border-radius: 2.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.project-card h4 {
  margin-top: 0 !important;
}

#contact .bg-white {
  background-color: var(--card-bg);
  border-color: var(--border-light);
}

#contact h2 {
  color: var(--text-primary);
}

#contact .text-zinc-400 {
  color: var(--text-secondary);
}

#contact a {
  color: var(--text-primary);
}

input,
textarea {
  background-color: var(--input-bg);
  color: var(--text-primary);
  border-color: var(--border-light);
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder-color);
}

input:focus,
textarea:focus {
  border-color: var(--blue);
}

.form-fieldgroup.invalid input,
.form-fieldgroup.invalid textarea {
  border-color: #dc2626 !important;
  background-color: #3d1f1f !important;
  color: #fca5a5;
}

@media (max-width: 1024px) {
  #root-scaler {
    transform: none;
    width: 100%;
    height: 100%;
    scroll-snap-type: none;
  }

  #app-content {
    margin-top: 0;
  }

  header {
    padding: 1.5rem 5%;
    background: var(--bg);
    position: absolute;
  }

  .noise,
  .sticker,
  nav {
    display: none !important;
  }

  section {
    padding-top: 0 !important;
  }

  #about .container-max {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

@media (max-width: 768px) {
  .w-96 {
    width: 24rem;
  }
}

/* Cart Drawer Styles */
#cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#cart-drawer:not(.hidden) {
  display: block;
  opacity: 1;
}

#cart-drawer.hidden {
  display: none;
  opacity: 0;
}

#cart-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  background-color: var(--card-bg);
  z-index: 1001;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#cart-panel:not(.translate-x-full) {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

#cart-panel.translate-x-full {
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

#cart-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#cart-items {
  overflow-y: auto;
  min-height: 120px;
}

#cart-items p {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
  font-size: 0.875rem;
}

#cart-items > div {
  display: block;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border-light);
  transition: opacity 0.2s ease;
}

#cart-items > div:last-child {
  border-bottom: none;
}

#cart-items img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

#cart-items h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

#cart-items p {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

#cart-items .flex {
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

#cart-items button {
  padding: 0.375rem 0.625rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

#cart-items button:hover {
  background-color: transparent;
  border-color: #a1a1aa;
  color: var(--text-primary);
}

#cart-items .text-red-600 {
  color: #71717a;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.75rem;
}

#cart-items .text-red-600:hover {
  color: var(--text-primary);
}

#cart-panel > div:last-child {
  border-top: 1px solid var(--border-light);
  padding: 1.5rem;
  background: transparent;
  margin-top: auto;
}

#cart-panel .flex.justify-between {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

#cart-total {
  color: var(--text-primary);
  font-family: 'Playfair Display', serif;
  font-size: 0.875rem;
}

/* Checkout button */
#cart-panel a {
  display: block;
  width: 100%;
  background-color: var(--text-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 9999px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

#cart-panel a:hover {
  background-color: #3f3b37;
  transform: none;
}