@font-face {
  font-family: 'RaspyGiraffe';
  src: url('RgBubble-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg-color: rgb(178, 168, 205);
  --text-color: #2B0033;
  --button-color: #804200;
  --card-bg: #f5f1e8;
  --card-text: #2B0033;
  --font-family: 'Space Mono', monospace;
  --paper-texture: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  padding: 0;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--paper-texture);
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

/* Page Styles */
.page {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sketchbook Page Effect */
.page::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 10px),
              linear-gradient(to right, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 10px),
              linear-gradient(to left, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 10px);
  border-radius: 3px;
  z-index: -1;
}

/* Logo and Tagline */
.logo {
  width: min(80vw, 400px);
  height: auto;
  margin-bottom: 1rem;
}

.tagline {
  font-family: var(--font-family);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-color);
  margin-bottom: 2rem;
}

/* Welcome Text */
.welcome-text {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  max-width: 700px;
  margin: 2rem auto;
  line-height: 1.6;
  position: relative;
  padding: 1.5rem;
}

/* Projects Grid for Works Page */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 1rem;
}

.project-card {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.rough-card-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.project-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  text-align: left;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  color: var(--card-text);
}

.project-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  margin-bottom: 1rem;
  border-radius: 3px;
}

.project-title {
  font-family: var(--font-family);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--card-text);
  font-weight: 700;
}

.project-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--card-text);
  flex-grow: 1;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tool {
  background: var(--card-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid var(--text-color);
  color: var(--card-text);
}

.project-link {
  margin-top: auto;
  font-family: var(--font-family);
  color: var(--card-text);
  text-decoration: none;
  font-weight: 700;
  align-self: flex-start;
}

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  bottom: 2rem;
  cursor: pointer;
  font-family: 'RaspyGiraffe';
  font-size: 1.5rem;
  color: var(--button-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  transition: transform 0.3s ease;
}

.nav-arrow:hover {
  transform: translateY(-3px);
}

.arrow-right {
  right: 2rem;
}

.arrow-left {
  left: 2rem;
}

.arrow-text {
  font-size: 1rem;
  font-family: var(--font-family);
}

/* Menu Buttons */
.menu-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  max-width: 600px;
  margin: 3rem auto;
}

.rough-button-wrapper {
  font-family: 'RaspyGiraffe';
  position: relative;
  width: clamp(160px, 25vw, 220px);
  height: clamp(50px, 8vh, 65px);
  cursor: pointer;
}

.rough-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.rough-label {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: #804200;
  pointer-events: none;
}

/* Contact Page Styles */
.contact-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 2rem auto;
  gap: 2rem;
  justify-content: center;
}

.contact-card {
  position: relative;
  width: 100%;
  max-width: 350px;
  min-height: 250px;
}

.contact-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.contact-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  text-align: left;
  color: var(--card-text);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.contact-title {
  font-family: var(--font-family);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--card-text);
  font-weight: 700;
}

.contact-info {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--card-text);
  flex-grow: 1;
}

.contact-link {
  color: var(--button-color);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin: 0.5rem 0;
}

.contact-link:hover {
  text-decoration: underline;
}

/* Icon Grid for Contact */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 1rem;
}

.icon-item:hover {
  transform: translateY(-5px);
}

.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--button-color);
  border: 2px solid var(--text-color);
}

.icon-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--card-text);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-arrow {
    position: relative;
    bottom: auto;
    right: auto;
    left: auto;
    margin: 2rem auto;
  }
  
  .arrow-text {
    display: none;
  }
  
  .icon-grid {
    grid-template-columns: 1fr;
  }
}
    .company-image {
      max-width: 100%;
      max-height: 150px;
      object-fit: contain;
    }

@media (max-width: 600px) {
  body {
    padding: 0;
  }
  
  .page {
    padding: 1rem;
  }
  
  .menu-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .welcome-text {
    padding: 1rem;
  }
  
  .contact-container {
    flex-direction: column;
    align-items: center;
  }
}

/* Adjust page content for navigation */
.page {
  margin-top: 80px; /* Adjust based on nav position */
  min-height: calc(100vh - 80px); /* Adjust based on nav height */
}

/* Replace with simpler approach: */
.page-with-top-nav {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

.page-with-bottom-nav {
  margin-bottom: 80px;
  min-height: calc(100vh - 80px);
}

.page-with-side-nav {
  margin-left: 100px;
  min-height: 100vh;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Stack buttons vertically on mobile for top/bottom nav */
  .doodle-nav-container[style*="top"],
  .doodle-nav-container[style*="bottom"] {
    height: auto;
    flex-wrap: wrap;
    padding: 10px;
  }
  
  .doodle-nav-container[style*="top"] ~ .page,
  .doodle-nav-container[style*="bottom"] ~ .page {
    margin-top: 120px; /* Adjust for wrapped nav */
    min-height: calc(100vh - 120px);
  }
  
  /* Hide side nav on mobile, show at bottom instead */
  .doodle-nav-container[style*="left"],
  .doodle-nav-container[style*="right"] {
    display: none;
  }
  
  .doodle-nav-container[style*="left"] ~ .page,
  .doodle-nav-container[style*="right"] ~ .page {
    margin-left: 0;
    margin-top: 0;
  }
  
  /* Add mobile menu toggle */
  .mobile-nav-toggle {
    display: block;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    background: #FFC067;
    border: 2px solid #2B0033;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
  }
}

/* Animation for active page */
@keyframes doodlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.doodle-nav-button.active {
  animation: doodlePulse 2s infinite;
}