/* Sketch layer: handwritten notes, marker scribbles, sketch-to-product transitions.
   Loaded after styles.css. */

/* ---------- handwritten notes ---------- */
.hand {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.note {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.2rem;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.65rem);
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: none;
  rotate: var(--tilt, -4deg);
  text-shadow: 0 0 6px var(--paper), 0 0 2px var(--paper);
}
.note .arrow {
  flex: none;
  width: 48px;
  height: 37px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.note--col { flex-direction: column; align-items: center; gap: 0.1rem; }
.note--ink { color: var(--ink); }
a.note { pointer-events: auto; text-decoration: none; }
a.note:hover { color: var(--ink); }

/* marker circle, drawn in when revealed */
.ring { position: relative; }
.ring::after {
  content: "";
  position: absolute;
  inset: -0.3em -0.4em -0.2em -0.35em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 90' preserveAspectRatio='none'%3E%3Cpath d='M150 12C110 2 30 6 12 38c-12 28 48 48 108 42s78-36 56-58C160 8 120 6 96 10' fill='none' stroke='%23FF5A1F' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  clip-path: inset(0 100% 0 0);
  animation: scribble-in 1s var(--ease-out-expo) 1s forwards;
  pointer-events: none;
}
@keyframes scribble-in { to { clip-path: inset(0 0 0 0); } }

/* positioned notes */
.hero__visual { position: relative; width: 100%; max-width: 38rem; justify-self: end; }
.hero__visual .stage { max-width: none; }
.note--hero { top: -2.7rem; right: 1.25rem; --tilt: -4deg; }
.note--services { position: static; margin-top: 0.5rem; --tilt: -3deg; }
.work__head { position: relative; }
.note--work { right: 22rem; bottom: 0.2rem; --tilt: 4deg; }
.founder__media { position: relative; margin-bottom: 2.4rem; }
.founder__media .founder__photo { margin-bottom: 0; }
.note--founder { right: 0.75rem; bottom: -1.6rem; --tilt: -3deg; background: var(--card); padding: 0.1rem 0.5rem 0.25rem 0.2rem; border-radius: 8px; text-shadow: none; }
.contact__row { position: relative; }
.note--contact { position: static; --tilt: -4deg; }

/* ---------- project cards: sketch, then the real thing ---------- */
.feature__shot { position: relative; }
.feature__note {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  z-index: 2;
  padding: 0.15rem 0.6rem 0.3rem;
  border-radius: 6px;
  background: var(--card);
  box-shadow: 0 4px 14px -6px rgba(20, 20, 19, 0.3);
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent);
  rotate: 3deg;
}

/* ---------- process: sketch → design → 3D product ---------- */
.process { padding: var(--space-section) var(--gutter) 0; }
.process__head { max-width: 40rem; }
.process__head .h2 { margin-bottom: 0.75rem; }

.process__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: 2rem;
}
.process__visual { position: relative; }
.process__sticky { position: sticky; top: 16vh; padding: 2.5rem 1.5rem 3.5rem; perspective: 1600px; }

.mock {
  position: relative;
  border-radius: 16px;
  background: var(--card) radial-gradient(rgba(20, 20, 19, 0.12) 1px, transparent 1.2px) 0 0 / 18px 18px;
  box-shadow: 0 0 0 1px var(--line);
  transform-style: preserve-3d;
  transition: transform 1.2s var(--ease-out-expo), box-shadow 1.2s var(--ease-out-expo), background-color 0.6s;
}
.mock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: #cfc7b8;
  transform: translateZ(-16px);
  opacity: 0;
  transition: opacity 0.6s;
}
.mock > svg { display: block; width: 100%; height: auto; }

.mock .sk { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease-in-out, opacity 0.5s; }
.mock.is-drawn .sk { stroke-dashoffset: 0; }
.mock .ds { opacity: 0; transform: scale(0.94); transform-box: fill-box; transform-origin: center; transition: opacity 0.5s ease, transform 0.6s var(--ease-spring); }
.mock .ds:nth-of-type(2) { transition-delay: 0.06s; }
.mock .ds:nth-of-type(3) { transition-delay: 0.12s; }
.mock .ds:nth-of-type(4) { transition-delay: 0.18s; }
.mock .ds:nth-of-type(5) { transition-delay: 0.24s; }
.mock .ds:nth-of-type(6) { transition-delay: 0.3s; }
.mock .ds:nth-of-type(7) { transition-delay: 0.36s; }

