/* Landing page for VNetCore. Same palette and fonts as the app (dark by
   default, light when the system asks for it). No scripts. */

:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-2: #101419;
  --panel: #15191e;
  --line: #2b323b;
  --line-strong: #444c57;
  --text: #eef1f4;
  --muted: #a3acb7;
  --accent: #e12b40;
  --accent-hover: #c41f33;
  --accent-text: #ff5366;
  --s-active: #47d18c;
  --s-nolink: #e4a24c;
  --s-available: #68a9ff;
  --s-unknown: #ff5366;
  --grid: rgba(255, 255, 255, 0.022);
  --metal: linear-gradient(180deg, #1f252c, #171b20);
  --jack: #07090b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1120px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef1f4;
    --bg-2: #e4e9ee;
    --panel: #ffffff;
    --line: #d5dce3;
    --line-strong: #a4afbb;
    --text: #17202a;
    --muted: #55606c;
    --accent: #c41f33;
    --accent-hover: #a51f31;
    --accent-text: #b51f30;
    --s-active: #16803c;
    --s-nolink: #a86f00;
    --s-available: #1769c2;
    --s-unknown: #d9273a;
    --grid: rgba(23, 32, 42, 0.04);
    --metal: linear-gradient(180deg, #2a3038, #1d2228);
    --shadow: 0 20px 48px rgba(26, 34, 42, 0.16);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img {
  display: block;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--s-available);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}

.nowrap {
  white-space: nowrap;
}

/* Top bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.bar-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 15px;
  font-weight: 500;
}
.bar-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.bar-nav a:hover {
  color: var(--text);
}
.bar-nav .bar-app {
  color: var(--text);
}

/* Buttons */

.btn,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.btn {
  background: var(--accent);
  color: #fff;
}
.btn:hover {
  background: var(--accent-hover);
}

.btn-quiet {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn-quiet:hover {
  border-color: var(--text);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 8vw, 96px) var(--gutter) clamp(56px, 9vw, 112px);
}

.tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  margin-top: 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Hero illustration: a switch faceplate and one port's details */

.rig {
  position: relative;
  margin: 0;
}

.switch {
  border-radius: 12px;
  background: var(--metal);
  border: 1px solid #343c46;
  box-shadow: var(--shadow);
  padding: 14px 16px 18px;
  color: #c9d1da;
}

.switch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 14px;
}
.switch-meta {
  color: #9aa4af;
}

.faceplate {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.ports {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}

.uplinks {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  width: 9%;
  padding-left: 14px;
  border-left: 1px solid #343c46;
}

.ports > *,
.uplinks > * {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  aspect-ratio: 1 / 0.86;
  border-radius: 3px;
  background: var(--jack);
  box-shadow:
    inset 0 -3px 0 var(--c, #333),
    inset 0 2px 4px rgba(0, 0, 0, 0.7);
}
.uplinks > * {
  aspect-ratio: auto;
}

.ports button,
.uplinks button {
  cursor: pointer;
  transition: background-color 120ms ease;
}
@media (hover: hover) {
  .ports button:hover,
  .uplinks button:hover {
    background: #1b2128;
  }
}
.ports button[aria-pressed="true"],
.uplinks button[aria-pressed="true"],
.ports i.picked {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ports button:focus-visible,
.uplinks button:focus-visible {
  outline: 2px solid var(--s-available);
  outline-offset: 3px;
}

/* Status LED above each jack */
.ports > *::before,
.uplinks > *::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--c);
}

[data-s="a"] {
  --c: var(--s-active);
}
[data-s="n"] {
  --c: var(--s-nolink);
}
[data-s="v"] {
  --c: var(--s-available);
}
[data-s="u"] {
  --c: var(--s-unknown);
}

.port-card {
  position: relative;
  width: min(310px, 82%);
  margin: -26px -8px 0 auto;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.port-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--c) 68%, var(--text));
  background: color-mix(in srgb, var(--c) 14%, transparent);
}

.port-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
}
.port-card dt {
  color: var(--muted);
}
.port-card dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .rig-hint {
  flex-basis: 100%;
  margin-top: 4px;
  color: var(--text);
}
.legend .rig-hint[hidden] {
  display: none;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

@media (prefers-reduced-motion: no-preference) {
  .ports > [data-s="a"]:nth-child(3n + 1)::before,
  .uplinks > [data-s="a"]::before {
    animation: blink 1.6s steps(2, jump-none) infinite;
  }
  .ports > [data-s="a"]:nth-child(5n + 2)::before {
    animation: blink 0.9s steps(2, jump-none) infinite 0.3s;
  }
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

/* Why */

.why {
  padding: clamp(40px, 6vw, 72px) var(--gutter);
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
.why-inner {
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 72px);
  align-items: end;
}
.why h2 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.why p {
  max-width: 30em;
  color: var(--muted);
  font-size: 18px;
  text-wrap: pretty;
}

/* Screenshots */

.look {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}
.section-head h2 + p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
}
.section-head .tag {
  margin-bottom: 14px;
}

.shot {
  margin: 0;
}
.shot img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b0d10;
  box-shadow: var(--shadow);
}
.shot figcaption {
  margin-top: 14px;
  max-width: 46em;
  color: var(--muted);
  font-size: 15px;
}
.shot figcaption strong {
  color: var(--text);
}

