:root {
  color-scheme: light;
  font-family: var(--font-family-ui);
  font-synthesis: none;

  /* Color tokens: light mode only. */
  --color-background: oklch(0.97 0.008 95);
  --color-surface: oklch(0.995 0.004 95);
  --color-surface-hover: oklch(0.985 0.006 95);
  --color-text: oklch(0.2 0.008 95);
  --color-text-muted: oklch(0.5 0.012 95);
  --color-border: oklch(0.87 0.009 95);
  --color-border-subtle: oklch(0.92 0.007 95);
  --color-accent: oklch(0.49 0.2 264);
  --color-accent-hover: oklch(0.41 0.18 264);
  --color-accent-soft: oklch(0.96 0.025 264);
  --color-accent-border: oklch(0.82 0.04 264);
  --color-on-accent: oklch(1 0 0);
  --color-code-background: oklch(0.93 0.008 95);
  --color-positive: oklch(0.45 0.1 155);
  --color-positive-soft: oklch(0.96 0.025 155);
  --color-positive-border: oklch(0.82 0.05 155);
  --color-caution: oklch(0.48 0.1 78);
  --color-critical: oklch(0.48 0.14 30);
  --color-critical-hover: oklch(0.4 0.13 30);
  --color-critical-border: oklch(0.78 0.06 30);
  --color-caution-surface: oklch(0.97 0.045 90);
  --color-caution-border: oklch(0.7 0.1 85);
  --color-caution-text: oklch(0.4 0.075 85);
  --color-shadow: oklch(0.2 0.008 95 / 0.22);
  --color-overlay: oklch(0.2 0.008 95 / 0.46);

  /* Typography tokens. */
  --font-family-ui: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-size-2xs: 0.6875rem;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-md: 0.9375rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-heading-section: clamp(1.125rem, 3vw, 1.375rem);
  --font-size-heading-page: clamp(1.75rem, 4vw, 2.25rem);
  --font-size-heading-display: clamp(2rem, 5vw, 3rem);
  --font-size-heading-display-mobile: clamp(1.875rem, 9vw, 2.5rem);
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-none: 1;
  --line-height-tight: 1.15;
  --line-height-compact: 1.25;
  --line-height-control: 1.4;
  --line-height-body: 1.65;
  --line-height-relaxed: 1.75;
  --letter-spacing-display: -0.05em;
  --letter-spacing-heading: -0.035em;
  --letter-spacing-label: -0.025em;

  /* Spacing tokens. */
  --space-1: 0.25rem;
  --space-1-5: 0.375rem;
  --space-2: 0.5rem;
  --space-2-5: 0.625rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --space-13: 3.25rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-32: 8rem;

  /* Shape, focus, and shared layout tokens. */
  --border-width: 0.0625rem;
  --border-width-focus: 0.125rem;
  --border-width-accent: 0.1875rem;
  --radius-none: 0;
  --radius-xs: 0.0625rem;
  --radius-round: 50%;
  --opacity-disabled: 0.65;
  --focus-outline: var(--border-width-focus) solid var(--color-accent);
  --focus-offset: var(--space-1);
  --layout-min-width: 20rem;
  --layout-screen-height: 100svh;
  --layout-site-gutter: var(--space-8);
  --layout-site-max: 78.125rem;
  --layout-content-max: 51.25rem;
  --layout-header-height: var(--space-16);
  --layout-header-height-mobile: 3.75rem;
  --layout-main-space: clamp(var(--space-10), 5vw, var(--space-16));
  --layout-error-max: 36.25rem;
  --layout-copy-max: 36.875rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-background);
}

body {
  min-width: var(--layout-min-width);
  min-height: var(--layout-screen-height);
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-shell {
  width: min(calc(100% - var(--layout-site-gutter)), var(--layout-site-max));
  margin-inline: auto;
}

.product-header {
  min-height: var(--layout-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  border-bottom: var(--border-width) solid var(--color-border);
}

.product-brand {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-heading);
  text-decoration: none;
}

a.product-brand:hover,
a.product-brand:focus-visible,
.product-brand a:hover,
.product-brand a:focus-visible {
  color: var(--color-accent);
}

.product-brand a {
  color: inherit;
  text-decoration: none;
}

.product-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-control);
}

/* Custom properties cannot be used in media-query conditions. */
@media (max-width: 42.5rem) {
  .product-header {
    min-height: var(--layout-header-height-mobile);
  }

  .product-nav {
    font-size: var(--font-size-2xs);
  }
}

