/*
 * ultronai.app: the app's own colours, from Theme.xcassets, so a page opened
 * inside the app reads as part of it. Light and dark follow the system, or
 * inside the app whatever theme the app is set to.
 */

:root {
  color-scheme: light dark;

  --background: #FFFFFF;
  --surface: #F4F4F7;
  --surface-raised: #EAEAEF;
  --separator: #E1E1E8;
  --content-primary: #0A0A0C;
  --content-secondary: #55555E;
  --content-tertiary: #8A8A93;
  --accent: #4F5BD5;
  --accent-muted: #E8EAFB;
  --accent-content: #FFFFFF;
  --glow: rgba(79, 91, 213, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0A0A0C;
    --surface: #151519;
    --surface-raised: #1F1F25;
    --separator: #2B2B33;
    --content-primary: #F5F5F7;
    --content-secondary: #9E9EA8;
    --content-tertiary: #6B6B75;
    --accent: #7C8CFF;
    --accent-muted: #23253A;
    --accent-content: #0A0A0C;
    --glow: rgba(124, 140, 255, 0.22);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  /* The paywall's glow: the accent, faded out from the top. */
  background-image: radial-gradient(640px 360px at 50% -140px, var(--glow), transparent 72%);
  background-repeat: no-repeat;
  color: var(--content-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

/* MARK: - Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--content-primary);
  font-weight: 600;
  font-size: 17px;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--separator);
}

.languages {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}

.languages a,
.languages span {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--content-secondary);
}

.languages a:hover {
  color: var(--content-primary);
  text-decoration: none;
}

.languages [aria-current] {
  background: var(--surface-raised);
  color: var(--content-primary);
}

/* MARK: - Documents */

.document {
  padding: 28px 0 8px;
}

.document h1 {
  margin: 0;
  /* "Политика конфиденциальности" has one long word that a 34-point line
     on the narrowest iPhone cannot hold. */
  font-size: clamp(28px, 8vw, 34px);
  overflow-wrap: break-word;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.updated {
  margin: 8px 0 0;
  color: var(--content-tertiary);
  font-size: 15px;
}

.lead {
  margin: 24px 0 0;
  color: var(--content-secondary);
  font-size: 18px;
}

.summary {
  margin: 28px 0 8px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--surface);
}

.summary-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document .summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document .summary li {
  position: relative;
  margin: 8px 0 0;
  padding-left: 28px;
}

.document .summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-muted);
}

.document .summary li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(0.32em + 4px);
  width: 4px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.document h2 {
  margin: 40px 0 8px;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
  scroll-margin-top: 16px;
}

.document h2 .number {
  display: inline-block;
  min-width: 1.6em;
  color: var(--content-tertiary);
  font-variant-numeric: tabular-nums;
}

.document p {
  margin: 10px 0 0;
}

.document ul {
  margin: 10px 0 0;
  padding-left: 1.3em;
}

.document li {
  margin: 6px 0 0;
}

.document li::marker {
  color: var(--accent);
}

.document strong {
  font-weight: 600;
}

/* Tables the way the app draws them in an answer. */
.table {
  margin: 14px 0 0;
  overflow-x: auto;
  border: 1px solid var(--separator);
  border-radius: 14px;
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.table th,
.table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--surface);
  color: var(--content-secondary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.table tr + tr td {
  border-top: 1px solid var(--separator);
}

.contact-card {
  margin: 14px 0 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--surface);
}

.contact-card p {
  margin: 2px 0 0;
}

/* MARK: - Footer */

.site-footer {
  margin-top: 56px;
  padding: 20px 0 max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--separator);
  color: var(--content-tertiary);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 10px;
}

.site-footer nav a {
  color: var(--content-secondary);
}

/* MARK: - Home */

.hero {
  padding: 48px 0 8px;
  text-align: center;
}

.hero .icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 0 0 1px var(--separator), 0 18px 60px var(--glow);
}

.hero h1 {
  margin: 24px 0 0;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero p {
  max-width: 480px;
  margin: 12px auto 0;
  color: var(--content-secondary);
  font-size: 19px;
}

.button {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-content);
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--surface);
}

.features svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.features h2 {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.features p {
  margin: 4px 0 0;
  color: var(--content-secondary);
  font-size: 15px;
  line-height: 1.45;
}

/* MARK: - Inside the app */

/*
 * The app shows these pages in a sheet with a title bar of its own, and marks
 * the page as it loads. The site's own header and footer would repeat it.
 */
.in-app body {
  background-image: none;
}

.in-app .site-header,
.in-app .site-footer,
.in-app .document h1 {
  display: none;
}

.in-app .document {
  padding-top: 8px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.in-app .updated {
  margin-top: 0;
}
