/* Step-by-step guides (how-to-fix-iphone-full, docs/connecting-a-usb), on top of site.css: screenshots sit in nested,
   machined phone frames with soft tinted shadows, the steps alternating sides. */

.guide {
  --g-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --g-radius: 3rem;
  --g-shell: 8px;
  /* shadows carry the deep blue of the palette, never plain black */
  --g-shadow: 0 2px 4px rgb(15 46 59 / 0.04), 0 24px 48px -16px rgb(15 46 59 / 0.18), 0 64px 120px -40px rgb(15 46 59 / 0.28);
}

/* ---------- small pieces ---------- */

.g-eyebrow {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  background: rgb(15 46 59 / 0.07); box-shadow: inset 0 0 0 1px rgb(15 46 59 / 0.08);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--c-deep);
}
.g-eyebrow--dark { background: rgb(250 250 250 / 0.08); box-shadow: inset 0 0 0 1px rgb(250 250 250 / 0.12); color: var(--c-paper); }

/* the action: a pill with its arrow in a circle of its own */
.g-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.g-cta {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 3.5rem; padding: 6px 6px 6px 24px; border-radius: 999px;
  background: var(--c-night); color: var(--c-paper);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 12px 28px -12px rgb(15 46 59 / 0.5);
  transition: transform 500ms var(--g-ease), box-shadow 500ms var(--g-ease);
}
.g-cta__icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 999px;
  background: rgb(250 250 250 / 0.12); font-size: 1.125rem;
  transition: transform 500ms var(--g-ease);
}
/* never wider than its row: on a narrow card the label wraps instead of pushing past the edge */
.g-acts .g-cta { max-width: 100%; }
.g-acts .g-cta > span:first-child { white-space: normal; line-height: 1.2; }
.g-cta__icon { flex-shrink: 0; }
.g-cta--yellow { background: var(--c-yellow); color: var(--c-night); box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.6); }
.g-cta--yellow .g-cta__icon { background: rgb(9 9 11 / 0.1); }
.g-cta:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .g-cta:hover { box-shadow: 0 18px 36px -14px rgb(15 46 59 / 0.6); }
  .g-cta:hover .g-cta__icon { transform: translate(3px, -1px) scale(1.05); }
}

/* the phone: a glass plate in an aluminium tray. Outer shell, then the screen, with
   concentric corners */
.g-bezel {
  padding: var(--g-shell); border-radius: var(--g-radius);
  background: linear-gradient(160deg, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.45));
  box-shadow: inset 0 0 0 1px rgb(15 46 59 / 0.08), var(--g-shadow);
}
.g-bezel__core {
  overflow: hidden; border-radius: calc(var(--g-radius) - var(--g-shell));
  background: var(--c-night);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.15);
}
.g-bezel__core img { display: block; width: 100%; height: auto; }

/* ---------- opening ---------- */

.g-opening {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: center;
  padding-block: clamp(56px, 8vw, 120px) clamp(96px, 12vw, 176px);
}
.g-opening__text { grid-column: 1 / span 7; }
.g-title { margin-top: 24px; font-size: clamp(2.75rem, 1.4rem + 5vw, 6.25rem); line-height: 0.95; letter-spacing: -0.045em; }
.g-lead { margin-top: 28px; max-width: 34ch; }
.g-opening .g-acts { margin-top: 40px; }
.g-hero-phone { grid-column: 9 / span 4; margin: 0; justify-self: center; width: min(100%, 340px); }
.g-hero-phone .g-bezel { transform: rotate(3deg); }
.g-hero-phone__note { margin-top: 28px; text-align: center; opacity: 0.75; }

/* ---------- before you start: three tiles of the same tray ---------- */

.g-main { padding-bottom: clamp(96px, 12vw, 176px); }
.g-need { padding-block: 0 clamp(96px, 12vw, 176px); }
.g-need__title { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; }
.g-need__list {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: 5fr 4fr 3fr; gap: 16px;
}
.g-tile { padding: 6px; border-radius: 2rem; background: rgb(255 255 255 / 0.5); box-shadow: inset 0 0 0 1px rgb(15 46 59 / 0.07); }
.g-tile__core {
  height: 100%; padding: 28px; border-radius: calc(2rem - 6px);
  background: var(--c-paper); box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.9), 0 18px 40px -28px rgb(15 46 59 / 0.35);
}
.g-tile__k { font-weight: 700; letter-spacing: -0.01em; }
.g-tile__core p + p { margin-top: 8px; opacity: 0.8; }

