/*
 * The Links homepage, drawn in Nocturne — the app's own design system.
 *
 * Values are lifted from src/theme/nocturne.ts so the page and the screenshots
 * on it are the same palette. Inter is self-hosted from /fonts (OFL), because
 * a page that promises "coordinates never reach us" should not ship its
 * readers' IP addresses to a font CDN. The app is dark-only, and so is this
 * page: the screenshots would look wrong on anything else.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  --bg: #161826;
  --chrome: #1a1c29;
  --raised: #1e2030;
  --surface: #232532;
  --surface-alt: #262838;
  --track: #2c2e3d;

  --ink: #e9e9ed;
  --ink-2: rgba(233, 233, 237, 0.6);
  --ink-3: rgba(233, 233, 237, 0.5);
  --ink-4: rgba(233, 233, 237, 0.4);

  --line: rgba(233, 233, 237, 0.07);
  --line-strong: rgba(233, 233, 237, 0.12);

  --accent: #9184d9;
  --accent-bright: #b5abfc;
  --accent-text: #d2cefd;
  --accent-fill: rgba(145, 132, 217, 0.12);
  --accent-border: rgba(145, 132, 217, 0.3);
  --accent-glow: rgba(145, 132, 217, 0.35);

  --ok: #6fbe95;

  --r-card: 14px;
  --r-lg: 16px;
  --r-sheet: 22px;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  left: 1rem;
}

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

/* ---------- Type ---------- */

h1 {
  font-weight: 600;
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h1 .line {
  display: block;
}

h1 em {
  font-style: normal;
  color: var(--accent-bright);
}

h2 {
  font-weight: 600;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h3 {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
  max-width: 34rem;
}

.micro {
  font-size: 0.85rem;
  color: var(--ink-4);
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark {
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}

/* The dotless ı carries a blurple ping in place of its tittle. */
.wordmark .tittle {
  position: relative;
}
.wordmark .tittle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.08em;
  width: 0.19em;
  height: 0.19em;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #12111f;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  box-shadow: 0 0 0 1px rgba(145, 132, 217, 0.4), 0 8px 28px -8px var(--accent-glow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(181, 171, 252, 0.5), 0 14px 36px -8px var(--accent-glow);
}
.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: var(--accent-fill);
  color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--accent-border) inset;
}
.btn-ghost:hover {
  background: rgba(145, 132, 217, 0.18);
  box-shadow: 0 0 0 1px var(--accent-border) inset;
}

.btn-small {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.btn-large {
  padding: 1rem 1.7rem;
  font-size: 1.05rem;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 24, 38, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink-2);
}
.nav-links a {
  transition: color 0.15s ease;
}
.nav-links a:hover {
  color: var(--ink);
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }
}

/* ---------- Sections ---------- */

section {
  position: relative;
  padding-block: clamp(4rem, 9vw, 7.5rem);
}

section + section {
  border-top: 1px solid var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-fill);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(111, 190, 149, 0.7);
}

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

