/* ============================================
   WHITEBOARD TEXTURE & ARTIFACTS
   The soul of the site — makes it feel like
   a real whiteboard, not a blank web page.
   ============================================ */

/* --- Board Surface Texture --- */
body {
  background-color: #f8f6f2;
  background-image:
    /* SVG noise overlay — matte surface grain */
    url('../images/noise.svg'),
    /* Tileable whiteboard texture — micro-scratches and surface imperfections */
    url('../images/whiteboard-texture.png'),
    /* Subtle top-left light source */
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.25) 0%, transparent 50%),
    /* Faint shadow from frame at edges */
    linear-gradient(180deg,
      rgba(255,255,255,0.06) 0%,
      transparent 5%,
      transparent 93%,
      rgba(0,0,0,0.03) 100%
    );
  background-size: 300px 300px, 400px 400px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  background-attachment: fixed;
}

/* --- Aluminum Frame --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 50;
  /* Aluminum tray/frame effect */
  border: 6px solid #c5bfb4;
  border-image: linear-gradient(
    180deg,
    #d8d3c9 0%,
    #c5bfb4 15%,
    #b8b2a6 50%,
    #a8a298 85%,
    #9e988e 100%
  ) 1;
  box-shadow:
    /* Inner shadow — board recessed into frame */
    inset 0 0 0 1px rgba(0,0,0,0.08),
    inset 0 4px 16px rgba(0,0,0,0.06),
    inset 0 -4px 16px rgba(0,0,0,0.04),
    inset 4px 0 16px rgba(0,0,0,0.04),
    inset -4px 0 16px rgba(0,0,0,0.04),
    /* Frame highlight on top edge */
    inset 0 1px 0 rgba(255,255,255,0.3);
}

/* --- Marker Tray (bottom frame thicker) --- */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  z-index: 51;
  background: linear-gradient(
    180deg,
    #b8b2a6 0%,
    #a8a298 30%,
    #9e988e 70%,
    #948e84 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 -2px 8px rgba(0,0,0,0.06);
}

/* --- Erase Marks (smudgy lighter patches) --- */
.whiteboard-artifacts {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Big erase smudge — someone wiped the board here */
.whiteboard-artifacts::before {
  content: '';
  position: absolute;
  top: 12%;
  left: 5%;
  width: 400px;
  height: 220px;
  background: radial-gradient(ellipse,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.12) 35%,
    transparent 65%
  );
  transform: rotate(-6deg);
}

/* Horizontal eraser swipe */
.whiteboard-artifacts::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 8%;
  width: 350px;
  height: 80px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.25) 20%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0.2) 80%,
    transparent 100%
  );
  transform: rotate(2deg);
}

/* Additional erase marks via child elements */
.erase-mark {
  position: absolute;
  pointer-events: none;
}

/* Circular wipe */
.erase-mark:nth-child(1) {
  top: 30%;
  left: 50%;
  width: 280px;
  height: 160px;
  background: radial-gradient(ellipse,
    rgba(255,255,255,0.28) 0%,
    rgba(255,255,255,0.08) 40%,
    transparent 65%
  );
  transform: rotate(8deg);
}

/* Long horizontal swipe */
.erase-mark:nth-child(2) {
  top: 72%;
  left: 15%;
  width: 320px;
  height: 60px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.2) 15%,
    rgba(255,255,255,0.28) 40%,
    rgba(255,255,255,0.18) 70%,
    transparent 100%
  );
  transform: rotate(-3deg);
}

/* Small circular smudge */
.erase-mark:nth-child(3) {
  top: 6%;
  right: 25%;
  width: 180px;
  height: 120px;
  background: radial-gradient(ellipse,
    rgba(255,255,255,0.22) 0%,
    transparent 55%
  );
  transform: rotate(4deg);
}

/* --- Color Smudges (erased marker residue — no words, just color) --- */
.color-smudge {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  border-radius: 50%;
  filter: blur(18px);
}

/* Green smudges — like someone erased green marker writing */
.smudge-green-1 {
  top: 18%;
  left: 4%;
  width: 220px;
  height: 50px;
  background: var(--green-marker);
  opacity: 0.07;
  transform: rotate(-4deg);
  border-radius: 40% 60% 50% 40%;
}

.smudge-green-2 {
  top: 78%;
  left: 55%;
  width: 180px;
  height: 35px;
  background: var(--green-marker);
  opacity: 0.06;
  transform: rotate(2deg);
  border-radius: 50% 30% 60% 40%;
}

/* Blue smudges */
.smudge-blue-1 {
  top: 42%;
  right: 5%;
  width: 200px;
  height: 45px;
  background: var(--blue-marker);
  opacity: 0.06;
  transform: rotate(3deg);
  border-radius: 35% 55% 45% 50%;
}

.smudge-blue-2 {
  top: 65%;
  left: 10%;
  width: 160px;
  height: 40px;
  background: var(--blue-marker);
  opacity: 0.055;
  transform: rotate(-2deg);
  border-radius: 55% 40% 45% 60%;
}

/* Red smudges */
.smudge-red-1 {
  top: 12%;
  right: 18%;
  width: 170px;
  height: 38px;
  background: var(--red-marker);
  opacity: 0.065;
  transform: rotate(5deg);
  border-radius: 45% 55% 50% 40%;
}