:root {
  --landing-lead-space: clamp(var(--space-6), 3vw, var(--space-9));
  --landing-terminal-space: clamp(var(--space-8), 4vw, var(--space-13));
  --landing-section-space: clamp(var(--space-8), 4vw, var(--space-12));
  --landing-section-inset: clamp(var(--space-5), 2.5vw, var(--space-7));
  --landing-column-gap: clamp(var(--space-5), 3.5vw, var(--space-12));
  --landing-command-padding-block: clamp(var(--space-4), 2.2vw, var(--space-5));
  --landing-command-padding-inline: clamp(var(--space-4), 2.5vw, var(--space-6));
  --landing-output-padding-block: clamp(var(--space-3), 1.8vw, var(--space-4));
  --landing-title-width: 18ch;
  --landing-command-size: clamp(var(--font-size-xs), 1.3vw, var(--font-size-md));
  --landing-output-size: clamp(var(--font-size-2xs), 1.2vw, var(--font-size-sm));
  --landing-lead-size: clamp(var(--font-size-sm), 1.4vw, var(--font-size-base));
  --landing-signed-gap: clamp(var(--space-6), 3vw, var(--space-9));
  --landing-summary-padding-block: clamp(var(--space-4), 2.5vw, var(--space-5));
  --landing-summary-padding-inline: clamp(var(--space-4), 3vw, var(--space-6));
  --landing-summary-title-size: clamp(var(--font-size-sm), 1.5vw, var(--font-size-base));
  --landing-summary-count-size: 1.15em;
  --landing-new-title-size: clamp(var(--font-size-base), 1.6vw, var(--font-size-lg));
  --landing-new-lead-size: clamp(var(--font-size-xs), 1.3vw, var(--font-size-sm));
}

.page {
  min-height: var(--layout-screen-height);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-control);
}

.masthead-link {
  flex: none;
  color: var(--color-text-muted);
  text-decoration: none;
}

.masthead-link:hover,
.masthead-link:focus-visible {
  color: var(--color-accent);
}

a:focus-visible,
.terminal:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.masthead-account {
  margin-left: auto;
}

.github-user {
  min-width: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

main {
  align-self: center;
  width: min(100%, var(--layout-content-max));
  min-width: 0;
  padding: var(--layout-main-space) 0;
}

h1 {
  max-width: var(--landing-title-width);
  margin: 0;
  font-size: var(--font-size-heading-display);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-display);
  text-wrap: balance;
}

.signed-in-home {
  align-self: start;
  display: grid;
  gap: var(--landing-signed-gap);
}

.new-tunnel {
  min-width: 0;
}

.endpoint-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--landing-summary-padding-block) var(--landing-summary-padding-inline);
  border: var(--border-width) solid var(--color-border);
  background: var(--color-surface);
}

.endpoint-summary h1 {
  max-width: none;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--landing-summary-title-size);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
  line-height: var(--line-height-body);
}

.endpoint-summary strong {
  margin-right: var(--space-1);
  color: var(--color-text);
  font-size: var(--landing-summary-count-size);
  font-weight: var(--font-weight-semibold);
}

.dashboard-cta {
  flex: none;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.dashboard-cta:hover,
.dashboard-cta:focus-visible {
  background: var(--color-text);
}

.new-tunnel h2 {
  margin: 0;
  font-size: var(--landing-new-title-size);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-label);
}

.new-tunnel .lead {
  margin-top: var(--space-2-5);
  font-size: var(--landing-new-lead-size);
}

.terminal.tunnel-command {
  margin-top: var(--space-4);
}

.lead {
  max-width: var(--layout-copy-max);
  margin: var(--landing-lead-space) 0 0;
  color: var(--color-text-muted);
  font-size: var(--landing-lead-size);
  line-height: var(--line-height-body);
}

.terminal {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: var(--landing-terminal-space) 0 0;
  overflow-x: auto;
  border: var(--border-width) solid var(--color-border);
  background: var(--color-surface);
  box-shadow: inset var(--border-width-accent) 0 0 var(--color-accent);
  scrollbar-width: thin;
}

.command {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
  width: max-content;
  min-width: 100%;
  padding: var(--landing-command-padding-block) var(--landing-command-padding-inline);
  font-size: var(--landing-command-size);
  line-height: var(--line-height-body);
  white-space: nowrap;
}

.prompt {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  user-select: none;
}

code {
  font: inherit;
}

.output {
  width: max-content;
  min-width: 100%;
  padding: var(--landing-output-padding-block) var(--landing-command-padding-inline);
  border-top: var(--border-width) solid var(--color-border);
  font-size: var(--landing-output-size);
  line-height: var(--line-height-body);
  white-space: nowrap;
}

.output span {
  display: block;
}

.output-public {
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
}

.output-stop {
  color: var(--color-text-muted);
}

.steps {
  margin: var(--landing-section-space) 0 0;
  padding: var(--landing-section-inset) 0 0;
  border-top: var(--border-width) solid var(--color-border);
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--landing-column-gap);
}

.step-label {
  display: block;
  margin: 0 0 var(--space-2-5);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-label);
}

.step-copy {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-body);
}

.step-copy code {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.footer {
  padding: var(--space-5) 0 var(--space-9);
  border-top: var(--border-width) solid var(--color-border);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

/* Custom properties cannot be used in media-query conditions. */
@media (max-width: 42.5rem) {
  .masthead {
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-4);
  }

  .masthead-account {
    max-width: 100%;
    gap: var(--space-3);
  }

  h1 {
    font-size: var(--font-size-heading-display-mobile);
  }

  .endpoint-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-cta {
    text-align: center;
  }

  .tunnel-command .command {
    width: 100%;
    white-space: normal;
  }

  .tunnel-command code {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
