/*
  ClipBirdy website: the one stylesheet.
  System fonts only, no external resources. Light and dark follow prefers-color-scheme.
  The accent is the app's brand colour "Iris" (Brand in src/Theme.swift, #5B5DE4); text on it
  and links use darker or lighter steps of it so that contrast stays at WCAG AA or better. The
  neutrals carry a trace of the same hue.
*/

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: #f7f8fd;
  --bg-alt: #eef0f8;
  --surface: #ffffff;
  --surface-2: #edeff7;
  --text: #1a1b1e;
  --muted: #575960;
  --border: #dee0e9;
  --border-strong: #caccd4;

  --brand: #5b5de4;          /* the icon and the app's own accent */
  --accent: #4947c5;         /* links and text in brand colour: 6.6:1 on --bg */
  --accent-soft: #e8e8fc;    /* tinted backgrounds */
  --on-button: #ffffff;
  --button: #4947c5;         /* white on it: 7.0:1 */
  --button-hover: #3b39a6;
  --good: #3f7a2a;

  --header-bg: rgba(247, 248, 253, 0.86);
  --shadow: 0 1px 2px rgba(20, 20, 50, 0.06), 0 8px 24px rgba(20, 20, 50, 0.08);
  --shadow-lg: 0 2px 6px rgba(20, 20, 50, 0.08), 0 24px 60px rgba(20, 20, 50, 0.16);
  --focus: #4947c5;

  --radius: 18px;
  --radius-sm: 10px;
  --container: 1120px;
  --gutter: 20px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121215;
    --bg-alt: #17181b;
    --surface: #191a1d;
    --surface-2: #222328;
    --text: #edeef6;
    --muted: #aaacb4;
    --border: #2f3037;
    --border-strong: #43454c;

    --accent: #adb8fe;         /* 9.9:1 on --bg */
    --accent-soft: #25264a;
    --on-button: #ffffff;
    --button: #5b5de4;         /* white on it: 5.1:1 */
    --button-hover: #4947c5;
    --good: #8fcb6e;

    --header-bg: rgba(18, 18, 21, 0.84);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.55);
    --focus: #adb8fe;
  }
}

/* ---------- Base ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

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

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.42em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--surface-2);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--on-button);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 800px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  min-height: 60px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 30px;
  height: 30px;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a,
.lang-switch {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.main-nav a:hover,
.lang-switch:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
}

/* Small screens: one row (brand, call to action, menu button); navigation and language move into a
   <details> menu that opens under the header. site.js closes it on a link, Escape or a click outside. */

.menu {
  display: none;
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 76px;
  }
  .header-inner {
    position: relative;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .header-inner > .main-nav,
  .header-inner > .lang-switch {
    display: none;
  }
  .menu {
    display: block;
  }
}

.menu summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  list-style: none;
  cursor: pointer;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu .menu-close,
.menu[open] .menu-open {
  display: none;
}

.menu[open] .menu-close {
  display: block;
}

.menu[open] summary {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 6px var(--gutter) 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 24px 40px rgba(20, 20, 50, 0.14);
}

.menu[open] .menu-panel {
  animation: menu-in 0.2s ease;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.menu-panel ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.menu-panel li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 2px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.menu-panel li a::after {
  content: "›";
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 400;
}

.menu-panel li a[aria-current="page"] {
  color: var(--accent);
}

.menu-panel .lang-switch {
  padding: 8px 14px;
  color: var(--text);
  font-size: 1rem;
}

/* ---------- App icon (404 page) ---------- */

.hero-icon {
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 18px 30px rgba(180, 80, 10, 0.28));
}

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

.download {
  max-width: 40rem;
  margin: 0 auto;
}

.get-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.get-list li {
  display: flex;
}

/* One look for both states: <span class="get is-soon"> now, <a class="get" href="..."> once live */
.get {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 232px;
  padding: 12px 20px 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  line-height: 1.25;
}

.get .icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.get-label {
  display: flex;
  flex-direction: column;
}

.get-channel {
  font-size: 1.05rem;
  font-weight: 650;
}

.get-state {
  color: var(--muted);
  font-size: 0.88rem;
}

.get.is-soon {
  border-style: dashed;
  box-shadow: none;
}

