/* ============================================================
   Unicraft site — layout, photography placeholders, reveal motion
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-off-white);
  color: var(--color-near-black);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }

/* ============================================================
   Photography placeholder
   warm-brown gradient + svg grain — convention from the design system
   ============================================================ */
.uc-photo {
  position: relative;
  width: 100%;
  background-color: #3B2219;
  background-image:
    radial-gradient(120% 80% at 25% 18%, rgba(255, 214, 138, 0.22) 0%, rgba(255, 214, 138, 0) 55%),
    radial-gradient(140% 90% at 78% 88%, rgba(20, 12, 8, 0.55) 0%, rgba(20, 12, 8, 0) 60%),
    linear-gradient(135deg, #5a3a26 0%, #3B2219 38%, #1c100b 100%);
  overflow: hidden;
  isolation: isolate;
}
.uc-photo::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyNDAnIGhlaWdodD0nMjQwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44NScgbnVtT2N0YXZlcz0nMicgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjxmZUNvbG9yTWF0cml4IHZhbHVlcz0nMCAwIDAgMCAwLjIxICAwIDAgMCAwIDAuMTMgIDAgMCAwIDAgMC4wOSAgMCAwIDAgMC41NSAwJy8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSd1cmwoJTIzbiknIG9wYWNpdHk9JzAuNTUnLz48L3N2Zz4=");
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}
.uc-photo > * { position: relative; z-index: 2; }
.uc-photo__img { z-index: 1 !important; }
/* when a real photo is present, drop the heavy grain to a faint sheen */
.uc-photo:has(.uc-photo__img)::after { opacity: 0.1; }

