/* ClashBaseLink for iPhone and iPad: landing page.
   Light only, Apple-style type, and the app's accent color. */

:root {
  --accent: #d6146f;            /* The app's AccentColor (light). */
  --accent-pressed: #b80f5e;
  --accent-tint: #fdeef5;       /* Accent at about 8%, like the app's join card. */
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --background: #ffffff;
  --background-alt: #f5f5f7;
  --separator: #d2d2d7;
  --bezel: #1d1d1f;
  --radius-card: 28px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(44px, 7vw, 80px); letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.03em; }
h3 { font-size: 21px; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }

.eyebrow {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
}

p { text-wrap: pretty; }

.lead {
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.4;
  color: var(--text-secondary);
}

.fine-print { font-size: 14px; color: var(--text-secondary); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
}
.skip-link:focus { top: 12px; }

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

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}
.button:hover { background: var(--accent-pressed); text-decoration: none; }
.button:active { transform: scale(0.97); }
.button--small { min-height: 32px; padding: 0 14px; font-size: 14px; }
.button--secondary { background: var(--accent-tint); color: var(--accent); }
.button--secondary:hover { background: #fadbe9; }

.store-badge {
  display: inline-block;
  border-radius: 10px;
  min-width: 150px;
  min-height: 50px;
}
.store-badge img { width: 150px; height: 50px; }
.store-badge:hover { text-decoration: none; opacity: 0.85; }
/* If Apple's badge can't load, a plain black button stands in. */
.store-badge--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: #000;
  color: #fff;
  font-weight: 600;
}
.store-badge--fallback img { display: none; }
.store-badge--fallback::after { content: "Download on the App Store"; }

.text-link { font-weight: 600; }

.round-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s, transform 0.2s;
}
.round-button:hover { background: rgba(0, 0, 0, 0.1); }
.round-button:active { transform: scale(0.94); }
.round-button:disabled { opacity: 0.35; cursor: default; transform: none; }
.round-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  height: 52px;
  margin: 0 auto;
  padding: 0 22px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-weight: 600;
}
.nav__brand:hover { text-decoration: none; }
.nav__brand img { border-radius: 7px; }
.nav__links { display: flex; gap: 24px; font-size: 14px; }
.nav__links a { color: var(--text); opacity: 0.8; }
.nav__links a:hover { opacity: 1; text-decoration: none; }

/* Device frames. Each frame is a size container, so the bezel and corners on
   its screenshot scale with it (cqi = 1% of the frame's width). */

.iphone,
.duo-device,
.ipad {
  container-type: inline-size;
  position: relative;
}
.iphone img,
.duo-device img,
.ipad img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 3.4cqi solid var(--bezel);
  border-radius: 16cqi;
  box-shadow:
    0 0 0 1.5px #b9b9be,
    0 30px 60px -20px rgba(0, 0, 0, 0.35),
    0 18px 36px -18px rgba(0, 0, 0, 0.3);
}
/* The Dynamic Island, sized to iPhone 18 Pro's. */
.iphone::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 6.5cqi;
  left: 50%;
  width: 22.2cqi;
  height: 8.6cqi;
  transform: translateX(-50%);
  border-radius: 4.3cqi;
  background: #000;
}
.iphone figcaption {
  margin-top: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.duo-device img {
  border-width: 1.5cqi;
  border-radius: 4cqi;
  box-shadow:
    0 0 0 1.5px #b9b9be,
    0 40px 80px -30px rgba(0, 0, 0, 0.35);
}
.duo-device--closed img { border-width: 3cqi; border-radius: 11cqi; }

/* iPad Pro: an even, thin bezel and no Dynamic Island. */
.ipad img {
  border-width: 2.6cqi;
  border-radius: 5.2cqi;
  box-shadow:
    0 0 0 1.5px #b9b9be,
    0 40px 80px -30px rgba(0, 0, 0, 0.35);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
  overflow-x: clip;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 22px 40px;
  text-align: center;
}
.hero__icon {
  margin: 0 auto 22px;
  border-radius: 22.5%;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.35);
}
.hero h1 { margin-bottom: 20px; }
.hero .lead { max-width: 800px; margin: 0 auto; text-wrap: balance; }
.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}
.hero__phones {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}
.hero__phones .iphone--center { width: min(300px, 62vw); z-index: 2; }
.hero__phones .iphone--side { width: min(250px, 44vw); opacity: 0.98; }
.hero__phones .iphone--left { margin-right: -60px; transform: translateY(-24px) rotate(-6deg); }
.hero__phones .iphone--right { margin-left: -60px; transform: translateY(-24px) rotate(6deg); }

