/* Products page. Layered on /insights/article.css, so it keeps the pastel
   paper, white plates and light type. The idea is a dock: seven real app
   icons up top, one chapter per product below, and each chapter's media
   panel painted in that product's own colors. Once the top dock scrolls
   away a small one docks at the bottom and marks the chapter in view.
   Copied to public/products/. */

.is-products main { overflow-x: clip; }

.p-head,
.p-dock[data-dock-home],
.p-chapters {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

/* ------------------------------------------------------------------ head */

.p-head { padding-top: clamp(4rem, 9vw, 7.5rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.p-head h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
html[lang='ja'] .p-head h1 { max-width: 13em; font-size: clamp(2.25rem, 5.6vw, 4.75rem); letter-spacing: -0.02em; line-height: 1.12; word-break: auto-phrase; }
.p-lede {
  max-width: 40rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ------------------------------------------------------------------ dock */

.p-dock ul { list-style: none; margin: 0; padding: 0; }
.p-dock a { text-decoration: none; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.p-dock-icon {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 1px 1px rgba(11, 13, 20, 0.06), 0 8px 20px -6px rgba(40, 20, 60, 0.28);
}

/* the big one, first viewport */
.p-dock[data-dock-home] { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.p-dock[data-dock-home] ul {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 2rem);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 3rem) clamp(1.25rem, 2.5vw, 2rem);
  background: var(--paper-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.p-dock[data-dock-home] a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  line-height: 1.2;
}
.p-dock[data-dock-home] .p-dock-icon {
  max-width: 104px;
  transform: translateY(calc(var(--m, 0) * -14px)) scale(calc(1 + var(--m, 0) * 0.14));
  transform-origin: 50% 100%;
  transition: transform 0.35s var(--e-out);
}
.p-dock[data-dock-home].is-tracking .p-dock-icon { transition-duration: 0.12s; }
.p-dock[data-dock-home] a:focus-visible { outline: none; }
.p-dock[data-dock-home] a:focus-visible .p-dock-icon { outline: 2px solid var(--blue); outline-offset: 4px; }

/* the small one, docked at the bottom */
.p-dock-float {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 60;
  padding: 8px 10px 10px;
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(11, 13, 20, 0.06), 0 18px 40px -12px rgba(40, 20, 60, 0.35);
  translate: -50% calc(100% + 24px);
  opacity: 0;
  transition: translate 0.5s var(--e-out), opacity 0.3s var(--e-out);
}
.p-dock-float.is-on { translate: -50% 0; opacity: 1; }
.p-dock-float ul { display: flex; gap: 8px; }
.p-dock-float li { position: relative; }
.p-dock-float a { display: block; width: 44px; }
.p-dock-float .p-dock-icon { box-shadow: 0 1px 1px rgba(11, 13, 20, 0.08), 0 4px 10px -4px rgba(40, 20, 60, 0.3); transition: transform 0.3s var(--e-out); }
.p-dock-float a:hover .p-dock-icon { transform: translateY(-4px); }
.p-dock-float a span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  translate: -50% 4px;
  padding: 0.3rem 0.6rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--e-out), translate 0.2s var(--e-out);
}
.p-dock-float a:hover span,
.p-dock-float a:focus-visible span { opacity: 1; translate: -50% 0; }
.p-dock-float a:focus-visible { outline: none; }
.p-dock-float a:focus-visible .p-dock-icon { outline: 2px solid var(--blue); outline-offset: 2px; }
/* the running dot, as on a Mac */
.p-dock-float a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.25s var(--e-out);
}
.p-dock-float a[aria-current='true']::after { opacity: 1; }

/* ------------------------------------------------------------- chapters */

.p-chapters { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }

.p-ch {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: clamp(560px, 46vw, 720px);
  background: var(--paper-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}
.p-ch.is-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.p-ch.is-flip .p-media { order: -1; }

.p-text {
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 3.5rem);
}

.p-name { display: flex; align-items: center; gap: 0.9rem; }
.p-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 22.5%;
  box-shadow: 0 1px 1px rgba(11, 13, 20, 0.06), 0 6px 14px -6px rgba(40, 20, 60, 0.3);
}
.p-name h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.p-line {
  margin: clamp(1.75rem, 4vw, 3rem) 0 0;
  font-size: clamp(1.9rem, 3.1vw, 2.9rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
html[lang='ja'] .p-line { font-size: clamp(1.6rem, 2.6vw, 2.4rem); letter-spacing: -0.01em; line-height: 1.2; word-break: auto-phrase; }

.p-body {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.p-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 1rem 2.5rem;
  margin: auto 0 0;
  padding-top: 2rem;
}
.p-facts div { min-width: 0; }
.p-facts dt {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
html[lang='ja'] .p-facts dt { font-family: var(--font); letter-spacing: 0.04em; }
.p-facts dd { margin: 0; font-size: 0.92rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.p-facts .p-inside { grid-column: 1 / -1; }
.p-facts .p-inside i { font-style: normal; color: var(--ink-3); }

.p-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 2rem;
}
.p-get { gap: 0.55rem; }
.p-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.3em;
  transition: color 0.25s var(--e-out), text-decoration-color 0.25s var(--e-out);
}
.p-more:hover { color: var(--blue); text-decoration-color: currentColor; }

/* ---------------------------------------------------------- media panel */

.p-media {
  position: relative;
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--g);
  color: var(--gi);
  isolation: isolate;
}
.p-alt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.p-phone {
  --pw: clamp(150px, 15.5vw, 250px);
  width: var(--pw);
  padding: calc(var(--pw) * 0.03);
  background: #0a0a0b;
  border-radius: calc(var(--pw) * 0.15);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 40px 80px -24px rgba(0, 0, 0, 0.55);
}
.p-phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: 50% 0;
  border-radius: calc(var(--pw) * 0.12);
}

/* two phones rising out of the bottom edge, the second one lower */
.p-pair {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  padding-top: clamp(3rem, 6vw, 5rem);
}
.p-pair .p-phone-2 { margin-top: clamp(3rem, 6vw, 5.5rem); }

.p-code {
  position: absolute;
  left: clamp(1.25rem, 2.5vw, 2rem);
  bottom: clamp(1.25rem, 2.5vw, 2rem);
  z-index: 2;
  padding: 0.55rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ga);
  background: rgba(11, 12, 10, 0.86);
  border: 1px solid color-mix(in srgb, var(--ga) 40%, transparent);
  border-radius: 6px;
}
.p-code::before { content: '$ '; color: color-mix(in srgb, var(--gi) 55%, transparent); }