/* the other way to free it up: a USB, for when the computer is out of reach (links to the shop) */
.g-usb {
  display: flex; align-items: center; gap: 20px; margin-top: 16px; padding: 20px 20px 20px 24px;
  border-radius: 2rem; background: var(--c-paper); color: inherit; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgb(15 46 59 / 0.07), 0 18px 40px -28px rgb(15 46 59 / 0.35);
}
.g-usb__text { display: grid; gap: 4px; flex: 1; }
.g-usb__sub { opacity: 0.8; }
.g-usb__go {
  display: inline-flex; align-items: center; gap: 14px; flex: none; padding: 6px 6px 6px 22px; border-radius: 999px;
  background: var(--c-night); color: var(--c-paper); font-weight: 700; white-space: nowrap;
}
.g-usb__go .g-cta__icon { width: 2.5rem; height: 2.5rem; }
@media (hover: hover) and (pointer: fine) {
  .g-usb:hover .g-cta__icon { transform: translateX(3px); }
}
@media (max-width: 767px) {
  .g-usb { flex-wrap: wrap; align-items: flex-start; }
  .g-usb__text { flex-basis: calc(100% - 68px); }
  .g-usb__go { width: 100%; justify-content: space-between; }
}

/* ---------- the steps: type on one side, the phone on the other, alternating ---------- */

.g-steps { list-style: none; margin: 0; padding: 0; }
.g-step {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: center; padding-block: clamp(48px, 6vw, 88px);
  scroll-margin-top: 24px;
}
.g-step__text { grid-column: 2 / span 5; }
.g-step .g-phone { grid-column: 8 / span 4; }
.g-step--flip .g-step__text { grid-column: 7 / span 5; grid-row: 1; }
.g-step--flip .g-phone { grid-column: 2 / span 4; grid-row: 1; }
.g-step h2 { margin-top: 20px; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); line-height: 1; letter-spacing: -0.04em; }
.g-step__text > p:not(.g-eyebrow) { margin-top: 20px; font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.015em; max-width: 30ch; }
.g-step__text strong { font-weight: 700; }
.g-step__text .g-aside { font-size: var(--step-body); line-height: 1.5; letter-spacing: 0; opacity: 0.75; }
.g-phone { margin: 0; justify-self: center; width: min(100%, 320px); }

/* ---------- the end ---------- */

.g-end { padding-block: 0 var(--section); }
.g-end__inner { padding: clamp(40px, 7vw, 112px); }
.g-end h2 { margin-top: 24px; max-width: 14ch; }
.g-end .lead { margin-top: 24px; max-width: 40ch; opacity: 0.85; }
.g-end .g-acts { margin-top: 40px; }

/* ---------- motion: phones rise with a little weight ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .guide .g-phone[data-reveal] { transform: translateY(64px) scale(0.97); transition: opacity 900ms var(--g-ease), transform 1100ms var(--g-ease); }
  .js .guide .g-phone[data-reveal].is-in { transform: none; }
  .js .guide .g-step__text[data-reveal] { transform: translateY(32px); transition: opacity 800ms var(--g-ease), transform 900ms var(--g-ease); }
  .js .guide .g-step__text[data-reveal].is-in { transform: none; }
}

/* ---------- tablet ---------- */

@media (max-width: 1080px) {
  .g-opening__text { grid-column: 1 / span 7; }
  .g-hero-phone { grid-column: 8 / span 5; }
  .g-step__text, .g-step--flip .g-step__text { grid-column: 1 / span 6; }
  .g-step .g-phone { grid-column: 8 / span 5; }
  .g-step--flip .g-step__text { grid-column: 7 / span 6; }
  .g-step--flip .g-phone { grid-column: 1 / span 5; }
  .g-need__list { grid-template-columns: 1fr 1fr; }
  .g-need__list .g-tile:first-child { grid-column: 1 / -1; }
}

/* ---------- phone: one column, text then screen, no tilt ---------- */

@media (max-width: 720px) {
  .g-opening, .g-step { display: block; }
  .g-opening { padding-block: 32px 72px; }
  .g-title { font-size: 12vw; }
  .g-hero-phone { margin-top: 56px; width: min(78vw, 300px); }
  .g-hero-phone .g-bezel { transform: none; }
  .g-opening .g-acts .g-cta { width: 100%; justify-content: space-between; }
  .g-need__list { grid-template-columns: 1fr; }
  .g-step { padding-block: 40px; }
  .g-step .g-phone { margin-top: 32px; width: min(78vw, 300px); }
  .g-step h2 { font-size: 9vw; }
  .guide { --g-radius: 2.25rem; --g-shell: 6px; }
}

/* a figure and its unit never part ("15.82 GB") */
.guide .nums { white-space: nowrap; }

/* ---------- connecting a USB: four chapters, each laid out for what it has to show ---------- */

.u-hero { position: relative; isolation: isolate; grid-column: 8 / span 5; justify-self: center; margin: 0; width: min(72%, 320px); }
.u-hero__front { position: relative; transform: rotate(3deg); }
.u-hero__back { position: absolute; inset: 7% auto auto -46%; z-index: -1; width: 88%; transform: rotate(-6deg); }

.u-need .g-need { padding-bottom: 0; }

.u-chapter { padding-block: clamp(80px, 10vw, 152px); scroll-margin-top: 24px; }
.u-head { margin-bottom: clamp(48px, 6vw, 88px); }
.u-head h2 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.045em; }
.u-chapter > .wrap > .u-head:only-child { margin-bottom: 0; }
.u-head .g-eyebrow + h2 { margin-top: 20px; }
.u-head h2 + p { margin-top: 20px; font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.015em; color: var(--c-muted); }

