/* The home page: a lot of air, the game's own screens, sections divided by hairlines. */

.kicker {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}

/* An iPhone: a thin black bezel inside a titanium band, the Dynamic Island, the status
   bar and the side buttons, round a real screen of the game. */
.iphone {
  --w: 260px;
  position: relative;
  margin: 0;
  width: var(--w);
  aspect-ratio: 1320 / 2868;
  padding: calc(var(--w) * 0.012);
  border-radius: calc(var(--w) * 0.18);
  background: linear-gradient(145deg, #5b5b5f, #2a2a2d 30%, #3d3d40 70%, #1f1f21);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Side buttons: action and volume on the left, power on the right. */
.iphone::before, .iphone::after {
  content: "";
  position: absolute;
  width: calc(var(--w) * 0.012);
  border-radius: 2px;
  background: #3a3a3d;
}
.iphone::before { left: calc(var(--w) * -0.009); top: 17%; height: 4%; box-shadow: 0 calc(var(--w) * 0.12) 0 #3a3a3d, 0 calc(var(--w) * 0.24) 0 #3a3a3d; }
.iphone::after { right: calc(var(--w) * -0.009); top: 26%; height: 10%; }

.iphone .screen {
  position: relative;
  width: 100%; height: 100%;
  border: calc(var(--w) * 0.03) solid #050505;
  border-radius: calc(var(--w) * 0.168);
  overflow: hidden;
  background: #fafaf9;
}

.iphone img { display: block; width: 100%; height: 100%; object-fit: cover; }

.iphone .island {
  position: absolute;
  top: 1.6%; left: 50%;
  width: 31%; height: 4%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}

.iphone .status {
  position: absolute;
  top: 2.2%; left: 0; right: 0;
  height: 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9%;
  color: #141414;
  font-size: calc(var(--w) * 0.05);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.iphone .status span { width: 22%; text-align: center; }
.iphone .status svg { width: 24%; height: auto; fill: currentColor; }

/* The first screen */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  max-width: var(--column);
  margin: 0 auto;
  padding: 130px 24px 110px;
}

.hero h1 { font-size: clamp(48px, 7vw, 92px); }
.hero .lede { margin: 22px 0 34px; }

.note { margin: 16px 0 0; font-size: 14px; color: var(--soft); }

.iphone.big { --w: min(330px, 74vw); justify-self: center; }

/* Sections */

.block {
  max-width: var(--column);
  margin: 0 auto;
  padding: 110px 24px;
  border-top: 1px solid var(--faint);
}

.block h2 { font-size: clamp(32px, 4.4vw, 52px); margin-bottom: 48px; }
.block h3 { margin: 0 0 10px; font-size: 24px; font-weight: 400; letter-spacing: -0.02em; }

.block ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.block li b, .access-grid b { display: block; font-weight: 500; margin-bottom: 4px; }
.block li span, .access-grid span { color: var(--soft); }

/* The signals, drawn as what the hand feels */
.signals svg {
  display: block;
  width: 100%; max-width: 160px;
  height: 44px;
  margin-bottom: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chapters svg {
  display: block;
  width: 28px; height: 28px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Four moments, each in its own iPhone with a line under it. */
.moments h2 { margin-bottom: 56px; }

.moment-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.moment { display: flex; flex-direction: column; align-items: center; text-align: center; }
.moment .iphone { --w: 210px; max-width: 100%; margin-bottom: 26px; }
.moment b { font-weight: 500; margin-bottom: 4px; }
.moment span { color: var(--soft); font-size: 15px; max-width: 24ch; }

/* A pulse drawn over a screen: rings spreading from a point and fading. */
.pulse { position: absolute; width: 0; height: 0; }
.pulse i {
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--w) * 0.5); height: calc(var(--w) * 0.5);
  margin: calc(var(--w) * -0.25) 0 0 calc(var(--w) * -0.25);
  border-radius: 50%;
  border: 1.5px solid rgba(20, 20, 20, 0.5);
  opacity: 0;
  transform: scale(0.15);
}

@media (prefers-reduced-motion: no-preference) {
  .pulse i { animation: ripple 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
  .pulse i:nth-child(2) { animation-delay: 0.8s; }
  .pulse i:nth-child(3) { animation-delay: 1.6s; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse i { opacity: 0.35; transform: scale(0.5); }
  .pulse i:nth-child(2) { transform: scale(0.8); opacity: 0.2; }
}

@keyframes ripple {
  0% { opacity: 0.8; transform: scale(0.15); }
  100% { opacity: 0; transform: scale(1.2); }
}

.points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.points p { margin: 0; color: var(--soft); }

/* Every day */
.daily {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.daily h2 { margin-bottom: 20px; }
.daily-words > p:not(.kicker) { margin: 0; max-width: 38ch; color: var(--soft); font-size: 18px; }
.daily-words > p.quote { margin-top: 28px; color: var(--ink); font-style: italic; }

.daily-pictures {
  position: relative;
  justify-self: center;
  width: min(380px, 86vw);
  height: 470px;
}

.daily-pictures .iphone {
  --w: 210px;
  position: absolute;
  left: 0; top: 0;
}

/* The small widget, as on the Home Screen */
.widget {
  --card: #ffffff;
  position: absolute;
  right: 0; bottom: 20px;
  width: 170px; height: 170px;
  padding: 22px 18px 18px;
  border-radius: 38px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--faint), 0 24px 60px rgba(0, 0, 0, 0.14);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  justify-items: center;
  align-content: center;
  row-gap: 4px;
  text-align: center;
}

.widget strong { grid-column: 1 / -1; font-size: 64px; font-weight: 200; line-height: 1; letter-spacing: -0.03em; }
.widget span { grid-column: 1 / -1; font-size: 12px; color: var(--soft); margin-bottom: 14px; }
.widget i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.widget i.on { background: var(--ink); }
.widget i.today { background: transparent; box-shadow: inset 0 0 0 1.2px var(--ink); }

/* White in either theme, as the widget is on a light Home Screen. */
.widget { color: #141414; --faint: rgba(20, 20, 20, 0.12); --soft: rgba(20, 20, 20, 0.56); --ink: #141414; }

/* For every hand */
.access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

/* Questions */
.faq h2 { margin-bottom: 24px; }

.faq details {
  max-width: 760px;
  border-bottom: 1px solid var(--faint);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 0;
  font-size: 20px;
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--soft); font-weight: 300; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 22px; max-width: 60ch; color: var(--soft); }

/* The end */
.finale { text-align: center; padding-bottom: 140px; }
.finale h2 { margin-bottom: 14px; font-size: clamp(40px, 6vw, 72px); }
.finale p { margin: 0 0 32px; color: var(--soft); }

/* A quiet arrival: things settle in once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .hero-words > *, .hero .iphone {
    animation: settle 0.9s cubic-bezier(.2, .7, .2, 1) both;
  }
  .hero-words > :nth-child(2) { animation-delay: 0.06s; }
  .hero-words > :nth-child(3) { animation-delay: 0.12s; }
  .hero-words > :nth-child(4) { animation-delay: 0.18s; }
  .hero-words > :nth-child(5) { animation-delay: 0.22s; }
  .hero .iphone { animation-delay: 0.2s; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 110px; gap: 56px; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .block { padding: 72px 24px; }
  .block ul, .access-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .points, .daily { grid-template-columns: 1fr; gap: 36px; }
  .moment-row { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
  .moment .iphone { --w: min(170px, 40vw); }
  .daily-pictures { height: 430px; }
}

/* No capitals to raise in Japanese, Korean or Chinese; keep "iPhone" as it is written. */
:lang(ja) .kicker, :lang(ko) .kicker, :lang(zh) .kicker { text-transform: none; letter-spacing: 0.08em; }

/* The maze to try, in the first screen's phone. */
.try .screen { touch-action: none; }
.try canvas { position: absolute; left: 0; top: 7%; width: 100%; height: 91%; display: block; outline: none; cursor: grab; }
.try canvas:active { cursor: grabbing; }
.try canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(20, 20, 20, 0.3); }
.try-hint {
  position: absolute; left: 0; right: 0; bottom: 6%;
  margin: 0; text-align: center;
  font-size: calc(var(--w) * 0.042); color: rgba(20, 20, 20, 0.55);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.try.moved .try-hint { opacity: 0; }
.try-done {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10%;
  background: rgba(250, 250, 249, 0.92);
  text-align: center; color: #141414;
  font-size: calc(var(--w) * 0.045);
  animation: settle 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
.try-done[hidden] { display: none; }
.try-done p { margin: 0; color: rgba(20, 20, 20, 0.6); }
.try-done .try-found { font-size: calc(var(--w) * 0.075); color: #141414; letter-spacing: -0.02em; margin-bottom: 2px; }
.try-done .store { margin: 14px 0 6px; }
/* The phone's screen is always light, so its badge is always the black one. */
:root .try .try-done .store .light { display: inline; }
:root .try .try-done .store .dark { display: none; }
.try-again { border: 0; background: none; color: rgba(20, 20, 20, 0.6); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 10px; }
