/* ==========================================================================
   home.css — homepage sections layered on top of styles.css
   Tokens (--purple, --blue, --hair, …) are defined in styles.css :root.
   ========================================================================== */

:root {
  --pj-ease: cubic-bezier(.22, .61, .36, 1);
}

/* --------------------------------------------------------------------------
   Section shell
   -------------------------------------------------------------------------- */
.s {
  position: relative;
  padding-block: 110px;
}
.s-tight { padding-block: 84px; }

.s-head { margin-bottom: 46px; }
.s-head.center { text-align: center; }
.s-head h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  /* 500 to match the other section headings, not the spec's 600 */
  font-weight: 500;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.06;
  letter-spacing: -.03em;
  color: var(--charcoal);
  margin: 0;
}
.s-head .lead {
  margin: 14px auto 0;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.62;
  color: var(--muted);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   05 — Our projects
   -------------------------------------------------------------------------- */
#work.s {
  background: rgba(250, 250, 252, .6);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.pj-slider {
  position: relative;
  overflow: hidden;
  padding: 34px 0 28px;
  touch-action: pan-y;
  cursor: grab;
}
.pj-slider:active { cursor: grabbing; }
.pj-slider:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }

.pj-track {
  display: flex;
  gap: 26px;
  will-change: transform;
  transition: transform 700ms var(--pj-ease);
}
.pj-track.no-anim { transition: none; }

/* ---- Card ---- */
.pj-card {
  flex: 0 0 auto;
  width: clamp(300px, 38vw, 480px);
  border-radius: 20px;
  background: var(--ivory);
  border: 1px solid var(--hair);
  overflow: hidden;
  cursor: pointer;
  transform: scale(.9);
  opacity: .45;
  transition: transform 600ms var(--pj-ease), opacity 600ms var(--pj-ease),
              box-shadow 600ms var(--pj-ease);
}
.pj-card.is-center {
  transform: scale(1);
  opacity: 1;
  z-index: 3;
  box-shadow: 0 30px 70px -30px rgba(46, 20, 66, .4);
}
.pj-card:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

.pj-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pj-chrome {
  flex: none;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--ivory);
  border-bottom: 1px solid var(--hair);
}
.pj-chrome i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.pj-chrome i:nth-child(1) { background: #ff5f57; }
.pj-chrome i:nth-child(2) { background: #febc2e; }
.pj-chrome i:nth-child(3) { background: #28c840; }
.pj-url {
  margin-left: 8px;
  min-width: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pj-shot {
  position: relative;
  flex: 1;
  min-height: 0;
  background: linear-gradient(150deg, var(--purple), var(--blue));
  overflow: hidden;
}
.pj-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  opacity: 0;
  transition: opacity 500ms var(--pj-ease);
}
.pj-shot.ready img { opacity: 1; }

/* Branded placeholder shown until the screenshot resolves */
.pj-fb {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(150deg, var(--purple), var(--blue));
  transition: opacity 400ms var(--pj-ease);
}
.pj-shot.ready .pj-fb { opacity: 0; pointer-events: none; }
.pj-fb b {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: #fff;
}
.pj-fb i {
  font-style: normal;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, .7);
  word-break: break-all;
}

.pj-load {
  position: relative;
  width: 74px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .22);
  margin-top: 4px;
}
.pj-load::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 3px;
  background: rgba(255, 255, 255, .9);
  animation: pjLoad 1.5s var(--pj-ease) infinite;
}
@keyframes pjLoad {
  0%   { left: -40%; }
  100% { left: 102%; }
}

/* Screenshot services exhausted — offer the live site instead */
.pj-shot.gave-up .pj-load { display: none; }
.pj-fb .pj-giveup { display: none; }
.pj-shot.gave-up .pj-fb .pj-giveup {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: #fff;
}
/* No live site and no local asset — nothing to load, so no loading bar either */
.pj-shot.no-shot .pj-load { display: none; }

.pj-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  background: linear-gradient(180deg, transparent 45%, rgba(30, 18, 50, .5));
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--pj-ease);
}
.pj-card.is-center:hover .pj-open { opacity: 1; }
.pj-open span {
  padding: 9px 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .6);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--purple);
}

.pj-meta { padding: 15px 18px 18px; }
.pj-meta .t {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--purple);
}
.pj-meta h3 {
  margin: 6px 0 0;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.02em;
  color: var(--charcoal);
}

/* ---- Dots ---- */
.pj-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.pj-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(68, 32, 97, .18);
  cursor: pointer;
  transition: width 400ms var(--pj-ease), background 400ms var(--pj-ease),
              border-radius 400ms var(--pj-ease);
}
.pj-dot.is-active {
  width: 22px;
  border-radius: 4px;
  background: var(--purple);
}

/* --------------------------------------------------------------------------
   Project modal
   -------------------------------------------------------------------------- */
.pj-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
}
.pj-modal.open { display: block; }

.pj-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 33, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 300ms var(--pj-ease);
}
.pj-modal.in .pj-backdrop { opacity: 1; }