.mock[data-state="design"],
.mock[data-state="product"] { background: var(--card); }
.mock[data-state="design"] .sk,
.mock[data-state="product"] .sk { opacity: 0; }
.mock[data-state="design"] .ds,
.mock[data-state="product"] .ds { opacity: 1; transform: none; }
.mock[data-state="product"] {
  transform: rotateX(14deg) rotateY(-18deg) rotateZ(4deg) scale(0.9);
  box-shadow: 0 0 0 1px var(--line), 40px 60px 70px -30px rgba(20, 20, 19, 0.4);
}
.mock[data-state="product"]::after { opacity: 1; }

/* labels that belong to one state */
.mock-label { opacity: 0; transition: opacity 0.4s ease; }
.mock[data-state="sketch"] .mock-label[data-for="sketch"],
.mock[data-state="design"] .mock-label[data-for="design"],
.mock[data-state="product"] .mock-label[data-for="product"] { opacity: 1; transition-delay: 0.5s; }
.mock-caption {
  position: absolute;
  top: -2.6rem;
  right: 0.5rem;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  line-height: 1;
  color: var(--accent);
  rotate: -3deg;
}
.mock-tag {
  position: absolute;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.1rem, 0.9rem + 0.5vw, 1.4rem);
  line-height: 1;
  color: var(--muted);
  rotate: -2deg;
  text-shadow: 0 0 4px var(--card), 0 0 8px var(--card), 0 0 2px var(--card);
}
.mt-logo { top: 4.5%; left: 21%; }
.mt-head { top: 13.5%; left: 7%; }
.mt-btn { top: 57%; left: 29%; }
.mt-img { top: 22%; left: 77%; }
.mt-live { bottom: -2.4rem; left: 2%; color: #1f9d55; rotate: -1deg; }

/* phone that joins in the product state */
.mock-phone {
  position: absolute;
  right: -1%;
  bottom: 4%;
  width: 20%;
  aspect-ratio: 9 / 18;
  padding: 5px;
  border-radius: 22px;
  background: var(--ink);
  box-shadow: 20px 30px 40px -18px rgba(20, 20, 19, 0.45);
  opacity: 0;
  transform: translateY(40px) rotate(8deg);
  transition: opacity 0.6s ease, transform 1s var(--ease-spring);
}
.mock-phone span { display: block; border-radius: 4px; }
.mock-phone__screen { display: grid; align-content: start; gap: 6%; height: 100%; padding: 14% 10%; border-radius: 18px; background: var(--card); }
.mock-phone__screen span:nth-child(1) { height: 6px; width: 45%; background: var(--ink); }
.mock-phone__screen span:nth-child(2) { height: 10px; width: 90%; background: var(--ink); }
.mock-phone__screen span:nth-child(3) { height: 10px; width: 65%; background: var(--accent); }
.mock-phone__screen span:nth-child(4) { aspect-ratio: 4 / 3; background: var(--yolk); border-radius: 8px; }
.mock-phone__screen span:nth-child(5) { height: 14px; width: 55%; border-radius: 99px; background: var(--blue); }
.process__visual:has(.mock[data-state="product"]) .mock-phone { opacity: 1; transform: translateY(0) rotate(-6deg); }

.process__steps { display: grid; }
.process__step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
  opacity: 0.35;
  transition: opacity 0.5s ease;
}
.process__step.is-active { opacity: 1; }
.process__step .hand { font-size: 1.7rem; }
.process__step h3 { margin: 0.4rem 0 0.75rem; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.process__step p { max-width: 36ch; color: var(--ink-2); }

@media (max-width: 960px) {
  .services__aside { padding-bottom: 0.5rem; }
  .hero__visual { justify-self: stretch; max-width: none; margin-top: 2.75rem; }
  .process__grid { grid-template-columns: 1fr; }
  .process__sticky { position: static; padding: 2.5rem 0.5rem 3.5rem; }
  .process__step { min-height: 0; padding: 1.25rem 0; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ring::after { clip-path: none; }
}

/* the work note needs room beside the heading */
@media (max-width: 1400px) {
  .note--work { display: none; }
}

/* small screens: fewer, smaller notes so nothing collides */
@media (max-width: 640px) {
  .note { font-size: 1.15rem; }
  .note .arrow { width: 36px; height: 28px; }
  .note--hero { top: -2.4rem; right: 0.5rem; }
  .mock-tag { display: none; }
  .mock-caption { top: -2.2rem; font-size: 1.5rem; }
  .feature__note { top: 0.5rem; right: 0.5rem; font-size: 1.05rem; padding: 0.1rem 0.45rem 0.2rem; }
  .note--founder { bottom: -1.3rem; right: 0.5rem; }
  .ring::after { inset: -0.2em -0.3em -0.1em -0.25em; }
}

