/* ============================================================
   Studio SBM — stylesheet
   Faithful to the original site: white ground, black ink,
   stacked top-left nav, captions on top of images, two-column
   masonry (1:2), label-left rows with generous air.
   ============================================================ */

:root {
  --ink: #111;
  --paper: #fff;
  --muted: #999;
  --hairline: #e6e6e6;
  --edge: clamp(5px, 0.5vw, 10px);   /* near full-bleed */
  --gap: clamp(14px, 1.2vw, 22px);
  --indent: 25vw;                    /* studio label column start */
  --content-col: 24vw;               /* studio label column width */
  --proc-indent: 16vw;               /* process left content start */
  --font-sans: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Lenis smooth scroll (eased wheel inertia) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Soft page-load fade so navigating between pages doesn't hard-cut */
  animation: page-fade 0.55s ease both;
}

@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }

img { display: block; max-width: 100%; }

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

/* Visually hidden but readable by search engines & screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------
   Header — logo block, stacked nav below
   ------------------------------------------------------------ */

.topbar {
  padding: 24px var(--edge) 0;
}

.brand-mark img {
  width: 30px;
  height: 30px;
}

.stack-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 76px;
  padding: 0 var(--edge);
}

.stack-nav a {
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.9;
  transition: color 0.2s ease;
}

.stack-nav a:hover { color: var(--muted); }

.stack-nav a[aria-current="page"] { color: var(--muted); }

/* ------------------------------------------------------------
   Work grid — equal-height justified rows (matches original)
   Each row fills the full width; tiles share the row height and take
   widths proportional to --span. A row's aspect-ratio (set inline)
   controls its height. Full-width rows use one image at its own ratio.
   ------------------------------------------------------------ */

.mgrid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 56px var(--edge) var(--edge);
}

.mrow {
  display: flex;
  gap: var(--gap);
  width: 100%;
  /* aspect-ratio set inline per row → equal height across its tiles */
}

.tile {
  flex: var(--span) 1 0;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #f2f2f2;
}

/* Absolutely-positioned image so it doesn't impose an intrinsic height —
   lets each .mrow's inline aspect-ratio drive the row height. */
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.7s ease, transform 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Gentle zoom on hover */
.tile:hover img { transform: scale(1.035); }

/* Soft fade-in as each image loads — only when JS is active, so images
   never get stuck hidden. main.js adds .js-fade and .in. */
.mgrid.js-fade .tile img { opacity: 0; }
.mgrid.js-fade .tile img.in { opacity: 1; }

.tile { cursor: pointer; }

.caption {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.tile:hover .caption { opacity: 1; }

@media (hover: none) {
  .caption { opacity: 1; }
}

.caption .title {
  font-size: 12px;
  font-weight: 400;
}

.caption .client {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.9;
  margin-top: 1px;
}

/* ------------------------------------------------------------
   Floating portfolio pill (global)
   ------------------------------------------------------------ */

.floating-cta {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  padding: 13px 24px;
  border-radius: 999px;
  background: rgba(196, 181, 158, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.25s ease;
}

.floating-cta:hover { background: rgba(170, 152, 124, 0.92); }

/* ------------------------------------------------------------
   Info rows — label left, content right (studio / process)
   ------------------------------------------------------------ */

.sheet {
  padding: clamp(120px, 16vh, 220px) var(--edge) 160px;
}

.info-row {
  display: grid;
  grid-template-columns: var(--content-col) minmax(0, 1fr);
  padding: clamp(64px, 9vh, 110px) 0 clamp(64px, 9vh, 110px) var(--indent);
  align-items: start;
}

.info-row:first-child { padding-top: 0; }

.info-label {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.info-label.caps { text-transform: uppercase; }

.info-body { max-width: 560px; font-size: 13px; }

.info-body p + p { margin-top: 22px; }

.info-body a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.info-body a:hover { border-color: var(--ink); }

.info-body ul { list-style: none; }

.info-body li { padding: 3px 0; }

/* ------------------------------------------------------------
   Process page — headline, discovery block, alternating timeline
   ------------------------------------------------------------ */

.proc-indent { margin-left: var(--proc-indent); }

.process-headline {
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: 26ch;
  margin-left: var(--proc-indent);
}

.discovery {
  margin-left: var(--proc-indent);
  margin-top: clamp(80px, 13vh, 150px);
  max-width: 540px;
}

.discovery .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.discovery h2 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 22px;
}

.discovery ul { list-style: none; }

.discovery li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 13px;
  color: var(--muted);
}

.discovery li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

/* Timeline */

.timeline {
  position: relative;
  margin: clamp(90px, 15vh, 170px) 0 clamp(70px, 11vh, 140px);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--hairline);
  transform: translateX(-50%);
}

.tstep {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(170px, 22vh, 240px);
}

.tstep .num {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  background: var(--paper);
  padding: 6px 0;
  z-index: 1;
}

.tstep .num::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.tstep.l .num { left: calc(50% - 64px); flex-direction: row-reverse; }
.tstep.r .num { left: calc(50% + 24px); }

.tstep .body h2 {
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  margin-bottom: 18px;
}

.tstep .body ul { list-style: none; }

.tstep .body li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 13px;
  color: #2a2a2a;
  max-width: 38ch;
}