.pj-dialog {
  position: relative;
  width: min(1040px, 94vw);
  margin: 5vh auto 0;
  background: var(--ivory);
  border-radius: 24px;
  box-shadow: 0 50px 120px -30px rgba(20, 14, 33, .6);
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px 1fr;
  max-height: 90vh;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 400ms var(--pj-ease), transform 400ms var(--pj-ease);
}
.pj-modal.in .pj-dialog { opacity: 1; transform: translateY(0); }

.pj-dhead {
  padding: 44px 36px;
  border-right: 1px solid var(--hair);
  overflow-y: auto;
}
.pj-dhead .t {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--purple);
}
.pj-dhead h3 {
  margin: 12px 0 0;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--charcoal);
}
.pj-dhead p {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--graphite);
}
.pj-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 13px 21px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(46, 20, 66, .6);
  transition: transform 320ms var(--pj-ease), box-shadow 320ms var(--pj-ease);
}
.pj-visit:hover {
  background: #371851;
  transform: translateY(-1px);
  box-shadow: 0 18px 38px -12px rgba(46, 20, 66, .66);
}
.pj-visit[hidden] { display: none; }

.pj-gallery {
  padding: 30px;
  overflow-y: auto;
  background: rgba(250, 250, 252, .7);
}

.pj-frame {
  border-radius: 14px;
  border: 1px solid var(--hair);
  overflow: hidden;
  background: var(--ivory);
  box-shadow: 0 30px 70px -30px rgba(46, 20, 66, .4);
}
.pj-frame .pj-chrome { height: 38px; }
.pj-frame img { width: 100%; display: block; }

.pj-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 24px;
  border-radius: 14px;
  border: 1px dashed rgba(68, 32, 97, .3);
  background: repeating-linear-gradient(135deg,
    rgba(68, 32, 97, .04) 0 10px, transparent 10px 20px);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.pj-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ivory);
  border: 1px solid var(--hair);
  color: var(--charcoal);
  cursor: pointer;
  transition: background 300ms var(--pj-ease);
}
.pj-close:hover { background: rgba(68, 32, 97, .06); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .pj-card { width: clamp(300px, 46vw, 420px); transform: scale(.92); opacity: .55; }
  .pj-card.is-center { transform: scale(1); opacity: 1; }
}

@media (max-width: 820px) {
  .pj-dialog { grid-template-columns: 1fr; margin: 3vh auto 0; }
  .pj-dhead {
    padding: 32px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }
  .pj-gallery { padding: 20px; }
}

@media (max-width: 640px) {
  .s-tight { padding: 64px 0; }
  .pj-slider { padding: 28px 0 22px; }
  .pj-track { gap: 16px; }
  .pj-card { width: min(84vw, 340px); transform: scale(.94); }
  .pj-card.is-center { transform: scale(1); }
  .pj-dots { gap: 6px; }
  .pj-meta h3 { font-size: 17px; }
}

/* --------------------------------------------------------------------------
   Reduced motion — centered vs. neighbour still reads, it just doesn't animate
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pj-track { transition: none !important; }
  .pj-card { transition: none; }
  .pj-load::after { animation: none; left: 0; width: 100%; }
  .pj-dialog { transition: none; opacity: 1; transform: none; }
  .pj-backdrop { transition: none; opacity: 1; }
  .pj-shot img, .pj-fb, .pj-open, .pj-dot { transition: none; }
}

/* --------------------------------------------------------------------------
   07 — Contact
   -------------------------------------------------------------------------- */
.ct-sec { background: rgba(250, 250, 252, .6); border-top: 1px solid var(--hair); }

.ct-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 940px;
  margin: 0 auto;
}

.ct-ways { display: grid; gap: 10px; }
.ct-way {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--ivory);
  border: 1px solid var(--hair);
  text-decoration: none;
  transition: border-color 240ms var(--ease), box-shadow 240ms var(--ease), transform 240ms var(--ease);
}
.ct-way:hover {
  border-color: rgba(68, 32, 97, .24);
  box-shadow: 0 10px 26px -14px rgba(46, 20, 66, .3);
  transform: translateY(-1px);
}
.ct-way__ico {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--purple-soft);
  color: var(--purple);
}
.ct-way__k {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.ct-way__v { display: block; font-size: 13.5px; font-weight: 600; color: var(--charcoal); margin-top: 2px; }

.ct-form {
  background: var(--ivory);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 18px 44px -28px rgba(17,17,17,.2);
}
.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ct-field { margin-bottom: 14px; }
.ct-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--graphite);
  margin-bottom: 6px;
}
.ct-opt { font-weight: 400; color: var(--faint); }
.ct-field input, .ct-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(14,10,26,.14);
  border-radius: 10px;
  background: #fff;
  color: var(--charcoal);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.ct-field textarea { resize: vertical; min-height: 118px; }
