:root {
  --muted: #6e6e73;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* Layout */

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.duo,
.how,
.details,
.promise {
  padding-block: clamp(88px, 11vw, 160px);
}

.how,
.details {
  padding-top: 0;
}

/* Hero overrides for landing.css */
.folio-page {
  aspect-ratio: auto;
  min-height: 0;
}

.app-name {
  color: var(--brand);
}

.duo {
  padding-top: clamp(32px, 4vw, 64px);
}

.section-head {
  max-width: 760px;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--brand);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.lead {
  margin: 24px 0 0;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.section-head--center .lead {
  max-width: 640px;
  margin-inline: auto;
}

/* Scroll reveal */

.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--delay, 0) * 90ms);
}

.reveal-on [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Made for iPhone Duo */

.duo-shot {
  position: relative;
  max-width: 940px;
  aspect-ratio: 940 / 548;
  margin: clamp(48px, 6vw, 88px) auto 0;
}

.duo-shot-frame {
  position: absolute;
  overflow: hidden;
}

.duo-shot-frame img {
  position: absolute;
  max-width: none;
}

.duo-shot-frame--explore {
  top: 0;
  left: 0;
  width: 75.43%;
  height: 92.15%;
}

.duo-shot-frame--explore img {
  top: -8.03%;
  left: -3.47%;
  width: 105.31%;
  height: 114.49%;
}

.duo-shot-frame--cover {
  top: 8.58%;
  left: 61.49%;
  width: 38.51%;
  height: 91.42%;
}

.duo-shot-frame--cover img {
  top: -3.31%;
  left: -5.59%;
  width: 110.98%;
  height: 107.64%;
}

/* How it works */

.how-scroller {
  --stage-height: min(76vh, 700px);
  --step-height: calc(var(--stage-height) * .62);
  --steps-pad: calc((var(--stage-height) - var(--step-height)) / 2);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(24px, 4vw, 48px);
}

.how-steps {
  margin: 0;
  padding: var(--steps-pad) 0;
  list-style: none;
}

.how-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--step-height);
  opacity: .22;
  transition: opacity .5s var(--ease-out);
}

.how-step.is-active {
  opacity: 1;
}

.how-step-number {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--brand);
}

.how-step h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.how-step p:last-child {
  max-width: 22em;
  margin: 16px 0 0;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.how-stage {
  position: sticky;
  top: calc((100vh - var(--stage-height)) / 2);
  height: var(--stage-height);
  border-radius: 32px;
  background: #f4f4f4;
  overflow: hidden;
}

.how-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  --exit: .28s;
  opacity: 0;
  transform: scale(.9);
  transition: opacity var(--exit) cubic-bezier(.4, 0, 1, 1), transform var(--exit) cubic-bezier(.4, 0, 1, 1);
}

/* Enter only after the outgoing visual has finished leaving, so they never overlap. */
.how-visual.is-active {
  opacity: 1;
  transform: none;
  transition: opacity .4s var(--ease-out) var(--exit), transform .55s var(--ease-out) var(--exit);
}

/* Screenshot frame: fits --ratio inside the stage. Crop modifiers trim the
   transparent margins baked into the exported PNGs. */
.how-shot {
  --ratio: 1.4;
  position: relative;
  width: min(81%, calc(var(--stage-height) * .77 * var(--ratio)));
  aspect-ratio: var(--ratio);
  overflow: hidden;
}

.how-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.how-shot--share {
  --ratio: .7251;
}

.how-shot--share img {
  inset: auto;
  top: -2.22%;
  left: -4.55%;
  width: 106.91%;
  height: 105.84%;
}

.how-shot--library {
  --ratio: .7255;
}

.how-shot--library img {
  inset: auto;
  top: -1.58%;
  left: -3.75%;
  width: 106.72%;
  height: 104.3%;
}

.how-shot--reader {
  --ratio: 1.2672;
}

.how-shot--reader img {
  inset: auto;
  top: -26.32%;
  left: -60.12%;
  width: 175.81%;
  height: 144.41%;
}

/* Details: bento */

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(300px, auto);
  gap: 20px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  border-radius: 28px;
  background: #f4f4f4;
  overflow: hidden;
}

.tile-text {
  position: relative;
  width: 100%;
}

.tile-label {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.0156em;
  color: var(--muted);
}

.tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.0068em;
  color: var(--ink);
  text-wrap: balance;
}

.tile-shot {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.tile-shot img {
  position: absolute;
  max-width: none;
}

/* Outside display */

.tile--outside {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
  justify-content: space-between;
}

.tile--outside h3 {
  max-width: 396px;
  font-size: clamp(30px, 3.2vw, 44px);
  letter-spacing: -.0127em;
}

.tile-shot--outside {
  width: min(312px, 100%);
  aspect-ratio: 312 / 432;
}

.tile-shot--outside img {
  top: -3.31%;
  left: -5.59%;
  width: 110.98%;
  height: 107.64%;
}

/* Themes */

.tile--themes {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.tile-shot--themes {
  position: absolute;
  top: -120px;
  right: 32px;
  width: 249px;
  height: 349px;
}

.tile-shot--themes img {
  top: -2.48%;
  left: -7.39%;
  width: 112.88%;
  height: 105.98%;
}

/* Magnifier */

.tile--zoom {
  grid-column: 3;
  grid-row: 2;
  justify-content: flex-start;
}

.tile--zoom .tile-visual {
  flex: 1;
}

.zoom-figure {
  display: block;
  font-family: var(--font-display);
  font-size: 140px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.06em;
  background: linear-gradient(145.5deg, #d39a6a 12.9%, #9e6138 54.6%, #6e3c1f 96.3%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tile--zoom h3 {
  max-width: 196px;
}

/* Streaks */

.tile--streak {
  grid-column: 4;
  grid-row: 2;
}

.tile--streak .tile-label {
  color: #a1a1a6;
}

.tile--streak h3 {
  max-width: 196px;
}

.streak-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  width: 311px;
  padding: 16px;
  border: 1px solid #e5e5ea;
  border-radius: 22px;
  overflow: hidden;
  font-family: var(--font-text);
}

.streak-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streak-summary p {
  margin: 0;
}

.streak-current {
  flex: 1;
  font-size: 22px;
  font-weight: 700;
  color: #000;
}

.streak-best {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 15px;
  font-weight: 590;
  white-space: nowrap;
  color: #000;
}

.streak-best span {
  font-size: 12px;
  font-weight: 400;
  color: rgba(60, 60, 67, .6);
}

.streak-week {
  display: flex;
  justify-content: space-between;
}

.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(60, 60, 67, .6);
}

.streak-day.is-today {
  font-weight: 700;
  color: #000;
}

.streak-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: rgba(118, 118, 128, .12);
}

