/* ════════════════════════════════════════════════════════════════
   HOME.CSS — Pixels & Patches homepage redesign
   Loaded after styles.css + nav.css, index.html only.
   ════════════════════════════════════════════════════════════════ */

:root {
  /* Motion system — single source of truth */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --dur-fast:    180ms;
  --dur-med:     420ms;
  --dur-slow:    800ms;
  --rise:        28px;

  --accent: #e8552f;            /* sharper patch-orange for the homepage */
  --accent-soft: #fbe3d9;
  --grid-line: rgba(26, 22, 18, 0.07);
}

/* Homepage goes full-bleed; inner sections manage their own width */
.page-wrapper.home {
  max-width: none;
  padding: 0;
  overflow-x: clip;
}

.home .home-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
  position: relative;
  z-index: 1;
}

.home .nav {
  background: transparent;
  /* three zones: monogram · centered links · connect */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.home .nav::before {
  /* solid strip behind sticky nav so grid lines don't show through text */
  content: "";
  position: absolute;
  inset: 0 -100vw 0 -100vw;
  background: var(--bg);
  z-index: -1;
}

/* circular AN monogram (left) */
.nav-monogram {
  grid-column: 1;
  justify-self: start;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1.5px solid var(--text-primary);
  border-radius: 50%;
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 560;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-monogram:hover { background: var(--text-primary); color: var(--bg); }

/* centered links — clean, no persistent active underline (hover only) */
.home .nav-links { grid-column: 2; justify-self: center; gap: clamp(22px, 2.4vw, 42px); }
.home .nav-link.active .nav-underline { transform: scaleX(0); opacity: 0; }
.home .nav-link:hover .nav-underline { transform: scaleX(1); opacity: 0.4; }

/* Let's connect pill (right) */
.nav-connect {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--text-primary);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-out);
}
.nav-connect:hover { transform: translateY(-2px); }
.nav-connect-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(232, 85, 47, 0.5);
  animation: connect-pulse 2.2s var(--ease-out) infinite;
}
@keyframes connect-pulse { 0% { box-shadow: 0 0 0 0 rgba(232,85,47,0.5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(232,85,47,0); } }

@media (max-width: 767px) {
  /* compact mobile bar: monogram left, hamburger right */
  .home .nav { display: flex; justify-content: space-between; }
  .nav-connect { display: none; }
  .nav-monogram { width: 42px; height: 42px; font-size: 0.88rem; }
  /* the dropdown panel spans the full bar (override the centered-links rule) */
  .home .nav-links { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) { .nav-connect-dot { animation: none; } }

/* ─── BACKGROUND GRID CANVAS ─────────────────────────────────── */
.grid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Static CSS fallback grid (no-JS and reduced-motion baseline) */
.grid-static {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    var(--grid-line) 0 1px,
    transparent 1px 96px
  );
}
html.js .grid-static { display: none; }

/* Subtle paper grain over everything, very low opacity */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── ENTRANCE REVEALS ───────────────────────────────────────── */
html.js .reveal {
  opacity: 0;
  transform: translateY(var(--rise));
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  padding-top: clamp(28px, 5vh, 52px);
  padding-bottom: clamp(28px, 4vh, 48px);
}
.hero-copy { padding-top: clamp(8px, 1.5vh, 20px); }

.hero-copy .kicker {
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.hero-name {
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 560;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.3em 0 0.28em;
}
.hero-name .accent-period { color: var(--accent); }

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.74rem, 1.1vw, 0.85rem);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.9em;
}

.hero-statement {
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  line-height: 1.5;
  color: var(--text-body);
  max-width: 28em;
  margin-bottom: 1.1em;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.hero-ctas .btn-patch,
.hero-ctas .btn-ghost {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 0.74rem;
}

.btn-patch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--text-primary);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease-spring),
              background var(--dur-fast) var(--ease-out);
}
.btn-patch:hover { background: var(--accent); transform: translateY(-2px); }
.btn-patch:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.btn-ghost:hover { border-color: var(--text-primary); transform: translateY(-2px); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Hero patch board ── */
.patch-board {
  position: relative;
  height: clamp(360px, 52vh, 560px);
}

.patch {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(26, 22, 18, 0.16);
  background: var(--white);
  overflow: hidden;
  /* JS sets --px/--py for pointer parallax; transforms only, no layout */
  transform:
    translate(calc(var(--px, 0) * var(--depth, 0)), calc(var(--py, 0) * var(--depth, 0)))
    rotate(var(--tilt, 0deg));
  will-change: transform;
}
.patch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html.js .patch {
  opacity: 0;
  translate: 0 40px;
  scale: 0.92;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    translate var(--dur-slow) var(--ease-spring),
    scale var(--dur-slow) var(--ease-spring);
  transition-delay: var(--patch-delay, 0ms);
}
html.js .hero.is-in .patch { opacity: 1; translate: 0 0; scale: 1; }

@media (prefers-reduced-motion: reduce) {
  html.js .patch { opacity: 1; translate: 0 0; scale: 1; transition: none; }
}

.patch--note {
  background: #fff7d6;
  box-shadow: 0 6px 18px rgba(26, 22, 18, 0.14);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-body);
  overflow: visible;
}
.patch--note::before {
  /* tape strip */
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 54px;
  height: 16px;
  background: rgba(232, 85, 47, 0.28);
}