/* a step's words, under or over its screen */
.u-note h3, .g-step h3 { margin-top: 20px; }
.u-note h3 { font-size: clamp(1.625rem, 1.3rem + 1vw, 2.25rem); line-height: 1.05; letter-spacing: -0.035em; }
.u-note p:not(.g-eyebrow) { margin-top: 14px; max-width: 34ch; }
.g-step h3 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); line-height: 1; letter-spacing: -0.04em; }

/* connect: three screens read left to right, each a step lower than the last */
.u-trio { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); }
.u-trio > li { scroll-margin-top: 96px; }
.u-trio > li:nth-child(2) { margin-top: 72px; }
.u-trio > li:nth-child(3) { margin-top: 144px; }
.u-trio .g-phone { justify-self: start; }
.u-trio .u-note { margin-top: 36px; }

/* set up: the screen, then the decision it asks for */
.u-setup { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
.u-setup > .g-phone { grid-column: 1 / span 4; }
.u-setup__text { grid-column: 6 / span 7; }
.u-setup .u-head { margin-bottom: 40px; }
.u-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.u-choices .chip { margin-bottom: 20px; }
.u-aside { margin-top: 28px; color: var(--c-muted); }

/* the decision that matters: an ink card, its screen held inside it */
.u-delete-wrap { margin-top: clamp(48px, 6vw, 88px); scroll-margin-top: 96px; }
.u-delete { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; padding: clamp(32px, 5vw, 72px); }
.u-delete__text { grid-column: 1 / span 7; }
.u-delete h3 { margin-top: 20px; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); line-height: 1; letter-spacing: -0.04em; }
.u-delete .lead { margin-top: 24px; max-width: 34ch; color: rgb(250 250 250 / 0.82); }
.u-delete .g-phone { grid-column: 9 / span 4; }
.u-bezel--dark { background: linear-gradient(160deg, rgb(255 255 255 / 0.28), rgb(255 255 255 / 0.1)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 40px 80px -32px rgb(0 0 0 / 0.5); }

/* use: a screen and a desktop, unequal on purpose */
.u-bento { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.u-bento > li { scroll-margin-top: 96px; }
.u-bento > li:first-child { grid-column: 1 / span 4; }
.u-bento > li:last-child { grid-column: 6 / span 7; }
.u-bento .g-phone { justify-self: start; margin-top: 44px; }
.u-mac { margin: 44px 0 0; --g-radius: 2rem; }
.u-mac figcaption { margin-top: 20px; }

.u-end { padding-top: var(--section); }

@media (prefers-reduced-motion: no-preference) {
  .js .guide .u-note[data-reveal], .js .guide .u-mac[data-reveal] { transform: translateY(32px); transition: opacity 800ms var(--g-ease), transform 900ms var(--g-ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .guide .u-note[data-reveal].is-in, .js .guide .u-mac[data-reveal].is-in { transform: none; }
}

@media (max-width: 1080px) {
  .u-hero { grid-column: 9 / span 4; width: 100%; }
  .u-hero__back { left: -38%; }
  .u-setup > .g-phone { grid-column: 1 / span 5; }
  .u-setup__text { grid-column: 6 / span 7; }
  .u-choices { grid-template-columns: 1fr; }
  .u-delete__text { grid-column: 1 / span 7; }
  .u-delete .g-phone { grid-column: 8 / span 5; }
  .u-bento > li:first-child { grid-column: 1 / span 5; }
  .u-bento > li:last-child { grid-column: 6 / span 7; }
}

@media (max-width: 720px) {
  .u-hero { margin-top: 56px; margin-inline: auto; width: min(78vw, 300px); }
  .u-hero__back { display: none; }
  .u-hero__front { transform: none; }
  .u-chapter { padding-block: 72px; }
  .u-trio, .u-choices { grid-template-columns: 1fr; }
  .u-trio { gap: 64px; }
  /* every step reads the same way on a phone: its words, then its screen */
  .u-trio > li:nth-child(n) { margin-top: 0; display: flex; flex-direction: column-reverse; gap: 28px; }
  .u-trio .u-note { margin-top: 0; }
  .u-trio .g-phone, .u-bento .g-phone, .u-setup > .g-phone { width: min(78vw, 300px); margin-inline: auto; }
  .u-trio .g-phone { align-self: center; }
  .u-setup { display: flex; flex-direction: column; }
  .u-setup__text { display: contents; }
  .u-setup .u-head { order: -1; margin-bottom: 32px; }
  .u-setup > .g-phone { margin-bottom: 40px; }
  .u-delete, .u-bento { display: block; }
  .g-step h3 { font-size: 9vw; }
  .u-delete-wrap { margin-top: 72px; }
  .u-delete h3 { font-size: 9vw; }
  .u-delete .g-phone { margin-top: 40px; }
  .u-bento > li + li { margin-top: 72px; }
}