/* Stats */

.stats { padding: 24px 22px 40px; }
.stats__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}
.stats__list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 28px 12px;
  text-align: center;
}
.stats__list strong { font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.02em; }
.stats__list span { font-size: 15px; color: var(--text-secondary); }

/* Features */

.feature {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  align-items: center;
  gap: 72px;
  max-width: 920px;
  margin: 0 auto;
  padding: 96px 22px;
}
.feature--flip { grid-template-columns: minmax(240px, 320px) 1fr; }
.feature--flip .feature__text { order: 2; }
.feature__text h2 { margin-bottom: 18px; }
.feature__text > p:not(.eyebrow) { font-size: 19px; color: var(--text-secondary); }
.feature__text--center { max-width: 720px; margin: 0 auto 64px; text-align: center; }

.feature--wide { display: block; max-width: var(--max); }

.checks { margin: 20px 0 0; padding: 0; list-style: none; }
.checks li {
  position: relative;
  padding: 7px 0 7px 32px;
  font-size: 19px;
  color: var(--text-secondary);
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.2 8.6 13l5.9-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

.phone-pair {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 72px);
}
.phone-pair .iphone { width: min(300px, 42vw); }

/* Card grid */

.grid-section {
  padding: 96px 22px;
  background: var(--background-alt);
}
.section-title { max-width: var(--max); margin: 0 auto 40px; text-align: center; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.card {
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--background);
}
.card__icon {
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 16px; color: var(--text-secondary); }

/* iPhone Duo */

.duo {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 22px 96px;
}
.duo__intro { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.duo__intro h2 { margin-bottom: 18px; }
.duo__modes {
  display: grid;
  grid-template-columns: 0.62fr 1fr 1fr;
  align-items: end;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.duo-mode h3 { margin: 24px 0 6px; }
.duo-mode p { font-size: 16px; color: var(--text-secondary); }
.duo-mode .duo-device--closed { max-width: 220px; }

/* iPad */

.ipad-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 22px 120px;
}
.ipad-section__intro { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.ipad-section__intro h2 { margin-bottom: 18px; }
.ipad-views {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ipad-view h3 { margin: 24px 0 6px; }
.ipad-view p { font-size: 16px; color: var(--text-secondary); }

/* Side by side is a landscape iPad: first, full width, centered. The two
   portrait iPads sit under it, two across. */
.ipad-views { grid-template-columns: repeat(2, 1fr); gap: 56px 40px; }
.ipad-view { text-align: center; }
.ipad-view .ipad { max-width: 380px; margin: 0 auto; }
.ipad-view--wide { grid-column: 1 / -1; order: -1; }
.ipad-view--wide .ipad { max-width: 880px; }
/* Same bezel as the portrait frames: their 2.6% and 5.2% of the short side,
   which is 3/4 of a landscape frame's width. */
.ipad--landscape img { border-width: 1.95cqi; border-radius: 3.9cqi; }

/* Members */

.members { padding: 0 22px 96px; }
.members__card {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 290px);
  align-items: center;
  gap: 64px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px clamp(28px, 6vw, 88px);
  border-radius: 36px;
  background: var(--accent-tint);
}
.members__text h2 { margin-bottom: 18px; }
.members__text > p:not(.eyebrow):not(.fine-print) { font-size: 19px; color: var(--text-secondary); }
.members__text .fine-print { margin-top: 20px; }
.members__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 28px;
}

/* Gallery */

.gallery { padding: 96px 0; background: var(--background-alt); }
.gallery .section-title { padding: 0 22px; }
.gallery__scroller {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  padding: 8px max(22px, calc((100vw - var(--max)) / 2)) 40px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 max(22px, calc((100vw - var(--max)) / 2));
  scrollbar-width: none;
}
.gallery__scroller::-webkit-scrollbar { display: none; }
.gallery__controls {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
}
.gallery__controls[hidden] { display: none; }
.gallery__scroller .iphone {
  flex: 0 0 auto;
  width: min(250px, 62vw);
  scroll-snap-align: start;
}

/* Creator code */

.creator { padding: 96px 22px; }
.creator__card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.creator__card h2 { margin-bottom: 18px; }
.creator__card > p:not(.eyebrow):not(.copy-status) { font-size: 19px; color: var(--text-secondary); }
.code {
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
}
.creator__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.copy-status { min-height: 22px; margin-top: 12px; font-size: 15px; color: var(--text-secondary); }

/* Final call to action */

.cta {
  padding: 96px 22px 120px;
  text-align: center;
  border-top: 1px solid var(--separator);
}
.cta__icon {
  margin: 0 auto 28px;
  border-radius: 22.5%;
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.4);
}
.cta h2 { margin-bottom: 12px; }
.cta .lead { margin-bottom: 32px; }

