/* Our products (the owner's brief, 2026-10-12): an editorial showcase of the
   products built at 1595, replacing the two "Selected work" cards. Each
   product has its own moment: SnapStaq as a web platform in a browser frame,
   on a soft neutral tone; Layzbooks as desktop software in an app window that
   opens from the middle like an album, on a slightly warmer tone. Motion is
   set off by js/products.js; with reduced motion everything simply shows. */

.products { --tone: var(--white); padding: 0 !important; background: var(--tone); transition: background-color 900ms ease; }
.products[data-on="snapstaq"] { --tone: #F6F5F3; }
.products[data-on="layzbooks"] { --tone: #F9F3EE; }
.products-inner { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(80px, 9vw, 140px) var(--gutter) clamp(40px, 4vw, 64px); }

/* Chapter 01: the introduction */
.products-intro { display: grid; gap: 0; margin-bottom: clamp(56px, 7vw, 112px); }
.products-intro h2 { margin: 0; font-size: clamp(52px, 8vw, 128px); line-height: 0.95; letter-spacing: -0.05em; }
.products-intro h2 .w { display: inline-block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; vertical-align: top; }
.products-intro h2 .w > span { display: inline-block; }
.products-intro .lede { margin-top: clamp(22px, 2.4vw, 32px); max-width: 38ch; }

/* a product: its words, its screen and its link placed on a grid; the words sit beside the screen */
.product { display: grid; column-gap: clamp(36px, 6vw, 104px); row-gap: 0; align-items: end; padding: clamp(40px, 5vw, 72px) 0 clamp(72px, 9vw, 136px); border-top: 1px solid var(--line); }
.product--snapstaq { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.6fr); grid-template-areas: "head shot" "cta shot"; }
.product--layzbooks { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.78fr); grid-template-areas: "shot head" "shot cta"; }
.product-head { grid-area: head; align-self: end; }
.product-shot { grid-area: shot; margin: 0; }
.product-cta-row { grid-area: cta; align-self: start; padding-top: 28px; }

.product-meta { display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(20px, 2.4vw, 32px); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); }
.product-meta i { flex: none; width: 36px; height: 1px; background: var(--red); transform-origin: left center; } /* a fine line drawn between the number and the trade */
.product-name { margin: 0; font-size: clamp(48px, 5.6vw, 92px); line-height: 0.95; letter-spacing: -0.05em; }
.product-line { margin: 18px 0 0; font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; max-width: 22ch; }
.product-desc { margin: 16px 0 0; color: var(--grey); font-size: 17px; line-height: 1.65; max-width: 40ch; }
.product-cta { display: inline-flex; align-items: center; gap: 10px; padding: 14px 0; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--ink); transition: color 200ms, border-color 200ms; }
.product-cta span { display: inline-block; color: var(--red); transition: transform 260ms cubic-bezier(.2, .8, .2, 1); }
.product-cta:hover { color: var(--red); border-color: var(--red); }
.product-cta:hover span { transform: translate(4px, -4px); }
.product-cta:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; border-radius: 2px; }

/* the screens: real interfaces, large and crisp; a controlled shadow for depth, no glow */
.frame { position: relative; overflow: hidden; border-radius: 14px; background: #1B1B1E; border: 1px solid rgba(18, 18, 20, 0.1);
  box-shadow: 0 1px 2px rgba(18, 18, 20, 0.06), 0 30px 60px -28px rgba(18, 18, 20, 0.38); }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.frame-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; background: #232326; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.frame-bar .address { margin: 0 auto; padding: 4px 14px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.62); font-size: 12px; font-weight: 500; letter-spacing: 0.01em; }
.frame-bar .title { color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 600; }
.frame-bar .controls { margin-left: auto; display: flex; gap: 18px; color: rgba(255, 255, 255, 0.5); font-size: 12px; line-height: 1; }

/* SnapStaq: the dashboard reaches past the column toward the page's edge */
.product--snapstaq .product-shot { margin-right: calc(-1 * max(0px, var(--gutter) - 20px)); } /* into the page margin, never touching the screen's edge */
.product--snapstaq .parallax { will-change: transform; transform: translateY(var(--py, 0px)); }

/* Layzbooks: the window opens from its fold, like an album */
.product--layzbooks .product-shot { margin-left: calc(-1 * max(0px, var(--gutter) - 20px)); }
.fold { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.55); pointer-events: none; opacity: 0; }

