/* Opus marketing site
   Phone styles are the base; tablet and desktop layer on at 800px and 1200px. */

:root {
  --bg: #FFFFFF;
  --bg-alt: #F5F5F7;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #86868B;
  --hairline: #E8E8ED;
  --footer-rule: #D2D2D7;
  --footer-link: #424245;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  /* Text links on --bg-alt: --accent only reaches 4.3:1 there, this reaches 5.1:1. */
  --link: #0066CC;
  --link-hover: #004C99;
  --bezel: #1D1D1F;
  --bezel-ring: #3A3A3C;
  --dot-off: #D2D2D7;
  --dot-on: #1D1D1F;

  --content: 1120px;
  --gutter: 24px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p {
  margin: 0;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Centres content at up to 1120px, with side gutters on narrow screens. */
.wrap {
  padding-inline: max(var(--gutter), calc((100% - var(--content)) / 2));
}

/* ---------- Nav ---------- */

.site-nav {
  height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  display: flex;
  align-items: center;
  color: var(--text);
  border-radius: 4px;
}

.wordmark svg {
  width: 60px;
  height: 16px;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: 72px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  text-align: center;
}

.app-icon {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFFFFF, #F2F2F4);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .06),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 18px 36px rgba(0, 0, 0, .12),
    0 4px 10px rgba(0, 0, 0, .06);
  color: var(--text);
}

.app-icon svg {
  width: 100%;
  height: 100%;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero h1 {
  /* 44px at 390px wide, scaling down so the first line stays whole at 320px. */
  font-size: min(44px, 11.25vw);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -.03em;
}

.hero h1 span {
  color: var(--text-3);
}

.hero-sub {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.42;
  color: var(--text-2);
  letter-spacing: -.01em;
  text-wrap: balance;
}

.button {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 30px;
  border-radius: 25px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.button:hover {
  background: var(--accent-hover);
}

/* ---------- Features ---------- */

.features {
  padding-block: 64px 56px;
  border-top: 1px solid var(--hairline);
}

/* Phone: a horizontal snap carousel, one feature per slide. */
.features-list {
  position: relative;
  margin: 0;
  padding: 8px 0 32px;
  list-style: none;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.features-list::-webkit-scrollbar {
  display: none;
}

/* The scroller is full bleed, so draw its focus ring inside the edges. */
.features-list:focus-visible {
  outline-offset: -2px;
}

/* Leading and trailing spacers let the first and last slides snap to the centre.
   Spacer + 20px gap = 50% - 132px (half a slide). Flex scrollers can drop end padding,
   so spacers are more reliable than padding-inline. */
.features-list::before,
.features-list::after {
  content: "";
  flex: 0 0 max(0px, calc(50% - 152px));
}

.feature {
  flex: 0 0 264px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.device {
  width: 264px;
  height: 553px;
  margin-bottom: 16px;
  padding: 8px;
  border-radius: 46px;
  background: var(--bezel);
  box-shadow:
    inset 0 0 0 1.5px var(--bezel-ring),
    0 24px 48px rgba(0, 0, 0, .10),
    0 6px 14px rgba(0, 0, 0, .05);
}

.screen {
  position: relative;
  width: 248px;
  height: 537px;
  border-radius: 38px;
  background: #FFFFFF;
  overflow: hidden;
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Dynamic Island */
.screen--island::after {
  content: "";
  position: absolute;
  top: 9px;
  left: calc(50% - 38px);
  width: 76px;
  height: 22px;
  border-radius: 11px;
  background: #000000;
}

.feature-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.feature-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feature-title svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.feature h3 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.01em;
}

.feature p {
  max-width: 264px;
  font-size: 17px;
  line-height: 1.47;
  color: var(--text-2);
  letter-spacing: -.01em;
  text-wrap: balance;
}

.dots {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--dot-off);
}

.dot.is-active {
  background: var(--dot-on);
}

/* ---------- Closing ---------- */

.closing {
  padding-block: 88px;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.closing h2 {
  max-width: 820px;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--link);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -.01em;
}

.text-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 16px 32px;
  background: var(--bg-alt);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

.footer-inner {
  padding-top: 14px;
  border-top: 1px solid var(--footer-rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

.footer-links a:hover {
  text-decoration: underline;
}

/* ---------- Text pages (privacy, support) ---------- */

.page {
  padding-block: 64px 96px;
}

.page-body {
  max-width: 680px;
  margin-inline: auto;
  font-size: 17px;
  line-height: 1.53;
  letter-spacing: -.01em;
}

.page h1 {
  font-size: 40px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.03em;
}

.page .lede {
  margin-top: 12px;
  color: var(--text-2);
}

.page h2 {
  margin-top: 48px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.015em;
}

.page p {
  margin-top: 16px;
}

.page .lede + p {
  margin-top: 32px;
}

.page ul {
  margin: 16px 0 0;
  padding-left: 1.25em;
}

.page li + li {
  margin-top: 8px;
}

.page-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-body a:hover {
  color: var(--link-hover);
}

/* ---------- Tablet and desktop ---------- */

@media (min-width: 800px) {
  :root {
    --gutter: 40px;
  }

  .site-nav {
    height: 56px;
  }

  .wordmark svg {
    width: 67px;
    height: 18px;
  }

  .hero {
    padding-block: 152px 160px;
    gap: 44px;
  }

  .app-icon {
    width: 168px;
    height: 168px;
    border-radius: 38px;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, .06),
      inset 0 1px 0 rgba(255, 255, 255, .9),
      0 24px 48px rgba(0, 0, 0, .12),
      0 6px 14px rgba(0, 0, 0, .06);
  }

  .hero-copy {
    gap: 28px;
  }

  .hero h1 {
    font-size: clamp(60px, 7.2vw, 88px);
    line-height: 1.02;
    letter-spacing: -.035em;
  }

  .hero-sub {
    font-size: 24px;
    line-height: 1.4;
  }

  .button {
    height: 52px;
    border-radius: 26px;
  }

  /* Tablet: 2 × 2 grid. The 24px floor lets four 264px columns fit from 1200px up. */
  .features {
    padding: 120px max(24px, calc((100% - 1184px) / 2)) 144px;
  }

  .features-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 264px);
    justify-content: center;
    column-gap: 64px;
    row-gap: 80px;
    overflow: visible;
  }

  .features-list::before,
  .features-list::after {
    content: none;
  }

  .dots {
    display: none;
  }

  .closing {
    padding-block: 120px;
    gap: 32px;
  }

  .closing h2 {
    font-size: clamp(48px, 5.4vw, 64px);
    line-height: 1.05;
  }

  .text-link {
    font-size: 21px;
  }

  .site-footer {
    padding-block: 20px 28px;
  }

  .footer-inner {
    padding-top: 16px;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
  }

  .footer-links {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .page {
    padding-block: 120px 144px;
  }

  .page h1 {
    font-size: 56px;
    line-height: 1.05;
  }
}

@media (min-width: 1200px) {
  .features-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: center;
    column-gap: 32px;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .button,
  .dot {
    transition: background-color .2s ease;
  }
}