.patch--chip {
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--text-primary);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 16px rgba(26, 22, 18, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.patch--chip .cursor-arrow {
  position: absolute;
  top: -14px;
  left: -12px;
  font-size: 1rem;
  color: var(--text-primary);
}

/* ─── SECTION HEADERS ────────────────────────────────────────── */
.home-section { padding: clamp(56px, 9vh, 120px) 0; position: relative; }

.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vh, 56px);
}

.home-section-title {
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 560;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  letter-spacing: -0.015em;
}
.home-section-title .accent-period { color: var(--accent); }

.home-section-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ─── WORK LIST + PREVIEW STAGE ──────────────────────────────── */
.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: start;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.work-row {
  position: relative;
  border-top: 1px solid var(--border);
  padding: clamp(22px, 3vh, 36px) 8px;
  transition: opacity var(--dur-med) var(--ease-out),
              background var(--dur-med) var(--ease-out);
}
.work-row:last-child { border-bottom: 1px solid var(--border); }

/* dim siblings, not the active row */
.work-list.has-active .work-row:not(.is-active) { opacity: 0.45; }
.work-row.is-active { background: rgba(232, 85, 47, 0.045); }

.work-row-top {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.work-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.work-title-link {
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 560;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: color var(--dur-fast) var(--ease-out);
}
.work-row.is-active .work-title-link { color: var(--accent); }
/* stretched link — whole row clickable, still one tab stop */
.work-title-link::after { content: ""; position: absolute; inset: 0; }

.work-desc {
  margin: 0.7em 0 0.9em;
  color: var(--text-body);
  max-width: 46em;
  line-height: 1.55;
}

.work-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.9em;
}
.work-meta span + span::before { content: " · "; color: var(--border); }

.work-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1em; }
.work-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-body);
}

.work-cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-blue);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.work-cta .arrow { transition: transform var(--dur-fast) var(--ease-spring); }
.work-row.is-active .work-cta .arrow { transform: translateX(5px); }

/* preview thumb inside each row — visible on mobile, hidden where stage exists */
.work-row-thumb {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
}
.work-row-thumb img { width: 100%; display: block; }

/* Preview stage (desktop) — chrome-less floating layer */
.work-stage {
  position: sticky;
  top: 110px;
  height: clamp(420px, 62vh, 640px);
}

.stage-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
  pointer-events: none;
}
.stage-scene.is-active { opacity: 1; }

.stage-main {
  position: absolute;
  top: 6%;
  left: 0;
  width: 86%;
  border-radius: 10px;
  box-shadow: 0 16px 44px rgba(26, 22, 18, 0.18);
  transform: translateY(18px) rotate(-1deg);
  transition: transform var(--dur-med) var(--ease-spring);
}
.stage-phone {
  /* phone sits ON TOP of the desktop screen */
  position: absolute;
  right: 4%;
  top: 32%;
  width: 30%;
  max-height: 62%;
  object-fit: contain;
  z-index: 1;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(26, 22, 18, 0.25);
  transform: translateY(30px) rotate(2deg);
  transition: transform var(--dur-med) var(--ease-spring) 60ms;
}
.stage-scene.is-active .stage-main  { transform: translateY(0) rotate(-1deg); }
.stage-scene.is-active .stage-phone { transform: translateY(0) rotate(2deg); }

.stage-label {
  position: absolute;
  left: 0;
  bottom: 8%;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--text-primary);
  color: var(--white);
  padding: 7px 14px;
  border-radius: 999px;
}


/* ─── MORE PROJECTS / GRAPHIC DESIGN ─────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

.gallery-item {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
  transition: transform var(--dur-med) var(--ease-spring),
              box-shadow var(--dur-med) var(--ease-out);
}
.gallery-item:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 18px 40px rgba(26, 22, 18, 0.16);
}

.gallery-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--accent-soft);
}
.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.gallery-item:hover .gallery-media img { transform: scale(1.04); }

.gallery-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
}
.gallery-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}
.gallery-cat {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.gallery-more {
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: transparent;
  padding: 32px 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-body);
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.gallery-more:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-4px); }

/* ─── ABOUT / CAPABILITIES ───────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
}

.about-lede {
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 480;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.9em;
}
.about-lede em { font-style: italic; color: var(--accent); }

.capability-patches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1.4em 0 1.8em;
}
.capability-patches li {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur-fast) var(--ease-out);
}
.capability-patches li:hover {
  transform: translateY(-3px) rotate(-1deg);
  border-color: var(--accent);
}

.about-visual { position: relative; text-align: center; }
.about-visual img { margin: 0 auto; max-height: 280px; object-fit: contain; }

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-section { text-align: center; }

.contact-title {
  font-family: var(--font-display);
  font-variation-settings: var(--font-variation);
  font-weight: 560;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
}
.contact-title em { font-style: italic; color: var(--accent); }

.contact-sub {
  color: var(--text-body);
  max-width: 34em;
  margin: 0 auto 2.2em;
  line-height: 1.6;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (min-width: 901px) {
  .work-row-thumb { display: none; }   /* stage handles previews */
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 32px;
  }
  .patch-board { height: clamp(280px, 44vw, 420px); }
  .work-layout { grid-template-columns: 1fr; }
  .work-stage { display: none; }       /* thumbs in rows take over */
  .work-list.has-active .work-row:not(.is-active) { opacity: 1; }
  .about-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .gallery { grid-template-columns: 1fr; }
  .work-row-top { flex-wrap: wrap; gap: 10px; }
  .hero-ctas .btn-patch,
  .hero-ctas .btn-ghost { width: 100%; justify-content: center; }
  .patch--note { font-size: 0.64rem; }
}