.streak-dot.is-read {
  background: #ff9500;
}

.is-today .streak-dot {
  box-shadow: inset 0 0 0 2px #ff9500;
}

.streak-dot svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

/* Classics */

.tile--classics {
  grid-column: 1 / span 4;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 56px;
  padding: 40px 32px 0;
}

.tile--classics .tile-text {
  flex: 0 0 340px;
  padding-bottom: 40px;
}

.tile--classics h3 {
  font-size: clamp(30px, 2.8vw, 40px);
  letter-spacing: -.0107em;
}

.tile-shot--explore {
  position: absolute;
  top: 46.62px;
  left: 461px;
  width: 589px;
  height: 419px;
}

.tile-shot--explore img {
  top: -8.03%;
  left: -3.47%;
  width: 105.31%;
  height: 114.49%;
}

/* Promise and footer */

.promise {
  padding-top: 0;
  padding-bottom: clamp(20px, 2.5vw, 32px);
}

.promise-panel {
  padding: clamp(64px, 8vw, 104px) clamp(20px, 4vw, 56px) clamp(56px, 7vw, 88px);
  border-radius: clamp(28px, 3.5vw, 40px);
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.promise-head {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.promise h2 {
  max-width: 13em;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5.2vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.promise-lead {
  max-width: 520px;
  margin: 20px 0 0;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.45;
  color: rgb(255 255 255 / .88);
  text-wrap: balance;
}

/* Height is set from the download bar in download.js. */
.promise-dock-slot {
  height: 72px;
  margin-top: clamp(36px, 4.5vw, 52px);
}

.download-dock.is-docked {
  position: absolute;
  top: var(--dock-top);
  bottom: auto;
  transform: translate(-50%, -100%);
}

/* The frosted bar turns muddy over the accent panel, so it goes solid once docked. */
.download-dock .download-bar {
  transition: background-color .3s var(--ease-out);
}

.download-dock.is-docked .download-bar {
  background: #fff;
}

@media (max-width: 600px) {
  .download-dock .download-bar {
    transition: width .35s var(--ease-out), background-color .3s var(--ease-out);
  }

  .download-dock.is-docked .download-bar:not(.is-expanded) {
    width: calc(100vw - 72px);
  }
}

.site-footer {
  padding: 8px 0 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  font-size: 14px;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-social {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}

.footer-social a:hover {
  background: #f4f4f4;
  color: var(--ink);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-social .icon-instagram {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Small screens */

@media (max-width: 860px) {
  /* Plain stacked flow: each step's text is followed by its screenshot. */
  .how-scroller {
    --stage-height: 460px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .how-steps,
  .how-stage {
    display: contents;
  }

  .how-step {
    min-height: 0;
    padding-top: 40px;
    opacity: 1;
  }

  .how-step:first-child {
    padding-top: 0;
  }

  .how-step[data-step="1"] { order: 1; }
  .how-visual[data-step="1"] { order: 2; }
  .how-step[data-step="2"] { order: 3; }
  .how-visual[data-step="2"] { order: 4; }
  .how-step[data-step="3"] { order: 5; }
  .how-visual[data-step="3"] { order: 6; }

  .how-visual,
  .how-visual.is-active {
    position: static;
    margin-top: 24px;
    padding: 40px 0;
    border-radius: 24px;
    background: #f4f4f4;
    opacity: 1;
    transform: none;
    transition: none;
  }


  .bento {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .tile {
    padding: 26px;
    border-radius: 24px;
  }

  .tile--outside,
  .tile--themes,
  .tile--classics {
    grid-column: 1 / span 2;
    grid-row: auto;
  }

  .tile--zoom,
  .tile--streak {
    grid-column: auto;
    grid-row: auto;
  }

  .tile--themes {
    min-height: 340px;
  }

  .tile-shot--themes {
    right: 26px;
  }

  .tile--classics {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 26px 26px 0;
  }

  .tile--classics .tile-text {
    flex: none;
    padding-bottom: 0;
  }

  .tile-shot--explore {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: -150px;
  }
}

@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .tile--outside,
  .tile--themes,
  .tile--classics {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .folio-page h1 {
    font-size: clamp(40px, 10.4vw, 52px);
  }

  .promise h2 {
    font-size: 40px;
  }

  .section-head h2 {
    font-size: 28px;
  }

  .how-step h3 {
    font-size: 22px;
  }

  .tile h3,
  .tile--outside h3,
  .tile--classics h3 {
    font-size: 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-social {
    order: -2;
  }

  .footer-links {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .how-step,
  .how-visual,
  .how-visual.is-active {
    transition: none;
    transform: none;
  }
}