.hero {
  padding-top: clamp(3rem, 7vw, 6rem);
  padding-bottom: 0;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 120%;
  background:
    radial-gradient(60% 55% at 72% 40%, rgba(145, 132, 217, 0.22), transparent 70%),
    radial-gradient(40% 40% at 20% 10%, rgba(86, 182, 187, 0.08), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-copy {
  display: grid;
  gap: 1.4rem;
  justify-items: start;
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.hero-device {
  display: flex;
  justify-content: center;
  align-self: end;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-copy {
    justify-items: center;
    padding-bottom: 2.5rem;
  }
  .cta-row {
    justify-content: center;
  }
  h1 .line {
    display: inline;
  }
}

/* ---------- Phone frame ---------- */

/*
 * The screenshots are 1320×2868 (iPhone 17 Pro Max) and include the status
 * bar, so the frame only has to supply a bezel, the corner radius and the
 * Dynamic Island. Radius is ~7.3% of the width on the real device.
 */
.phone {
  --w: 300px;
  width: var(--w);
  max-width: 100%;
  position: relative;
  padding: calc(var(--w) * 0.035);
  border-radius: calc(var(--w) * 0.155);
  background: linear-gradient(160deg, #3a3d4e, #1b1d29 60%, #2a2c3b);
  box-shadow:
    0 0 0 1px rgba(233, 233, 237, 0.08),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 90px -20px var(--accent-glow);
}

.phone-screen {
  position: relative;
  aspect-ratio: 1320 / 2868;
  border-radius: calc(var(--w) * 0.12);
  overflow: hidden;
  background: var(--bg);
}

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

/* Dynamic Island */
.phone-screen::before {
  content: '';
  position: absolute;
  top: calc(var(--w) * 0.035);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--w) * 0.27);
  height: calc(var(--w) * 0.078);
  border-radius: 999px;
  background: #000;
  z-index: 2;
}

.phone-hero {
  --w: clamp(260px, 28vw, 340px);
  margin-bottom: -18%;
  transform: rotate(-3deg) translateY(2%);
}

@media (max-width: 860px) {
  .phone-hero {
    --w: min(300px, 70vw);
    transform: none;
    margin-bottom: -22%;
  }
}

.phone-small {
  --w: 260px;
}

.phone figcaption {
  margin-top: 1.1rem;
  text-align: center;
  display: grid;
  gap: 2px;
}
.phone figcaption strong {
  font-weight: 600;
}
.phone figcaption span {
  color: var(--ink-3);
  font-size: 0.95rem;
}

/* ---------- Showcase ---------- */

.showcase {
  background: linear-gradient(180deg, var(--chrome), var(--bg) 40%);
  padding-top: clamp(6rem, 14vw, 10rem);
  border-top: 1px solid var(--line);
}

.showcase h2 {
  text-align: center;
  text-wrap: balance;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.phones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  justify-items: center;
  align-items: start;
}

.phones .phone {
  --w: clamp(220px, 24vw, 280px);
}

.phones .phone:nth-child(2) {
  margin-top: clamp(1rem, 4vw, 3rem);
}

@media (max-width: 760px) {
  .phones {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .phones .phone {
    --w: min(280px, 72vw);
  }
  .phones .phone:nth-child(2) {
    margin-top: 0;
  }
}

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

.features h2,
.how h2 {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

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

.card {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8), 0 0 40px -20px var(--accent-glow);
}

.card p {
  color: var(--ink-2);
  font-size: 0.97rem;
}

.icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 11px;
  background: var(--accent-fill);
  border: 1px solid rgba(145, 132, 217, 0.22);
  stroke: var(--accent-bright);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 1.6rem 1.5rem 1.6rem;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
}

.step p {
  color: var(--ink-2);
  font-size: 0.97rem;
}

.step-n {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #12111f;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 0 20px -4px var(--accent-glow);
}

/* Connector between steps on wide screens */
@media (min-width: 761px) {
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.65rem;
    right: -1rem;
    width: 1rem;
    height: 1px;
    background: var(--accent-border);
  }
}

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

/* ---------- Privacy ---------- */

.privacy {
  background:
    radial-gradient(50% 60% at 15% 50%, rgba(145, 132, 217, 0.12), transparent 70%),
    var(--bg);
}

.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.privacy-grid h2 {
  margin-bottom: 1rem;
}

.checks {
  display: grid;
  gap: 0.9rem;
}

.checks li {
  position: relative;
  padding-left: 2.1rem;
  color: var(--ink-2);
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(111, 190, 149, 0.15);
  border: 1px solid rgba(111, 190, 149, 0.35);
}
.checks li::after {
  content: '';
  position: absolute;
  left: 7px;
  top: calc(0.2em + 5px);
  width: 5px;
  height: 9px;
  border: solid var(--ok);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

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

/* ---------- Access / CTA ---------- */

.access {
  overflow: hidden;
}

.access-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.access .phone {
  justify-self: center;
  transform: rotate(3deg);
}

.access-copy {
  display: grid;
  gap: 1.2rem;
  justify-items: start;
}

@media (max-width: 760px) {
  .access-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .access-copy {
    justify-items: center;
  }
  .access .phone {
    --w: min(240px, 60vw);
    transform: none;
    order: 2;
  }
}

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

.foot {
  border-top: 1px solid var(--line);
  background: var(--chrome);
  padding-block: 2rem;
  font-size: 0.9rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.foot-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.foot-brand .wordmark {
  font-size: 1.1rem;
}
.by {
  color: var(--ink-4);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  color: var(--ink-3);
}
.foot-links a:hover {
  color: var(--ink);
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-delay {
  transition-delay: 0.12s;
}
.reveal-delay-2 {
  transition-delay: 0.24s;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .card {
    transition: none;
  }
}
