/* Step-by-step guides (how-to-fix-iphone-full), 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);
}
.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 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; }