.ct-field input::placeholder, .ct-field textarea::placeholder { color: var(--faint); }
.ct-field input:focus, .ct-field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(68,32,97,.12);
}
.ct-field.is-bad input, .ct-field.is-bad textarea { border-color: #C2402F; }

.ct-alert {
  display: none;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.ct-alert.is-bad { display: block; color: #A6321F; background: #FDF3F1; border: 1px solid #F3CFC8; }
.ct-alert.is-good { display: block; color: #1B5E43; background: #F0F9F4; border: 1px solid #C6E6D5; }

.ct-send { width: 100%; justify-content: center; }

@media (max-width: 900px) {
  .ct-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 560px) {
  .ct-row { grid-template-columns: 1fr; gap: 0; }
  .ct-form { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-way, .ct-way:hover { transition: none; transform: none; }
}

/* ==========================================================================
   Mobile refinements
   The desktop nav-links are display:none below 980px, so these give small
   screens a real menu instead of no navigation at all.
   ========================================================================== */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
}
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--charcoal);
  transition: transform 260ms var(--ease), opacity 200ms var(--ease);
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile {
  /* .nav-shell is a centring flex row with pointer-events:none, so the menu
     needs its own stacking, width and pointer events back. */
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  pointer-events: auto;
  margin: 8px 0 0;
  padding: 8px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hair);
  border-radius: 20px;
  box-shadow: 0 18px 44px -18px rgba(17,17,17,0.24);
  animation: navDrop 220ms var(--ease-out) both;
}
@keyframes navDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nav-mobile__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
}
.nav-mobile__link:hover, .nav-mobile__link:focus-visible { background: var(--purple-soft); color: var(--purple); }
.nav-mobile__link--sub {
  margin-top: 4px;
  border-top: 1px solid var(--hair);
  border-radius: 0 0 12px 12px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .nav-burger { display: flex; }
  /* .nav-links is hidden here, so nothing is left to push the group across —
     it would otherwise sit against the logo. */
  .nav-cta-group { margin-left: auto; }
  /* Start a Project, then the burger. The burger is first in the DOM so it
     stays the first tab stop on desktop; order only moves it visually. */
  .nav-burger { order: 2; margin-left: 2px; }
  .nav-cta { order: 1; }
  /* The portal lives behind the menu on small screens — one entry point is
     enough, and the icon read as decoration next to the CTA. */
  .nav-client-link { display: none; }
}

@media (max-width: 640px) {
  /* one column — two was wrapping card titles onto three lines */
  .wwb-grid { grid-template-columns: 1fr !important; }
  /* The step keeps its node column here. Collapsing it to one column put the
     body at x:0, directly under the timeline rail, so the rule ran through
     the text. Narrower node + gap instead. */
  .op-step { grid-template-columns: 38px 1fr; gap: 14px; padding-bottom: 32px; }
  .op-node { width: 38px; height: 38px; font-size: 13px; }
  .op-line-track { left: 18px; }
  .op-body { padding-top: 8px; }
  .op-title { font-size: 16px; gap: 8px; }
  .op-desc { font-size: 13.5px; }

  /* ---- Hero: heading, paragraph, graphic, buttons, stats ----
     The graphic is a sibling of the copy column, so it can't be moved between
     two of that column's children by order alone. display:contents dissolves
     the copy wrapper, promoting its children to flex items alongside the
     visual, and order then interleaves them. */
  .hx-grid { display: flex; flex-direction: column; gap: 26px; }
  .hx-copy { display: contents; }
  .hx-h1     { order: 1; }
  .hx-sub    { order: 2; margin-bottom: 0; }
  .hx-visual { order: 3; }
  .hx-cta    { order: 4; margin-top: 0; }

  .hx-h1, .hx-sub { text-align: center; }
  .hx-sub { margin-inline: auto; }
  /* Scaled down so the conveyor's outer cards stay inside the gutter instead
     of being clipped by .hx-ai's overflow. */
  .hx-ai { height: 300px; }
  .cv-stage { transform: rotateX(20deg) rotateY(-14deg) scale(.62); }

  /* The stat row is desktop-only — it pushed the CTAs below the fold and read
     as filler once the graphic sat above it. */
  .hx-stats { display: none; }

  /* Side by side. The label needs the tighter padding and type to fit two
     pills across a phone without wrapping. */
  .hx-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hx-btn { width: 100%; justify-content: center; padding: 14px 8px; font-size: 13px; text-align: center; }
  .hx-btn .arrow { display: none; }
  .pfcta-btns { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .pfcta-btns .btn { width: 100%; justify-content: center; }

  /* ---- Footer: compact, not one long column ---- */
  .footer { padding: 40px 0 28px; }
  .footer-row { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { margin-top: 10px; }
  .footer h5 { margin-bottom: 10px; }
  .footer-links { gap: 2px; }
  .footer-links a { min-height: 32px; display: flex; align-items: center; font-size: 13px; }
  .footer-base { margin-top: 32px; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile { animation: none; }
  .nav-burger span { transition: none; }
}

/* the menu is absolutely positioned against the nav pill's row */
@media (max-width: 980px) {
  .nav-shell { position: fixed; }
  .nav-shell > .nav { position: relative; }
  .nav-mobile { max-width: 520px; margin-inline: auto; }
}