/* Glimpse: the glasses glow behind, one phone in front */
.is-glimpse .p-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 50%;
  opacity: 0.9;
}
.is-glimpse .p-phone-solo {
  position: absolute;
  right: clamp(1.5rem, 7%, 5rem);
  top: clamp(3rem, 12%, 6rem);
  --pw: clamp(160px, 16vw, 260px);
}

/* Yubi: her ink on paper, with the two keys */
.is-yubi { background: var(--g); }
.is-yubi .p-art {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 92%;
  width: auto;
  translate: -50% 0;
  mix-blend-mode: multiply;
}
.p-keys {
  position: absolute;
  left: clamp(1.25rem, 3vw, 2.5rem);
  top: clamp(1.25rem, 3vw, 2.5rem);
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-keys li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.86rem; color: var(--gi); }
.p-keys kbd {
  display: inline-grid;
  place-items: center;
  min-width: 5.5rem;
  padding: 0.6rem 0.8rem;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  color: #111;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.9);
  border-radius: 8px;
  box-shadow: 0 3px 0 -1px #111, 0 6px 14px -8px rgba(0, 0, 0, 0.4);
}

/* AnimaNext: the real photo, edge to edge */
.is-photo .p-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* Nightwatch: the MacBook on its own lime, rising out of the bottom edge */
.is-mac .p-lid {
  position: absolute;
  right: -12%;
  bottom: 0;
  width: 165%;
  max-width: none;
  height: auto;
  translate: 0 12%;
  /* the source has a soft shadow around the laptop; fade its top edge into the ground */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%);
}

/* ------------------------------------------------------------- the close */

.is-products .a-cta { margin-bottom: 0; }
.is-products .a-foot { padding-bottom: 7rem; }

/* ---------------------------------------------------------- small screens */

@media (max-width: 960px) {
  .p-ch,
  .p-ch.is-flip { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .p-ch .p-media,
  .p-ch.is-flip .p-media { order: -1; min-height: 0; height: clamp(380px, 92vw, 560px); }
  .p-phone { --pw: clamp(130px, 34vw, 220px); }
  .is-glimpse .p-phone-solo { --pw: clamp(140px, 36vw, 230px); top: 2rem; }
  .p-facts { margin-top: 0; }
  /* on a narrow panel, zoom in on the menu corner of the screen */
  .is-mac .p-lid { width: 190%; right: -10%; translate: 0 16%; }
}

@media (max-width: 720px) {
  /* the logo is the way home and the page ends on the contact button, so on a
     phone the header keeps the section links and the language switch */
  .is-products .a-links a:first-child,
  .is-products .a-right .a-btn { display: none; }
  .is-products .a-nav { gap: 1rem; }
  .is-products .a-links { gap: 0.9rem; }
  .is-products .a-lang { white-space: nowrap; }
  .p-dock[data-dock-home] ul { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1.5rem; }
  .p-dock[data-dock-home] a { font-size: 0.76rem; gap: 0.6rem; }
  .p-dock[data-dock-home] .p-dock-icon { max-width: 64px; }
  .p-dock-float { padding: 6px 8px 8px; border-radius: 16px; }
  .p-dock-float ul { gap: 6px; }
  .p-dock-float a { width: 38px; }
  .p-dock-float a span { display: none; }
  .p-facts { grid-template-columns: repeat(2, minmax(0, auto)); gap: 1rem 2rem; }
  .p-keys kbd { min-width: 4.5rem; padding: 0.5rem 0.6rem; }
}