/* --- Marker Bleed Effect on Headings --- */
/* Permanent Marker gets thicker bleed — ink pools at edges */
h1, h2, .hero-name {
  text-shadow:
    0.8px 0.8px 0px rgba(26, 26, 46, 0.1),
    -0.4px 0.4px 1.5px rgba(26, 26, 46, 0.04);
}

/* Green marker headings get green bleed */
.marker-green {
  text-shadow:
    0.6px 0.6px 0px rgba(13, 115, 119, 0.1),
    -0.3px 0.3px 1px rgba(13, 115, 119, 0.05);
}

/* Blue marker bleed */
.marker-blue {
  text-shadow:
    0.6px 0.6px 0px rgba(36, 99, 235, 0.1),
    -0.3px 0.3px 1px rgba(36, 99, 235, 0.05);
}

/* Red marker bleed */
.marker-red {
  text-shadow:
    0.6px 0.6px 0px rgba(192, 57, 43, 0.1),
    -0.3px 0.3px 1px rgba(192, 57, 43, 0.05);
}

/* --- Dry Erase Marker Stroke Variation --- */
/* Dan Sharpie (big moments) gets heavier stroke */
h1, .hero-name, .hero-tagline, .cta-btn {
  -webkit-text-stroke: 0.3px rgba(26, 26, 46, 0.2);
}

/* Neucha (supporting text) gets a lighter touch */
h2, h3, .hand {
  -webkit-text-stroke: 0.15px rgba(26, 26, 46, 0.08);
}

/* --- Scribble Doodles (fixed to the board) --- */
.scribble {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}

/* Arrow scribble — top right area */
.scribble-arrow {
  top: 16%;
  right: 6%;
  width: 100px;
  opacity: 0.08;
  color: var(--green-marker);
  transform: rotate(12deg);
}

/* Star/asterisk — left side */
.scribble-star {
  top: 55%;
  left: 3%;
  width: 35px;
  opacity: 0.09;
  color: var(--red-marker);
  transform: rotate(-8deg);
}

/* Swirl — bottom right */
.scribble-swirl {
  top: 78%;
  right: 4%;
  width: 42px;
  opacity: 0.07;
  color: var(--blue-marker);
  transform: rotate(15deg);
}

.scribble img {
  width: 100%;
  height: auto;
}

/* --- Case Study Page Scribbles & Erasures --- */

/* Scribble positioning for case study pages — mostly red */
.cs-scribble {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}

/* Arrow pointing down — near the title, pointing toward video */
.cs-scribble-1 {
  top: 18%;
  left: 8%;
  opacity: 0.12;
  color: var(--red-marker);
  transform: rotate(8deg);
}

/* Wobbly circle — floats near the sidebar area, like circling something important */
.cs-scribble-2 {
  top: 52%;
  right: 3%;
  opacity: 0.09;
  color: var(--red-marker);
  transform: rotate(-5deg);
}

/* Small arrow pointing right — mid page, pointing toward copy */
.cs-scribble-3 {
  top: 38%;
  left: 3%;
  opacity: 0.10;
  color: var(--red-marker);
  transform: rotate(-4deg);
}

/* Underline scribble — near bottom of the page */
.cs-scribble-4 {
  top: 82%;
  left: 12%;
  opacity: 0.08;
  color: var(--red-marker);
  transform: rotate(1deg);
}

/* Star / asterisk — near top right */
.cs-scribble-5 {
  top: 12%;
  right: 14%;
  opacity: 0.10;
  color: var(--red-marker);
  transform: rotate(12deg);
}

/* Curved arrow — pointing from copy area toward sidebar */
.cs-scribble-6 {
  top: 45%;
  left: 52%;
  opacity: 0.08;
  color: var(--red-marker);
  transform: rotate(3deg);
}

/* Extra erasure marks for case study pages — more lived-in feel */
.cs-erase {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.cs-erase-1 {
  top: 25%;
  right: 12%;
  width: 260px;
  height: 100px;
  background: radial-gradient(ellipse,
    rgba(255,255,255,0.3) 0%,
    rgba(255,255,255,0.1) 40%,
    transparent 65%
  );
  transform: rotate(-8deg);
}

.cs-erase-2 {
  top: 60%;
  left: 8%;
  width: 300px;
  height: 70px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.22) 20%,
    rgba(255,255,255,0.28) 50%,
    rgba(255,255,255,0.18) 80%,
    transparent 100%
  );
  transform: rotate(3deg);
}

.cs-erase-3 {
  top: 75%;
  right: 20%;
  width: 200px;
  height: 120px;
  background: radial-gradient(ellipse,
    rgba(255,255,255,0.25) 0%,
    rgba(255,255,255,0.08) 45%,
    transparent 60%
  );
  transform: rotate(5deg);
}

@media (max-width: 768px) {
  .cs-scribble,
  .cs-erase {
    display: none;
  }
}

/* --- Animation: Marker writing effect --- */
@keyframes marker-write {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.animate-write {
  animation: marker-write 0.8s ease-out forwards;
}

/* --- Responsive adjustments for artifacts --- */
@media (max-width: 768px) {
  .whiteboard-artifacts::before {
    width: 220px;
    height: 130px;
  }

  .whiteboard-artifacts::after {
    width: 180px;
    height: 50px;
  }

  .erase-mark:nth-child(1) { width: 180px; height: 100px; }
  .erase-mark:nth-child(2) { width: 200px; height: 40px; }

  .color-smudge,
  .scribble {
    display: none;
  }

  /* Thinner frame on mobile */
  body::before {
    border-width: 4px;
  }

  body::after {
    height: 10px;
  }
}
