/* UGC page. Layered on /insights/article.css, so it takes the same pastel
   paper, white cards and light type. The videos are the page: a feed of
   phones first, then one of them taken apart. Copied to public/ugc/. */

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

.u-head,
.u-reel-head,
.u-anatomy,
.u-process,
.u-law {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

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

.u-head { padding-top: clamp(4rem, 9vw, 7.5rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.u-head h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
html[lang='ja'] .u-head h1 { letter-spacing: -0.02em; line-height: 1.1; word-break: auto-phrase; }
.u-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;
}

/* ------------------------------------------------------------ the feed */

.u-reel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.u-reel-head h2,
.u-anat-text h2,
.u-process h2,
.u-law h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.u-reel-head p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.u-reel {
  --card: clamp(15rem, 17.5vw, 18rem);
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--card);
  gap: clamp(1rem, 2vw, 1.75rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.5rem var(--gut) 1.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gut);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.u-reel:focus-visible { outline-offset: -2px; }
/* Where five phones fit side by side, lay them out as a row with no scroll */
@media (min-width: 1360px) {
  .u-reel { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
}
.u-sample { scroll-snap-align: start; display: grid; align-content: start; gap: 1rem; }

.u-phone {
  position: relative;
  padding: 8px;
  background: #111;
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(11, 13, 20, 0.08), 0 24px 48px -16px rgba(40, 20, 60, 0.35);
  transition: transform 0.5s var(--e-out), box-shadow 0.5s var(--e-out);
}
.u-phone.is-sound { box-shadow: 0 0 0 2px var(--blue), 0 24px 48px -16px rgba(0, 0, 238, 0.35); }
.u-video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 20px;
  background: #000;
}

.snd {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 0.85rem 0 0.6rem;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font: 500 13px/1 var(--font);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.2s var(--e-out), transform 0.3s var(--e-out);
}
.snd:hover { background: #fff; transform: translateY(-1px); }
.snd svg { width: 20px; height: 20px; }
.snd .snd-wave { display: none; }
.snd[aria-pressed='true'] { background: var(--blue); color: #fff; }
.snd[aria-pressed='true'] .snd-wave { display: block; }
.snd[aria-pressed='true'] .snd-off { display: none; }

.u-cap { display: grid; gap: 0.5rem; padding: 0 0.25rem; }
.u-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.u-hook {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-indent: -0.45em;
  text-wrap: pretty;
}
.u-hook::before { content: '\201C'; }
.u-hook::after { content: '\201D'; }
.u-hook[lang='ja'] { text-indent: 0; }
.u-hook[lang='ja']::before { content: '\300C'; margin-left: -0.5em; }
.u-hook[lang='ja']::after { content: '\300D'; }
.u-tr { margin: 0; font-size: 0.86rem; line-height: 1.4; color: var(--ink-2); }
.u-own {
  justify-self: start;
  margin: 0.25rem 0 0;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--blue);
}

/* ------------------------------------------------------------ anatomy */

.u-anatomy {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-top: clamp(4rem, 9vw, 7rem);
}
.u-anatomy > * { min-width: 0; }
.u-phone-lg { max-width: 22rem; }
.u-sec-lede { max-width: 34rem; margin: 1rem 0 0; font-size: 1.05rem; line-height: 1.45; color: var(--ink-2); }

.u-bar { display: flex; gap: 4px; margin: 2rem 0 0.5rem; }
.u-bar span { position: relative; height: 4px; border-radius: 2px; background: rgba(11, 13, 20, 0.1); overflow: hidden; }
.u-bar i {
  position: absolute;
  inset: 0;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
}

.u-beats {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.u-beat {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.25rem;
  width: 100%;
  padding: 1rem 1rem 1.1rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s var(--e-out);
}
.u-beats li + li .u-beat { box-shadow: 0 -1px 0 var(--line-soft); }
.u-beat:hover { background: rgba(11, 13, 20, 0.035); }
.u-beat-time {
  grid-row: 1 / span 2;
  padding-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.u-beat b { font-size: 1.05rem; font-weight: 500; line-height: 1.3; transition: color 0.25s var(--e-out); }
.u-beat-body { font-size: 0.92rem; line-height: 1.45; color: var(--ink-2); }
.u-beat.is-on b,
.u-beat.is-on .u-beat-time { color: var(--blue); }

/* ------------------------------------------------------------ process */

.u-process { margin-top: clamp(4rem, 9vw, 7rem); }
.u-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
}
.u-steps li {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.u-step-n { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.u-steps h3 { margin: 0.5rem 0 0; font-size: 1.15rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.u-steps p { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--ink-2); }

/* ---------------------------------------------------------------- law */

.u-law {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-top: clamp(4rem, 9vw, 7rem);
}
.u-law p { max-width: 34rem; margin: 0; font-size: 1.05rem; line-height: 1.45; color: var(--ink-2); }
.u-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.u-link svg { transition: transform 0.3s var(--e-out); }
.u-link:hover svg { transform: translateX(3px); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .u-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .u-anatomy { grid-template-columns: minmax(0, 1fr); }
  .u-phone-lg { max-width: 17rem; margin: 0 auto; }
  .u-law { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .u-reel { --card: min(68vw, 16rem); }
  .u-reel-head { flex-direction: column; gap: 0.5rem; }
  .u-steps { grid-template-columns: minmax(0, 1fr); }
  .u-steps li { padding: 1.25rem 1.25rem 1.5rem; }
}

/* Japanese headings and ledes break on phrases, not mid word */
html[lang='ja'] .u-reel-head h2,
html[lang='ja'] .u-anat-text h2,
html[lang='ja'] .u-process h2,
html[lang='ja'] .u-law h2,
html[lang='ja'] .u-lede,
html[lang='ja'] .u-sec-lede { word-break: auto-phrase; }

/* Four nav links do not fit next to the button on a phone; the logo is home */
@media (max-width: 720px) {
  .is-ugc .a-links a:first-child { display: none; }
  .is-ugc .a-links a,
  .is-ugc .a-btn,
  .is-ugc .a-lang { white-space: nowrap; }
}