.shot-link {
  position: relative;
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}
.shot-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 16, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eef1f4;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 160ms ease;
}
.shot-link:hover .shot-zoom,
.shot-link:focus-visible .shot-zoom {
  opacity: 1;
}
@media (hover: none) {
  .shot-zoom {
    opacity: 1;
  }
}

.shot-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  margin-top: clamp(40px, 6vw, 64px);
}
.shot-rack img {
  max-width: 440px;
}

/* What it does */

.what,
.start {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter);
}
.what {
  padding-top: clamp(48px, 6vw, 80px);
}

.hero-note {
  margin-top: 18px;
  max-width: 34em;
  color: var(--muted);
  font-size: 14px;
}
.hero-note a {
  color: var(--text);
  text-underline-offset: 3px;
}
.start .hero-actions {
  margin-top: 0;
}

/* Screenshot viewer */

.viewer {
  width: min(1440px, calc(100vw - 32px));
  max-width: none;
  height: calc(100dvh - 32px);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #343c46;
  border-radius: 14px;
  background: #0b0d10;
  color: #eef1f4;
  overflow: hidden;
}
.viewer[open] {
  display: flex;
  flex-direction: column;
}
.viewer::backdrop {
  background: rgba(5, 6, 8, 0.82);
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #2b323b;
}
.viewer-title {
  flex: 1 1 280px;
  font-size: 14px;
  color: #a3acb7;
}
.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.viewer-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #444c57;
  border-radius: 9px;
  background: #15191e;
  color: #eef1f4;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.viewer-btn:hover {
  border-color: #eef1f4;
}

.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}
.viewer-stage img {
  position: absolute;
  inset: 16px;
  display: block;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
}
.viewer.is-zoomed .viewer-stage img {
  position: static;
  max-width: none;
  height: auto;
  margin: 0 auto;
  width: calc(var(--natural, 1440) * 1px);
  cursor: zoom-out;
}

h2 {
  text-wrap: balance;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.specs {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 72px);
}

.specs li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.spec-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  padding-top: 5px;
}

.specs h3 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.specs p {
  color: var(--muted);
}

/* Local data, import/export and backups */

.data {
  padding: 0 var(--gutter);
}
.data-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.data-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.data-col h3 {
  font-size: 15px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}
.data b {
  font-weight: 600;
}

.backup-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font-size: 15px;
}
.backup-steps li {
  position: relative;
  padding: 10px 0 10px 34px;
  border-bottom: 1px dashed var(--line);
  counter-increment: step;
}
.backup-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.data-warn {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}
.facts li {
  padding: 10px 0 10px 22px;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s-active);
}

/* Getting started */

.steps {
  list-style: none;
  margin: 36px 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.steps li {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.step-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 13px;
  transform: translateY(-2px);
}
.steps p {
  font-size: 18px;
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.foot-credit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.foot-credit img {
  border-radius: 6px;
}

/* Smaller screens */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .specs {
    grid-template-columns: minmax(0, 1fr);
  }
  .why-inner,
  .data-cols,
  .shot-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .shot-rack img {
    max-width: 360px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .bar {
    padding-block: 12px;
  }
  .bar-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .bar-nav {
    font-size: 14px;
    gap: 16px;
  }
  .hero-actions .btn,
  .hero-actions .btn-quiet {
    flex: 1 1 100%;
  }
  .switch {
    padding: 12px;
  }
  .ports {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .uplinks {
    grid-template-rows: none;
    align-content: start;
    width: 15%;
  }
  .uplinks > * {
    aspect-ratio: 1 / 1.1;
  }
  .viewer {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .viewer-title {
    display: none;
  }
  .viewer-stage {
    padding: 8px;
  }
  .ports {
    gap: 4px;
  }
  .faceplate {
    gap: 8px;
  }
  .uplinks {
    padding-left: 8px;
    gap: 4px;
  }
  .port-card {
    width: auto;
    margin: 12px 0 0;
  }
  .ports > * {
    aspect-ratio: 1 / 1.1;
  }
  .specs li {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .spec-label {
    padding-top: 0;
  }
}