.tstep .body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.tstep.r .body { grid-column: 2; padding-left: clamp(60px, 9vw, 150px); }
.tstep.l .body { grid-column: 1; padding-left: var(--proc-indent); }

/* let's work together */

.proc-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 40px;
  padding: 0 var(--edge);
  margin-top: clamp(60px, 9vh, 120px);
}

.proc-cta h2 {
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.proc-cta .right p {
  font-size: 13px;
  color: #2a2a2a;
  max-width: 42ch;
  margin-bottom: 26px;
}

.text-link {
  font-size: 17px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* Button (contact form, etc.) */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn.solid:hover { background: #2b2b2b; }

.proc-foot {
  text-align: center;
  margin-top: clamp(80px, 13vh, 160px);
}

.proc-foot a {
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.proc-foot a:hover { border-color: var(--ink); }

/* ------------------------------------------------------------
   Contact page + forms
   ------------------------------------------------------------ */

.contact-page {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
  padding: 0 0 0 calc(var(--indent) - 12vw);
}

.contact-page h1 {
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.contact-label {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.form { margin-top: 36px; }

.form .field { margin-bottom: 26px; }

.form label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #d9d9d9;
  background: transparent;
  padding: 10px 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}

.form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23111'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.form textarea { min-height: 120px; resize: vertical; }

.form .actions { margin-top: 34px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.form .btn { cursor: pointer; font-family: var(--font-sans); font-size: 14px; }

.form .form-note { font-size: 13px; color: var(--muted); }

.form-error { display: none; font-size: 14px; color: #b03030; margin-top: 16px; }

.form-error.visible { display: block; }

.form-success { display: none; margin-top: 36px; }

.form-success.visible { display: block; }

.form-success h2 { font-size: clamp(20px, 2vw, 28px); font-weight: 400; }

.form-success p { color: var(--muted); margin-top: 10px; max-width: 30em; }

form.submitting .btn { opacity: 0.55; pointer-events: none; }

.contact-aside .block { padding: 0 0 36px; }

.contact-aside .contact-label { margin-bottom: 8px; }

.contact-aside p { font-size: 15px; line-height: 1.7; }

.contact-aside a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-aside a:hover { border-color: var(--ink); }

/* ------------------------------------------------------------
   Pricing page wrapper
   ------------------------------------------------------------ */

.pricing-mount .sbm-pricing {
  font-family: var(--font-sans);
  padding-top: clamp(20px, 4vw, 60px);
}

/* ------------------------------------------------------------
   Lightbox — click a tile, image full screen
   ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox.on {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.lightbox .lb-caption {
  position: fixed;
  left: 22px;
  bottom: 18px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}

.lightbox .lb-caption .client {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.lightbox .lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  padding: 8px;
  cursor: pointer;
}

body.lb-open { overflow: hidden; }

/* ------------------------------------------------------------
   Portfolio email gate (modal triggered by "Get our portfolio")
   ------------------------------------------------------------ */

.pf-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pf-overlay.on { opacity: 1; pointer-events: auto; }

.pf-modal {
  width: 100%;
  max-width: 420px;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-overlay.on .pf-modal { transform: none; }

.pf-modal .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
}

.pf-modal h2 {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.pf-modal p {
  font-size: 13px;
  color: #2a2a2a;
  margin-bottom: 24px;
  max-width: 36ch;
}

.pf-form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }

.pf-form input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 10px 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}

.pf-form input:focus { outline: none; }

.pf-form button { cursor: pointer; font-family: var(--font-sans); }

.pf-note { font-size: 11px; color: var(--muted); }

.pf-error { display: none; font-size: 13px; color: #b03030; }
.pf-error.on { display: block; }

.pf-close {
  position: absolute;
  top: -38px;
  right: 0;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
}

.pf-success { display: none; }
.pf-success.on { display: block; }
.pf-success .btn { margin-top: 4px; }

body.pf-open { overflow: hidden; }

/* ------------------------------------------------------------
   Reveal on scroll (subtle)
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  body { animation: none; }
  .tile img { transition: none; }
  .tile:hover img { transform: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

/* Phone — one image per line at its natural ratio */
@media (max-width: 640px) {
  .mrow { flex-direction: column; aspect-ratio: auto !important; }
  .tile { flex: none; width: 100%; aspect-ratio: var(--ar); }
}

@media (max-width: 820px) {
  :root { --indent: 0px; --content-col: 130px; --proc-indent: 0px; }

  .stack-nav { margin-top: 56px; }

  .info-row { padding-left: 0; grid-template-columns: var(--content-col) minmax(0, 1fr); gap: 16px; }

  .contact-page { grid-template-columns: 1fr; padding-left: 0; }

  .floating-cta { right: 12px; bottom: 12px; }

  /* Timeline collapses to a single left-aligned column with the line
     running down the left edge. */
  .timeline::before { left: 4px; transform: none; }

  .tstep {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 0 28px 28px;
  }

  .tstep .num,
  .tstep.l .num,
  .tstep.r .num {
    position: static;
    left: auto;
    flex-direction: row;
    margin-bottom: 12px;
    margin-left: -28px;
    padding-left: 0;
  }

  .tstep.l .body,
  .tstep.r .body { grid-column: 1; padding-left: 0; }

  .proc-cta { grid-template-columns: 1fr; gap: 28px; }
}