/* tone variants */
.uc-photo--raking {
  background-image:
    radial-gradient(70% 50% at 15% 10%, rgba(253, 254, 120, 0.18) 0%, rgba(253, 254, 120, 0) 55%),
    radial-gradient(120% 90% at 80% 95%, rgba(15, 9, 6, 0.7) 0%, rgba(15, 9, 6, 0) 60%),
    linear-gradient(118deg, #6b462e 0%, #432619 42%, #1a0e09 100%);
}
.uc-photo--detail {
  background-image:
    radial-gradient(90% 70% at 50% 40%, rgba(176, 124, 79, 0.35) 0%, rgba(176, 124, 79, 0) 65%),
    radial-gradient(140% 100% at 10% 100%, rgba(10, 6, 4, 0.7) 0%, rgba(10, 6, 4, 0) 50%),
    linear-gradient(90deg, #4a2c1d 0%, #3B2219 50%, #2a160d 100%);
}
.uc-photo--grain {
  background-image:
    repeating-linear-gradient(92deg,
      rgba(0,0,0,0.05) 0px,
      rgba(0,0,0,0.05) 1px,
      transparent 1px,
      transparent 5px),
    repeating-linear-gradient(89deg,
      rgba(255, 220, 160, 0.04) 0px,
      rgba(255, 220, 160, 0.04) 2px,
      transparent 2px,
      transparent 11px),
    linear-gradient(180deg, #5e3a24 0%, #3B2219 60%, #261408 100%);
}
.uc-photo--light {
  background-color: #c7b59a;
  background-image:
    radial-gradient(80% 60% at 20% 20%, rgba(255, 245, 220, 0.45) 0%, rgba(255, 245, 220, 0) 60%),
    radial-gradient(120% 100% at 90% 100%, rgba(82, 53, 33, 0.45) 0%, rgba(82, 53, 33, 0) 55%),
    linear-gradient(150deg, #d6c3a3 0%, #b89a73 50%, #8a6943 100%);
}
.uc-photo--light::after { opacity: 0.22; mix-blend-mode: multiply; }
.uc-photo--workshop {
  background-image:
    radial-gradient(60% 45% at 18% 15%, rgba(253, 254, 120, 0.16) 0%, rgba(253, 254, 120, 0) 55%),
    radial-gradient(120% 90% at 88% 95%, rgba(10, 6, 4, 0.75) 0%, rgba(10, 6, 4, 0) 60%),
    linear-gradient(160deg, #4d2f1f 0%, #2f1a10 60%, #120a06 100%);
}
.uc-photo--ash {
  background-color: #2f1b12;
  background-image:
    radial-gradient(100% 70% at 50% 30%, rgba(214, 169, 110, 0.18) 0%, rgba(214, 169, 110, 0) 60%),
    linear-gradient(180deg, #3a2218 0%, #251309 100%);
}

/* small bottom-left caption inside photo */
.uc-photo__cap {
  position: absolute;
  left: 16px; bottom: 14px;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(229, 229, 222, 0.55);
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .uc-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease-craft), transform 700ms var(--ease-craft);
    will-change: opacity, transform;
  }
  .uc-reveal.is-in { opacity: 1; transform: none; }
  .uc-reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms var(--ease-craft), transform 700ms var(--ease-craft);
  }
  .uc-reveal-stagger.is-in > * { opacity: 1; transform: none; }
  .uc-reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
  .uc-reveal-stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
  .uc-reveal-stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
  .uc-reveal-stagger.is-in > *:nth-child(4) { transition-delay: 240ms; }
  .uc-reveal-stagger.is-in > *:nth-child(5) { transition-delay: 320ms; }
  .uc-reveal-stagger.is-in > *:nth-child(6) { transition-delay: 400ms; }
}

/* ============================================================
   Layout
   ============================================================ */
.uc-shell { max-width: 1440px; margin: 0 auto; padding: 0 80px; }
@media (max-width: 1024px) { .uc-shell { padding: 0 40px; } }
@media (max-width: 640px)  { .uc-shell { padding: 0 24px; } }

/* hard rule */
.uc-rule { height: 1px; background: rgba(9, 11, 10, 0.12); border: 0; }
.uc-rule--dark { background: rgba(253, 254, 120, 0.22); }

/* bracket motif inline word */
.uc-bracket {
  color: var(--color-acid-yellow);
}
.uc-bracket::before { content: "["; }
.uc-bracket::after  { content: "]"; }

/* selection */
::selection { background: var(--color-acid-yellow); color: var(--color-deep-brown); }

/* focus */
:focus-visible { outline: 2px solid var(--color-acid-yellow); outline-offset: 3px; }

/* logo lockup */
.uc-logo {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  white-space: pre;
  display: inline-block;
  user-select: none;
}

/* nav link */
.uc-link {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: none;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  opacity: 0.62;
  transition: opacity 280ms var(--ease-craft);
  cursor: pointer;
}
.uc-link:hover, .uc-link.is-active { opacity: 1; }
.uc-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--color-acid-yellow);
}

/* ============================================================
   Hero logo intro animation — restrained, brand-aligned
   ============================================================ */
.uc-hero-logo {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  color: var(--color-acid-yellow);
}
.uc-hero-logo__row {
  display: flex;
  align-items: baseline;
}
.uc-hero-logo__ch,
.uc-hero-logo__br {
  display: inline-block;
  white-space: pre;
}

@media (prefers-reduced-motion: no-preference) {
  /* hidden start-state for animated variants */
  .uc-hero-logo[data-anim="settle"] .uc-hero-logo__ch,
  .uc-hero-logo[data-anim="settle"] .uc-hero-logo__br,
  .uc-hero-logo[data-anim="build"]  .uc-hero-logo__ch,
  .uc-hero-logo[data-anim="build"]  .uc-hero-logo__br {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-timing-function: var(--ease-craft);
  }

  /* SETTLE — brackets slide in from outside, letters fade up */
  .uc-hero-logo[data-anim="settle"] .uc-hero-logo__ch {
    animation-name: ucLogoFadeUp;
    animation-duration: 800ms;
  }
  .uc-hero-logo[data-anim="settle"] .uc-hero-logo__br--l {
    animation-name: ucLogoBrL;
    animation-duration: 1000ms;
  }
  .uc-hero-logo[data-anim="settle"] .uc-hero-logo__br--r {
    animation-name: ucLogoBrR;
    animation-duration: 1000ms;
  }

  /* BUILD — uniform letter cascade */
  .uc-hero-logo[data-anim="build"] .uc-hero-logo__ch,
  .uc-hero-logo[data-anim="build"] .uc-hero-logo__br {
    animation-name: ucLogoFadeUp;
    animation-duration: 700ms;
  }
}

@keyframes ucLogoFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ucLogoBrL {
  from { opacity: 0; transform: translateX(-56px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ucLogoBrR {
  from { opacity: 0; transform: translateX(56px); }
  to   { opacity: 1; transform: none; }
}
.uc-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: none;
  color: rgba(9, 11, 10, 0.55);
}
.uc-eyebrow--dark { color: rgba(229, 229, 222, 0.55); }


/* ============================================================
   Lifecycle domino — scroll-tied flip + hover zoom
   ============================================================ */
.uc-domino {
  /* rotation is driven inline from JS via scroll progress */
  display: block;
}
.uc-domino__inner {
  overflow: hidden;
  transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
}
.uc-domino__inner .uc-photo {
  transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.uc-domino__inner:hover {
  z-index: 5;
}
.uc-domino__inner:hover .uc-photo {
  transform: scale(1.18);
  filter: brightness(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .uc-domino { transform: none !important; opacity: 1 !important; }
}

/* Service image cards — subtle hover lift on the photo */
.uc-svc-img .uc-photo {
  transition: transform 600ms var(--ease-craft), filter 600ms var(--ease-craft);
}
.uc-svc-img:hover .uc-photo {
  transform: scale(1.04);
  filter: brightness(1.05);
}


/* ============================================================
   Mobile — comprehensive responsive overrides
   ============================================================ */
@media (max-width: 900px) {
  .uc-shell { padding: 0 24px !important; }

  /* Section padding — global compression */
  section[data-screen-label] { padding-top: 80px !important; padding-bottom: 80px !important; }

  /* ============ NAV ============ */
  header > .uc-shell { height: 64px !important; }
  header nav { gap: 14px !important; }
  header nav .uc-link { font-size: 11px !important; letter-spacing: 0.08em !important; padding-bottom: 2px !important; }
  header .uc-logo { font-size: 18px !important; }

  /* ============ HERO ============ */
  [data-screen-label="01 hero"] .uc-hero-logo {
    font-size: clamp(56px, 18vw, 110px) !important;
  }
  [data-screen-label="01 hero"] .uc-hero-logo + div,
  [data-screen-label="01 hero"] [style*="letter-spacing: 0.4em"] {
    font-size: 12px !important;
    letter-spacing: 0.28em !important;
  }
  /* hero bottom-corner micro labels — hide overflow on small */
  [data-screen-label="01 hero"] [style*="bottom: 32px"][style*="position: absolute"] {
    font-size: 10px !important;
  }

  /* ============ Stack helpers: any multi-col inline grid → simpler on mobile ============ */

  /* 2-column asymmetric splits → stack */
  [style*="grid-template-columns: 40% 1fr"],
  [style*="grid-template-columns: 55% 1fr"],
  [style*="grid-template-columns: 1fr 1px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* hide vertical divider on MissionVision split */
  [style*="grid-template-columns: 1fr 1px 1fr"] > [style*="width: 1px"],
  [style*="grid-template-columns: 1fr 1px 1fr"] > div:nth-child(2) {
    display: none !important;
  }

  /* repeat(2..) on body grids stays 2-col but compressed */
  [style*="grid-template-columns: repeat(2,"] {
    gap: 24px !important;
  }
  /* repeat(3..) / repeat(4..) → 2-col */
  [style*="grid-template-columns: repeat(3,"],
  [style*="grid-template-columns: repeat(4,"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }
  /* repeat(5..) / repeat(6..) → 2-col */
  [style*="grid-template-columns: repeat(5,"],
  [style*="grid-template-columns: repeat(6,"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }

  /* ============ ABOUT ============ */
  [data-screen-label="03 about"] img { max-height: 480px; object-fit: cover; }
  /* About stats — clean up left border on first column wrap */
  [data-screen-label="03 about"] [style*="border-left"] {
    padding-left: 24px !important;
  }

  /* ============ MANIFESTO ============ */
  [data-screen-label="04 manifesto"] [style*="grid-template-columns: auto 1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  /* hide the auto side rails of manifesto — they're decorative */
  [data-screen-label="04 manifesto"] [style*="grid-template-columns: auto 1fr auto"] > *:first-child,
  [data-screen-label="04 manifesto"] [style*="grid-template-columns: auto 1fr auto"] > *:last-child {
    display: none !important;
  }

  /* ============ PROJECTS — collapse mosaic to stack ============ */
  [data-screen-label="06 featured projects"] [style*="grid-template-columns: repeat(12,"] {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    height: auto !important;
    gap: 10px !important;
  }
  /* reset every cell's grid-column / grid-row to natural flow with aspect ratio */
  [data-screen-label="06 featured projects"] [style*="grid-template-columns: repeat(12,"] > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
  }
  /* project header: stack title row and counter */
  [data-screen-label="06 featured projects"] [style*="align-items: flex-end"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  /* ============ LIFECYCLE — disable sticky + scroll-tied flip on mobile ============ */
  [data-screen-label="07 project lifecycle"] {
    height: auto !important;
  }
  [data-screen-label="07 project lifecycle"] > div[style*="position: sticky"],
  [data-screen-label="07 project lifecycle"] > div[style*="position:sticky"] {
    position: static !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  [data-screen-label="07 project lifecycle"] .uc-domino {
    transform: none !important;
    opacity: 1 !important;
  }
  /* tap-friendly: zoom on tap instead of hover (briefly) */
  [data-screen-label="07 project lifecycle"] .uc-domino__inner:active .uc-photo {
    transform: scale(1.08);
  }

  /* ============ ESG 2x2 — keep 2-col but smaller ============ */
  [data-screen-label="09 esg"] [style*="grid-template-rows: repeat(2,"] {
    grid-template-rows: auto auto !important;
  }

  /* ============ PARTNERS logo wall ============ */
  [data-screen-label="11 partners"] [style*="grid-template-columns: repeat(5,"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ============ CONTACT 4-col → 2-col already handled by repeat(4,) above ============ */
  [data-screen-label="12 contact"] { padding-bottom: 56px !important; }

  /* ============ FOOTER ============ */
  [data-screen-label="13 footer"] [style*="display: flex"][style*="align-items: center"][style*="gap: 24px"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  /* ============ Generic h2 heading scale-down on mobile ============ */
  section h2 {
    font-size: clamp(32px, 9vw, 52px) !important;
    line-height: 1.02 !important;
  }
  section h3 {
    font-size: clamp(28px, 7vw, 40px) !important;
  }

  /* ============ Touch hit targets ============ */
  button { min-height: 44px; }
}

/* ============ Tighter — phones < 480px ============ */
@media (max-width: 480px) {
  .uc-shell { padding: 0 18px !important; }

  header nav { gap: 10px !important; }
  header nav .uc-link { font-size: 10px !important; }
  header .uc-logo { font-size: 16px !important; }

  [data-screen-label="01 hero"] .uc-hero-logo {
    font-size: clamp(48px, 17vw, 84px) !important;
  }

  /* Drop to 1-col on the tightest grids */
  [style*="grid-template-columns: repeat(4,"],
  [style*="grid-template-columns: repeat(3,"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  [style*="grid-template-columns: repeat(5,"],
  [style*="grid-template-columns: repeat(6,"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [data-screen-label="11 partners"] [style*="grid-template-columns: repeat(5,"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  section h2 { font-size: clamp(30px, 10vw, 44px) !important; }
}