/* ---------- the motion (js/products.js adds .motion to the section, then .in to each part) ---------- */
.motion .products-intro h2 .w > span { transform: translateY(105%); transition: transform 900ms cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.motion .products-intro.in h2 .w > span { transform: none; }
.motion .products-intro .eyebrow, .motion .products-intro .lede { opacity: 0; transform: translateY(16px); transition: opacity 800ms, transform 800ms cubic-bezier(.2, .8, .2, 1); }
.motion .products-intro .lede { transition-delay: 300ms; }
.motion .products-intro.in .eyebrow, .motion .products-intro.in .lede { opacity: 1; transform: none; }

.motion .product .reveal { opacity: 0; transform: translateY(22px); transition: opacity 700ms ease, transform 800ms cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.motion .product.in .reveal { opacity: 1; transform: none; }
.motion .product-meta i { transform: scaleX(0); transition: transform 700ms cubic-bezier(.2, .8, .2, 1) 120ms; }
.motion .product.in .product-meta i { transform: scaleX(1); }

/* SnapStaq: number and trade first, then the words, then the dashboard rises and settles */
.motion .product--snapstaq .product-shot { opacity: 0; transform: translateY(70px) scale(0.94); transform-origin: 50% 100%; transition: opacity 900ms ease 380ms, transform 1300ms cubic-bezier(.16, .84, .24, 1) 380ms; }
.motion .product--snapstaq.in .product-shot { opacity: 1; transform: none; }

/* Layzbooks: the window opens from the middle outward, the picture easing into its frame, the fold fading as it opens; the link comes last */
.motion .product--layzbooks .frame { clip-path: inset(0 50% 0 50% round 14px); transition: clip-path 1300ms cubic-bezier(.65, 0, .25, 1); }
.motion .product--layzbooks.in .frame { clip-path: inset(0 0 0 0 round 14px); }
.motion .product--layzbooks .frame img { transform: scale(1.12); transition: transform 1600ms cubic-bezier(.2, .8, .2, 1); }
.motion .product--layzbooks.in .frame img { transform: none; }
.motion .product--layzbooks .fold { opacity: 1; transition: opacity 900ms ease 700ms; }
.motion .product--layzbooks.in .fold { opacity: 0; }
.motion .product--layzbooks .product-cta-row.reveal { transition-delay: 1250ms; }

/* ---------- the stage (computers; js/products.js adds .staged): the section is a long run of scroll,
   its inside holds still beneath the top bar, and the scroll plays the scenes ---------- */
.stage-rail { display: none; }
.products.staged { height: 440vh; }
.products.staged .products-inner { position: sticky; top: 0; height: 100vh; max-width: none; padding: 0; overflow: hidden; }
.staged .products-intro, .staged .product { position: absolute; left: 0; right: 0; top: 78px; bottom: 15vh; margin: 0 auto; width: min(var(--max), calc(100% - 2 * var(--gutter))); }
.staged .products-intro { align-content: center; justify-items: center; text-align: center; margin-bottom: 0; }
.staged .products-intro .lede { margin-inline: auto; }
.staged .product { align-content: center; padding: 0; border-top: 0; z-index: 1; }
.staged .product--layzbooks { opacity: 0; }
.staged .product, .staged .products-intro, .staged .reveal, .staged .product-shot, .staged .frame, .staged .frame img, .staged .fold { transition: none !important; will-change: transform, opacity; }
.staged .product--snapstaq .parallax { transform: none; }
.staged .product--layzbooks .frame { clip-path: none; transform-origin: 50% 50%; will-change: transform; }
.staged .product--layzbooks .frame-bar, .staged .product--layzbooks .frame img { transform-origin: 50% 50%; will-change: transform; }
.staged .product--snapstaq .product-shot, .staged .product, .staged .products-intro { backface-visibility: hidden; }
/* the stage floor: a fine line, a breath of shade beneath it */
.products.staged .products-inner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 15vh; border-top: 1px solid var(--line); background: linear-gradient(to bottom, rgba(18, 18, 20, 0.035), rgba(18, 18, 20, 0)); pointer-events: none; }
/* the scene marker on the floor: the two names, a line filling between them */
.staged .stage-rail { position: absolute; z-index: 2; left: 50%; bottom: 5.5vh; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; }
.stage-rail button { padding: 6px 2px; border: 0; background: none; font: 600 13px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); cursor: pointer; transition: color 300ms; }
.stage-rail button:hover, .stage-rail button:focus-visible { color: var(--ink); }
.stage-rail button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.stage-rail[data-on="snapstaq"] [data-scene="snapstaq"], .stage-rail[data-on="layzbooks"] [data-scene="layzbooks"] { color: var(--red); }
.stage-line { width: 120px; height: 1px; background: var(--line); overflow: hidden; }
.stage-line i { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left center; }

/* tablets: the screen a little wider than the words */
@media (max-width: 1100px) {
  .product--snapstaq { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .product--layzbooks { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .frame-bar .controls { gap: 12px; }
}
/* phones and small tablets: number, name, headline, description, screen, link - one column */
@media (max-width: 820px) {
  .product, .product--snapstaq, .product--layzbooks { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "shot" "cta"; }
  .product-shot, .product--snapstaq .product-shot, .product--layzbooks .product-shot { margin: 32px 0 0; }
  .product--snapstaq .parallax { transform: none; }
  .product-cta-row { padding-top: 20px; }
  .frame-bar { height: 28px; padding: 0 10px; }
  .frame-bar i { width: 8px; height: 8px; }
  .frame-bar .address, .frame-bar .title, .frame-bar .controls { font-size: 11px; }
  .motion .product--snapstaq .product-shot { transform: translateY(36px); }
  .product-meta { gap: 10px; }
  .product-meta i { width: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .products { transition: none; }
}
