/*
  Fabrication stylesheet. Mobile-first. Visual values preserved during cleanup.
*/

:root {
  --bg: #ffffff;
  --text: #1e1e1e;
  --muted: rgba(5, 5, 5, 0.78);
  --soft-muted: rgba(5, 5, 5, 0.45);
  --line: rgba(5, 5, 5, 0.12);
  --ice: #dadee9;
  --body-serif: "Cormorant SC", Georgia, serif;
  --mono: "Roboto Mono", monospace;
  --fraktur: "UnifrakturMaguntia", cursive;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.shophand-shell {
  padding-inline: 0.75rem;
}

.top-nav {
  padding-top: 1.15rem;
  padding-bottom: 1rem;
}

.nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem 1.25rem;
  flex-wrap: wrap;
}

.nav-link-custom {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    filter 180ms ease,
    opacity 180ms ease;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  filter: blur(1px);
  opacity: 0.85;
}

.shophand-hero {
  padding-top: clamp(10rem, 18vw, 16rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.project-meta,
.section-heading-row p,
.skills-grid span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.shophand-title {
  margin: 0;
  width: 100%;
  max-width: none;

  font-family: var(--body-serif);
  font-size: clamp(2.03rem, 5.32vw, 5.46rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-wrap: normal;
}

.shophand-deck {
  width: 100%;
  max-width: none;
  margin: 2rem 0 0;

  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.mono-link {
  display: inline-block;

  font-family: var(--mono);
  font-size: 2em;
  line-height: 1;
  letter-spacing: 0;
  color: inherit;
  text-decoration: none;
  transform-origin: center;

  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.highlight-mono {
  background: var(--ice);
}

.highlight-mono:hover {
  color: #fff;
}

.credit-note p {
  max-width: 72rem;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-toggle {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0.18rem, 1vw, 0.75rem);
  margin-top: 9.75rem;
  width: 100%;
}

.toggle-chip {
  flex: 1 1 0;
  min-width: 0;

  padding: clamp(0.38rem, 1.2vw, 0.7rem) clamp(0.28rem, 1.4vw, 1.1rem);

  border: 1px solid var(--line);
  opacity: 0.5;

  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;

  color: var(--text);
  background: transparent;

  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.toggle-chip:hover,
.toggle-chip.active {
  background: var(--ice);
  color: var(--text);
  border-color: var(--ice);
  opacity: 1;
}

.shophand-credit {
  margin: 1.25rem 0 8rem;

  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  line-height: 1.35;
  letter-spacing: 0.02em;

  color: var(--muted);
}

.shophand-credit a {
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(180deg, transparent 30%, var(--ice) 30%);
  padding: 0 0.2em;

  transition: color 180ms ease;
}

.shophand-credit a:hover {
  color: #ffffff;
}

.finished-gallery-track {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0 0 1rem;
  list-style: none;

  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;

  cursor: grab;
  margin-top: clamp(3rem, 7vw, 5rem);
  margin-bottom: clamp(5rem, 10vw, 9rem);
}

.finished-gallery-track::-webkit-scrollbar {
  display: none;
}

.finished-gallery-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.finished-gallery-item {
  flex: none;
  width: clamp(9rem, 22vw, 14rem);
}

.finished-gallery-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-user-drag: none;
}

.finished-gallery-btn img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f1f1f1;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 180ms ease;
}

.finished-gallery-btn:hover img {
  opacity: 0.85;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 3rem);

  background: rgba(5, 5, 5, 0.92);
}

.image-modal[hidden] {
  display: none;
}

.image-modal-inner {
  max-width: min(94vw, 60rem);
  max-height: 88vh;
}

.image-modal-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.image-modal-close {
  position: absolute;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);

  width: 2.5rem;
  height: 2.5rem;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;

  transition: opacity 180ms ease;
}

.image-modal-close:hover {
  opacity: 0.7;
}

.shophand-section {
  margin-bottom: clamp(7rem, 14vw, 14rem);
}

.process-section {
  display: grid;
  gap: clamp(6rem, 12vw, 12rem);
  margin-bottom: clamp(7rem, 14vw, 14rem);
}

.process-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.process-copy {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.process-copy h3 {
  margin: 0;
  font-family: var(--body-serif);
  font-size: clamp(1.82rem, 4.2vw, 4.03rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
}

.process-copy p {
  max-width: 34rem;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
}

.process-copy .project-date {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.process-image img,
.process-image video {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #ffffff;
}

.process-image video {
  width: 100%;
  height: auto;
}

.process-image {
  position: relative;
}

.slideshow-track {
  position: relative;
}

.slide {
  display: none;
}

.slide.is-active {
  display: block;
}

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;

  transition:
    background 180ms ease,
    opacity 180ms ease;
}

.slide-arrow:hover {
  background: var(--ice);
}

.slide-prev {
  left: 0.75rem;
}

.slide-next {
  right: 0.75rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.skills-grid div {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.skills-grid span {
  display: block;
  margin-bottom: 0.6rem;
}

.skills-grid p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.footer-space {
  padding-top: 3rem;
  padding-bottom: 4rem;
  display: flex;
  justify-content: center;
}

.footer-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.back-home {
  position: fixed;
  bottom: 1.25rem;
  right: 1rem;

  display: inline-block;

  font-family: var(--fraktur);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.02em;

  text-decoration: none;

  opacity: 0.85;

  z-index: 9999;

  transform-origin: center;

  color: #ffffff;
  mix-blend-mode: difference;

  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    filter 180ms ease;
}

.back-home:hover {
  opacity: 1;
  filter: blur(2px);
}

.back-home.attention {
  animation: backHomePulseJump 1.8s ease-in-out 1;
  will-change: transform, color;
}

@keyframes backHomePulseJump {
  0% {
    transform: translateY(0) scale(1);
  }

  14% {
    transform: translateY(-30px) scale(2.5);
  }

  28% {
    transform: translateY(0) scale(1.9);
  }

  42% {
    transform: translateY(-12px) scale(1.1);
  }

  60% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 767.98px) {
  .shophand-title {
    min-height: calc(2.03rem * 1.02 * 2);
  }
}

@media (min-width: 768px) {
  .shophand-shell {
    padding-inline: 1rem;
  }

  .nav-row {
    justify-content: space-between;
    gap: 1rem;
  }

  .nav-link-custom {
    font-size: 0.82rem;
    letter-spacing: 0.22em;
  }

  .toggle-chip {
    font-size: 0.82rem;
    letter-spacing: 0.22em;
  }

  .section-heading-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
  }

  .process-entry {
    grid-template-columns: minmax(16rem, 0.38fr) minmax(0, 1fr);
    gap: 1.5rem;
  }

  .process-copy {
    position: sticky;
    top: 2rem;
  }

  .process-image img,
  .process-image video {
    aspect-ratio: 16 / 11;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .back-home {
    right: 2rem;
    font-size: 1.6rem;
  }
}

@media (min-width: 1200px) {
  .shophand-shell {
    padding-inline: 1.25rem;
  }

  .process-entry {
    grid-template-columns: minmax(20rem, 0.34fr) minmax(0, 1fr);
    gap: 2rem;
  }

  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
