/* arcticproxy.com: the app's design tokens (src/theme/palette.ts, tokens.ts, DESIGN.md) on the web.
   Same palette, the same four text sizes plus the iOS large title, one accent, no shadows or
   gradients, light and dark from the system. */

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* palette.ts, light */
  --background: #f2f4f8;
  --surface: #ffffff;
  --surface-pressed: #e5e9f0;
  --separator: #cdd3dd;
  --text-secondary: #5b6576;
  --text-primary: #10151c;
  --accent: #1f5fbf;
  --on-accent: #f2f4f8;
  --success: #0b734f;
  --warning: #9a520e;
  --error: #c0342f;

  /* tokens.ts */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --gutter: 16px;
  --readable: 672px;
  --control-height: 48px;
  --radius-control: 8px;
  --radius-card: 12px;
  --stroke: 3px;
  --spin: 1100ms;
  --standard: 250ms;

  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* palette.ts, dark */
    --background: #0e1116;
    --surface: #161b24;
    --surface-pressed: #1d2430;
    --separator: #252d3a;
    --text-secondary: #8a94a7;
    --text-primary: #e8ecf3;
    --accent: #8fbfff;
    --on-accent: #0e1116;
    --success: #7ee2c0;
    --warning: #f2b880;
    --error: #f08c8c;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 17px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

/* Type: the app's roles. */
h1,
.large-title {
  margin: 0;
  font-size: 34px;
  line-height: 41px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
h2,
.title {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}
h3,
.headline {
  margin: 0;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}
p {
  margin: 0;
}
.secondary {
  font-size: 15px;
  line-height: 20px;
  color: var(--text-secondary);
}
.footnote {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}
.mono {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 20px;
  color: var(--text-secondary);
}
code,
.mono-body {
  font-family: var(--mono);
  font-size: 0.94em;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-control);
}

/* Layout: one readable column, as the app caps its lists. */
.column {
  width: 100%;
  max-width: calc(var(--readable) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header and footer */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-weight: 600;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}
.site-nav {
  display: flex;
  gap: var(--space-lg);
  font-size: 15px;
}

.site-footer {
  margin-top: 64px;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xxl);
  border-top: 1px solid var(--separator);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  justify-content: space-between;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

/* Sections: a title, one line, then a grouped-inset list. */
main > section {
  margin-top: 56px;
}
.section-head {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.section-head .lead {
  color: var(--text-secondary);
}

/* Grouped-inset list, as ListSection draws it. */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.list > li,
.list > .row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--control-height);
  padding: var(--space-md) var(--space-lg);
}
.list > li + li::before,
.list > .row + .row::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-lg);
  right: 0;
  border-top: 1px solid var(--separator);
}
.row .trailing {
  margin-left: auto;
  flex: none;
}
.row .text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.row .text .mono {
  overflow-wrap: anywhere;
}
.list-footer {
  margin-top: var(--space-sm);
  padding: 0 var(--space-lg);
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

/* Hero: the large title, then Home's connect disk as a working demo. */
.hero {
  padding-top: var(--space-xl);
}
.hero .lead {
  margin-top: var(--space-md);
  font-size: 17px;
  line-height: 24px;
  color: var(--text-secondary);
  max-width: 34em;
}

.demo {
  margin-top: var(--space-xxl);
  display: grid;
  justify-items: center;
  gap: var(--space-lg);
}
.connect {
  position: relative;
  width: 192px;
  height: 192px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.connect:active {
  opacity: 0.8;
}
.connect > svg {
  position: absolute;
  inset: 0;
}
.connect .track,
.connect .arc {
  fill: none;
  stroke-width: var(--stroke);
}
.connect .track {
  stroke: var(--separator);
  transition: stroke var(--standard);
}
.connect .arc {
  stroke: var(--accent);
  stroke-linecap: round;
}
.connect .spinner {
  opacity: 0;
}
.connect .disk {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
}
.connect .glyph {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  transition: color var(--standard);
}
.connect[data-state='connecting'] .spinner {
  opacity: 1;
  animation: spin var(--spin) linear infinite;
}
.connect[data-state='connecting'] .glyph {
  color: var(--accent);
}
.connect[data-state='connected'] .track {
  stroke: var(--success);
}
.connect[data-state='connected'] .glyph {
  color: var(--success);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* A still accent ring instead of the spinning arc, as in the app. */
  .connect[data-state='connecting'] .spinner {
    animation: none;
  }
  .connect[data-state='connecting'] .arc {
    stroke-dasharray: none;
  }
  .connect .track,
  .connect .glyph {
    transition: none;
  }
}

.status {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  text-align: center;
  min-height: 52px;
}
.demo .list {
  width: 100%;
  max-width: 420px;
}
.latency {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--success);
}
.demo-note {
  text-align: center;
}

/* Routing demo: the modes as a picker, then how four sites are handled. */
.mode {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mode:hover {
  background: var(--surface-pressed);
}
.mode .check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  color: var(--accent);
  visibility: hidden;
}
.mode[aria-checked='true'] .check {
  visibility: visible;
}
.routes {
  margin-top: var(--space-lg);
}
.route {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.route[data-action='block'] {
  color: var(--error);
}
.route .icon {
  width: 16px;
  height: 16px;
  color: inherit;
}

/* The call to action: the page's one accent element. */
.cta {
  margin-top: 64px;
  display: grid;
  justify-items: start;
  gap: var(--space-md);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 var(--space-xl);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.button:hover {
  text-decoration: none;
  opacity: 0.9;
}
.button[aria-disabled='true'] {
  cursor: default;
}

/* Long text pages: privacy policy, support. */
.prose {
  padding-top: var(--space-xl);
}
.prose h1 {
  margin-bottom: var(--space-sm);
}
.prose h2 {
  margin-top: 40px;
  margin-bottom: var(--space-md);
}
.prose h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xs);
}
.prose p,
.prose ul {
  margin: 0 0 var(--space-md);
  line-height: 24px;
}
.prose ul {
  padding-left: 1.2em;
}
.prose li + li {
  margin-top: var(--space-xs);
}
.prose details {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 0 var(--space-lg);
}
.prose details + details {
  margin-top: var(--space-sm);
}
.prose summary {
  min-height: var(--control-height);
  padding: var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.prose summary::-webkit-details-marker {
  display: none;
}
.prose summary::after {
  content: '';
  flex: none;
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform var(--standard);
}
.prose details[open] summary::after {
  transform: rotate(-135deg);
}
.prose details > :not(summary) {
  margin-bottom: var(--space-lg);
}
.contact {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-card);
}
.contact h3 {
  margin-top: 0;
}
.contact p {
  margin-bottom: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 720px) {
  main > section {
    margin-top: 72px;
  }
  .hero {
    padding-top: var(--space-xxl);
  }
}
