:root {
  --bg: #0b0f19;
  --surface: rgba(20, 25, 40, 0.85);
  --surface-strong: rgba(0, 0, 0, 0.3);
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #a0aec0;
  --accent: #8a2be2;
  --accent-2: #6366f1;
  --accent-hover: #9b4dff;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 18px;
  /* A phone turned to landscape must not inflate the text on its own. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100svh; /* the small viewport: does not jump when the phone's address bar hides */
  position: relative;
  overflow-x: hidden;
  /* Notch / rounded corners in landscape (needs viewport-fit=cover in the page's <meta name="viewport">). */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

button,
a,
select,
input {
  touch-action: manipulation; /* no double-tap-zoom delay on the controls */
}

body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.15), transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(65, 105, 225, 0.15), transparent 50%);
  animation: rotateBg 30s linear infinite;
}

@keyframes rotateBg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #8a2be2 58%, #f43f5e);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.22);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-text span {
  color: var(--accent);
}

.beta-badge {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 6px;
}

.download-nav,
.section-nav,
.social-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.download-nav {
  justify-content: center;
}

.section-nav {
  justify-content: flex-end;
}

.store-link,
.section-nav a,
.social-nav a {
  min-height: 44px; /* touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 8px 12px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.store-link:hover,
.section-nav a:hover,
.section-nav a.active,
.social-nav a:hover {
  border-color: rgba(138, 43, 226, 0.6);
  color: var(--text);
  background: rgba(138, 43, 226, 0.18);
}

.hero {
  display: grid;
  gap: 28px;
  padding: 42px 0 30px;
}

.hero-copy {
  max-width: 800px;
}

.eyebrow,
.panel-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  max-width: 880px;
  font-size: clamp(1.65rem, 3.4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
  margin-bottom: 18px;
}

.hero-copy p:last-child {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.transfer-panel,
.how-it-works,
.content-tabs {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.transfer-panel {
  border-radius: 8px;
  min-height: 390px;
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 1.7rem;
  margin-bottom: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  border-color: var(--accent);
  background: rgba(138, 43, 226, 0.25);
}

.icon-button:active {
  transform: scale(0.95);
}

.drop-zone {
  display: grid;
  min-height: 236px;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(138, 43, 226, 0.1);
}

.drop-zone p,
.status-text,
.code-card span,
.receive-form label,
.speed-text {
  color: var(--muted);
}

/* File names and error texts come from the user / the other device and can be one long word. */
.status-text,
.drop-zone p,
.code-card span,
.detail-page h3,
.detail-page p,
.steps p {
  overflow-wrap: anywhere;
}

.panel-header > div,
.transfer-panel {
  min-width: 0;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.primary-button:hover {
  background: var(--accent-hover);
  filter: none;
  transform: translateY(-1px);
}

.receive-form {
  display: grid;
  gap: 12px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: max(16px, 1rem); /* below 16 px iOS Safari zooms the page when the field gets focus */
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 7, 12, 0.4);
  color: var(--text);
  outline: 0;
  padding: 10px 12px;
}

.input-row input:focus {
  border-color: var(--accent);
}

.code-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 7, 12, 0.28);
  padding: 12px;
}

.progress-area {
  display: grid;
  gap: 14px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.speed-text {
  margin-bottom: 0;
  text-align: right;
}

/* Secondary, non-final line under a status (e.g. the public signaling server is in use). */
.notice-text {
  margin: 0;
  border-left: 3px solid var(--accent-2);
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}

[dir="rtl"] .notice-text {
  border-left: 0;
  border-right: 3px solid var(--accent-2);
}

.how-it-works,
.content-tabs {
  border-radius: 8px;
  margin: 18px 0;
  padding: 26px;
}

.content-tabs {
  display: grid;
  /* The one column must be allowed to shrink below its content: with the default `auto` track a long word in a narrow window (German
     "Verschluesselung" at 320 px) widened the whole column and every card with it. */
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.detail-page {
  scroll-margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 26px;
}

.detail-page {
  min-width: 0;
}

.detail-page li,
.detail-page summary,
.content-tabs h2 {
  overflow-wrap: anywhere;
}

.detail-page > p {
  max-width: 820px;
}

.detail-grid,
.qa-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.qa-list {
  grid-template-columns: 1fr;
}

.detail-grid section,
.qa-list section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.detail-grid h3,
.qa-list h3 {
  margin-bottom: 8px;
}

.section-heading {
  max-width: 720px;
}

.section-heading h2,
.content-tabs h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin-bottom: 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.steps article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.steps span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(138, 43, 226, 0.2);
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 12px;
}

.steps h3 {
  margin-bottom: 8px;
}

.steps p,
.content-tabs p {
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 0 34px;
}

/* The switch of the anonymous usage counters; its text is the title of the privacy card that explains them. */
.telemetry-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  color: var(--muted);
  cursor: pointer;
}

.telemetry-switch input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.telemetry-switch span {
  overflow-wrap: anywhere;
}

.language-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.language-picker select {
  min-height: 44px;
  font-size: max(16px, 1rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 8px 10px;
}

.hidden {
  display: none !important;
}

[dir="rtl"] .speed-text {
  text-align: left;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .download-nav,
  .section-nav {
    justify-content: flex-start;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .transfer-grid,
  .detail-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 22px;
  }

  .transfer-panel,
  .how-it-works,
  .detail-page {
    padding: 18px;
  }

  /* The panels no longer need to look tall on a phone, and a blurred backdrop plus the rotating layer cost battery. */
  .transfer-panel {
    min-height: 0;
  }

  .transfer-panel,
  .how-it-works,
  .content-tabs,
  .detail-page {
    backdrop-filter: none;
  }

  body::before {
    animation: none;
  }

  /* Five links do not fit in a row: one scrollable chip row instead of a wrapped block that pushes the app down. */
  .section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .section-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 16px, 1180px);
  }

  .site-header {
    padding: 14px 0;
    gap: 12px;
  }

  .hero {
    gap: 20px;
    padding: 14px 0 20px;
  }

  .transfer-panel,
  .how-it-works,
  .detail-page {
    padding: 14px;
  }

  .drop-zone {
    min-height: 180px;
    padding: 16px;
  }

  .panel-header h2 {
    font-size: 1.4rem;
  }

  .hero-copy p:last-child {
    font-size: 1rem;
    line-height: 1.6;
  }

  .language-picker {
    width: 100%;
    flex-wrap: wrap;
  }

  .language-picker select {
    flex: 1 1 160px;
    min-width: 0;
  }
}

/* A phone held sideways: very little height, so the first screen must not be mostly header and padding. */
@media (orientation: landscape) and (max-height: 500px) {
  .site-header {
    padding: 10px 0;
  }

  .hero {
    gap: 16px;
    padding: 10px 0 16px;
  }

  .hero h1 {
    margin-bottom: 10px;
  }

  .transfer-panel {
    min-height: 0;
  }

  .drop-zone {
    min-height: 130px;
    padding: 14px;
  }

  body::before {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
