/* The app's design system on the web: the tokens from global.css, Plus Jakarta Sans for
   titles and headline numbers, the system font for everything else, and Panel as the one
   container. DESIGN.md has the principles. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/800ExtraBold/PlusJakartaSans_800ExtraBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/700Bold/PlusJakartaSans_700Bold.ttf') format('truetype');
}

:root {
  --background: #f5f8fc;
  --foreground: #14263d;
  --card: #ffffff;
  --primary: #075bd6;
  --primary-foreground: #ffffff;
  --secondary: #eaf3ff;
  --secondary-foreground: #0a52bf;
  --muted: #eff3f8;
  --muted-foreground: #5f6e82;
  --border: #e3e9f1;
  --ring: #8fb8f2;
  --positive: #137a35;
  --sky-top: #3d9fff;
  --sky-middle: #a9d6ff;

  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --panel-radius: 24px;
  --gutter: 20px;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

/* ---------- Top bar ---------- */

.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

/* ---------- Buttons: the app's pills ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition-property: background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.button:active {
  scale: 0.96;
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.button-primary:hover {
  background: #0650bd;
}

.button-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.button-secondary:hover {
  background: #dcebff;
}

.button-small {
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.button-onsky {
  background: rgb(255 255 255 / 0.9);
  color: var(--foreground);
}

.button-onsky:hover {
  background: #ffffff;
}

/* Pictures of buttons inside the app examples: they look like buttons but do nothing. */
.button-static {
  height: 44px;
  font-size: 15px;
  pointer-events: none;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Hero: the cloud island on its sky ---------- */

.hero {
  position: relative;
  overflow-x: clip;
  padding: 80px var(--gutter) 0;
  text-align: center;
}

.sky {
  position: absolute;
  inset: 0 0 auto;
  height: calc(80px + var(--island-px) * 1.25);
  /* Fades out entirely, glow included, so no edge shows where the sky meets the page. */
  mask-image: linear-gradient(#000 55%, transparent);
  background:
    radial-gradient(
      circle at 50% calc(80px + var(--island-px) * 0.42),
      rgb(255 255 255 / 0.7),
      rgb(255 255 255 / 0) calc(var(--island-px) * 0.75)
    ),
    linear-gradient(var(--sky-top), var(--sky-middle) 50%, var(--background));
}

.hero,
.island {
  --s: 1;
  --island-px: calc(170px * var(--s));
}

.island {
  position: relative;
  /* Clips the mascot as it rises, so it comes up out of the clouds rather than through them. */
  overflow: clip;
  height: calc(var(--island-h) * var(--s) * 1px);
}

.layer {
  position: absolute;
  left: calc(50% + (var(--x) - var(--w) / 2) * var(--s) * 1px);
  bottom: calc(var(--b) * var(--s) * 1px);
  width: calc(var(--w) * var(--s) * 1px);
  height: calc(var(--h) * var(--s) * 1px);
}

@media (min-width: 720px) {
  .hero,
  .island {
    --s: 1.45;
  }
}

@media (min-width: 1100px) {
  .hero,
  .island {
    --s: 1.7;
  }
}

/* One orchestrated moment on load: the clouds settle and the mascot pops up between them. */
@media (prefers-reduced-motion: no-preference) {
  .layer {
    animation: settle 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .layer-cloud-back-left,
  .layer-cloud-small-a:nth-child(3) {
    --from: -18px;
  }
  .layer-cloud-back-right,
  .layer-cloud-small-b {
    --from: 18px;
  }
  .layer-mascot {
    animation: pop 800ms cubic-bezier(0.2, 0.9, 0.25, 1.15) 160ms both;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    translate: var(--from, 0) 10px;
  }
}

@keyframes pop {
  from {
    translate: 0 75%;
  }
}

.hero-text {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  margin-top: 40px;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(2.75rem, 1.4rem + 5.6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 36ch;
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.5;
}

.hero-card {
  position: relative;
  max-width: 400px;
  margin: 64px auto 0;
  text-align: left;
}

/* ---------- The app's components ---------- */

.panel {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
}

.muted {
  color: var(--muted-foreground);
  font-size: 15px;
}

.footnote {
  color: var(--muted-foreground);
  font-size: 13px;
  text-align: center;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.headline-number {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 48px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.esim-card {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.esim-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.esim-card-label {
  flex: 1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
}

.esim-card-balance {
  display: grid;
  gap: 4px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  vertical-align: 1px;
  white-space: nowrap;
}

.tag-positive {
  background: rgb(19 122 53 / 0.12);
  color: var(--positive);
}

.tag-brand {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 20px;
}

.row + .row,
.row-divided {
  border-top: 1px solid var(--border);
}

.row-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.row-title {
  font-size: 16px;
}

.row-subtitle {
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 18px;
}

.row-value {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.flag {
  font-size: 26px;
  line-height: 32px;
}

.section-label {
  display: block;
  margin: 0 4px 12px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  display: grid;
  flex: 1;
  place-items: center;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 15px;
  font-weight: 500;
}

.chip-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

/* An on switch, drawn as the app's: Action Blue track, white knob. */
.switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--primary);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.15);
}

.chevron {
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-top: 2px solid rgb(95 110 130 / 0.6);
  border-right: 2px solid rgb(95 110 130 / 0.6);
  rotate: 45deg;
}

/* ---------- Ideas: the onboarding pages, each with the app showing it ---------- */

.ideas {
  display: grid;
  gap: 96px;
  max-width: 1040px;
  margin: 128px auto 0;
  padding: 0 var(--gutter);
}

.idea {
  display: grid;
  gap: 32px;
  align-items: center;
}

.idea-art {
  position: relative;
  width: min(300px, 80vw);
  margin: 0 auto;
}

/* The pale sky disc the app draws behind every illustration. */
.idea-art::before {
  content: '';
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: var(--secondary);
}

.idea-art img {
  position: relative;
  width: 100%;
  height: auto;
}

.idea-text {
  display: grid;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto;
}

.idea h2 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.idea p {
  color: var(--muted-foreground);
  font-size: 18px;
}

.proof {
  margin-top: 16px;
}

.proof-stack {
  display: grid;
  gap: 12px;
}

@media (min-width: 860px) {
  .idea {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  .idea-art {
    width: min(400px, 100%);
  }
  .idea:nth-child(even) .idea-art {
    order: 2;
  }
  .idea-text {
    margin: 0;
  }
}

/* ---------- Download ---------- */

.cta {
  max-width: 600px;
  margin: 144px auto 0;
  padding: 0 var(--gutter);
}

.cta-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 24px 40px;
  text-align: center;
}

.cta-panel img {
  width: 180px;
  height: auto;
}

.cta-panel h2 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  letter-spacing: -0.035em;
}

.cta-panel p {
  max-width: 32ch;
  margin-bottom: 16px;
  color: var(--muted-foreground);
  font-size: 18px;
}

.provider {
  max-width: 60ch;
  margin: 24px auto 0;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 48px var(--gutter) 64px;
  font-size: 14px;
}

.footer a {
  text-underline-offset: 3px;
}

/* Keep phone layouts compact enough to reach the download and examples comfortably. */
@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }
  .bar {
    gap: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .brand {
    gap: 8px;
    font-size: 18px;
  }
  .button-small {
    flex: none;
    height: 44px;
    padding-inline: 14px;
    font-size: 14px;
  }
  .hero {
    padding-top: 76px;
  }
  .hero-text {
    gap: 16px;
    margin-top: 24px;
  }
  .hero h1 {
    max-width: 12ch;
    font-size: clamp(2.375rem, 10.5vw, 3rem);
    line-height: 1.08;
  }
  .hero-card {
    margin-top: 36px;
  }
  .downloads {
    flex-direction: column;
    align-self: stretch;
    width: 100%;
  }
  .downloads .button {
    width: 100%;
  }
  .ideas {
    gap: 64px;
    margin-top: 64px;
  }
  .idea {
    gap: 24px;
    min-width: 0;
  }
  .idea-art {
    width: min(240px, 68vw);
  }
  .idea-text {
    width: 100%;
    min-width: 0;
  }
  .idea p {
    font-size: 17px;
  }
  .row {
    gap: 10px;
    padding-inline: 16px;
  }
  .cta {
    margin-top: 72px;
    scroll-margin-top: 20px;
  }
  .cta-panel {
    padding: 20px 16px 28px;
  }
  .cta-panel img {
    width: 140px;
  }
  .footer {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-block: 32px max(32px, env(safe-area-inset-bottom));
  }
  .footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 359px) {
  .brand {
    font-size: 17px;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
}