/* Footer */

.footer { background: var(--background-alt); font-size: 12px; color: var(--text-secondary); }
.footer__inner {
  display: grid;
  gap: 10px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 22px 40px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 8px; font-size: 13px; }
.footer__links a { color: var(--text); }

/* Screenshots that open bigger when tapped. The script wraps each picture in
   a button. */

.zoom-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: zoom-in;
  border-radius: 16cqi;
}
.duo-device .zoom-button { border-radius: 4cqi; }
.ipad .zoom-button { border-radius: 5.2cqi; }
.ipad--landscape .zoom-button { border-radius: 3.9cqi; }

.lightbox {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox[open] {
  display: grid;
  place-items: center;
  animation: lightbox-in 0.2s ease-out;
}
.lightbox::backdrop {
  background: rgba(245, 245, 247, 0.86);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.lightbox form { display: contents; }
.lightbox__image {
  max-width: min(92vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.4);
  cursor: zoom-out;
}
.lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  background: rgba(0, 0, 0, 0.08);
}
@keyframes lightbox-in {
  from { opacity: 0; }
}

/* Scroll reveal, only when motion is welcome and the script runs. */

/* One simple fade as each section comes on screen. */
.js .reveal {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
.js .reveal.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lightbox[open] { animation: none; }
  .js .reveal { opacity: 1; transition: none; }
}

/* Narrower screens */

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .duo__modes { grid-template-columns: 1fr 1fr; }
  .duo-mode:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 160px 1fr; gap: 0 28px; align-items: center; }
  .duo-mode:first-child h3 { margin-top: 0; }
  .duo-mode:first-child .duo-device { grid-row: span 2; }
  .duo-mode:first-child h3 { align-self: end; }
  .duo-mode:first-child p { align-self: start; }
}

@media (max-width: 734px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .hero { padding-top: 48px; gap: 40px; }
  .hero__phones .iphone--left { margin-right: -22vw; }
  .hero__phones .iphone--right { margin-left: -22vw; }
  .hero__phones .iphone--side { width: 38vw; }
  .hero__phones .iphone--center { width: 58vw; }
  .stats__list { grid-template-columns: repeat(2, 1fr); }
  .stats__list li { padding: 20px 8px; }
  .feature,
  .feature--flip {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 72px 22px;
    text-align: center;
  }
  .feature--flip .feature__text { order: 0; }
  .feature__phone { width: min(280px, 72vw); margin: 0 auto; }
  .checks { display: inline-block; text-align: left; }
  .phone-pair { gap: 16px; }
  .phone-pair .iphone { width: 44vw; }
  .phone-pair figcaption { font-size: 13px; }
  .grid-section, .duo, .gallery, .creator { padding-top: 72px; padding-bottom: 72px; }
  .card-grid { grid-template-columns: 1fr; }
  .duo__modes { grid-template-columns: 1fr; gap: 48px; margin-top: 0; }
  .duo-mode:first-child { grid-template-columns: 120px 1fr; }
  .ipad-section { padding-top: 0; padding-bottom: 96px; }
  /* Side by side first and full width, then the other two in a row. */
  .ipad-views { grid-template-columns: 1fr 1fr; gap: 40px 16px; }
  .ipad-view--wide .ipad { width: 100%; }
  .ipad-view h3 { margin-top: 18px; font-size: 19px; }
  .ipad-view p { font-size: 15px; }
  .members__card {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 56px 24px;
    text-align: center;
  }
  .members__phone { width: min(260px, 66vw); margin: 0 auto; }
  .members__actions { justify-content: center; }
}