a.get {
  background: var(--button);
  border-color: var(--button);
  color: var(--on-button);
}

a.get .icon,
a.get .get-state {
  color: var(--on-button);
}

a.get:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
}

.requirements {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.section {
  padding: clamp(56px, 9vw, 104px) 0;
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 44rem;
  margin: 0 auto clamp(32px, 5vw, 52px);
  text-align: center;
}

.section-head p {
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* What leaves the Mac */

/* Four cards: one column, then two by two, then one row; never three plus an orphan. */
.flows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .flows {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .flows {
    grid-template-columns: repeat(4, 1fr);
  }
}

.flows li {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.flows h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
}

.flows h3 .icon {
  color: var(--good);
}

.flows p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.center {
  text-align: center;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--button);
  color: var(--on-button);
  font-weight: 600;
  text-decoration: none;
}

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

.button--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}

.button--ghost:hover {
  background: var(--surface-2);
}

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

/* ---------- Sub pages ---------- */

.page-hero {
  padding: clamp(40px, 7vw, 72px) 0 clamp(28px, 4vw, 40px);
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.25rem);
  margin-bottom: 0.3em;
}

.page-lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 38rem;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-body {
  padding-top: clamp(32px, 5vw, 48px);
  padding-bottom: clamp(56px, 8vw, 88px);
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin-top: 2em;
}

.prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose address {
  font-style: normal;
  margin-bottom: 1em;
}

.address-image {
  /* The postal address is an image, so it does not end up as text in search engines. */
  display: block;
  width: 137px;
  height: auto;
  margin-left: -2px;
}

@media (prefers-color-scheme: dark) {
  .address-image {
    filter: invert(1) brightness(0.92);
  }
}

.summary-box {
  margin-bottom: 32px;
  padding: 22px 24px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.summary-box h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.check-list {
  list-style: none;
  padding-left: 0 !important;
}

.check-list li {
  position: relative;
  padding-left: 1.7em;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.45em;
  width: 0.45em;
  height: 0.8em;
  border: solid var(--good);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.toc {
  margin-bottom: 8px;
  padding: 18px 24px 6px;
  border-left: 3px solid var(--brand);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.2em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface-2);
  font-weight: 650;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

@media (max-width: 480px) {
  th,
  td {
    padding: 8px 10px;
  }
}

.lang-note {
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

/* Support */

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.support-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.support-card h2 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

.support-card ul {
  padding-left: 1.2em;
  margin: 0;
  color: var(--muted);
}

.support-card p {
  color: var(--muted);
}

.support-card--mail {
  background: var(--accent-soft);
  border-color: transparent;
}

.mail-link {
  display: inline-block;
  margin: 2px 0 12px;
  font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  font-weight: 650;
}

.support-card--mail p {
  color: var(--text);
  margin: 0;
}

.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  position: relative;
  padding: 18px 44px 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.08rem;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq summary:hover {
  color: var(--accent);
}

.faq .answer {
  padding: 0 0 14px;
}

.faq .answer > :last-child {
  margin-bottom: 0.8em;
}

.prose h2.faq-group {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-size: 1.15rem;
  color: var(--muted);
  letter-spacing: 0;
}

/* ---------- 404 ---------- */

.not-found {
  padding: clamp(64px, 12vw, 140px) 0;
  text-align: center;
}

.not-found .hero-icon {
  width: 120px;
  height: 120px;
}

.not-found-code {
  display: block;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.not-found h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.not-found p {
  color: var(--muted);
  max-width: 34rem;
  margin-inline: auto;
}

.not-found .actions {
  margin-top: 28px;
}

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

.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

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

.footer-brand .brand {
  margin-bottom: 10px;
}

.footer-brand p {
  margin: 0 0 10px;
  max-width: 24rem;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.privacy-pill .icon {
  color: var(--good);
}

.site-footer h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 6px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 400px) {
  :root {
    --gutter: 16px;
  }
  .main-nav ul {
    gap: 0;
  }
  .main-nav a {
    padding: 4px 7px;
    font-size: 0.87rem;
  }
  .get {
    min-width: 0;
    width: 100%;
  }
  .get-list li {
    width: 100%;
  }
  .flows li,
  .support-card {
    padding: 20px;
  }
}
