:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: rgba(20, 23, 31, 0.76);
  --surface-hover: rgba(26, 30, 40, 0.92);
  --text: #f5f7fb;
  --muted: #9299a8;
  --subtle: #697181;
  --line: rgba(255, 255, 255, 0.09);
  --header-bg: rgba(9, 11, 16, 0.66);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --focus: #a8c7ff;
  --radius-lg: 26px;
  --radius-md: 14px;
  --shell: 1160px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --text: #141820;
  --muted: #5f6673;
  --subtle: #7d8491;
  --line: rgba(19, 26, 38, 0.1);
  --header-bg: rgba(245, 246, 248, 0.72);
  --shadow: 0 24px 70px rgba(38, 46, 63, 0.12);
  --focus: #315ea8;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  transition: background-color 180ms ease, color 180ms ease;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

svg {
  display: block;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.backdrop,
.grid-lines,
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.backdrop {
  z-index: -1;
  overflow: hidden;
}

.grid-lines {
  opacity: 0.2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

.glow {
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(115px);
  opacity: 0.13;
}

.glow-one {
  inset: -230px auto auto -180px;
  background: #865dff;
}

.glow-two {
  inset: 36% -260px auto auto;
  background: #1fc6b6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 800;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.brand-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  background: var(--surface-hover);
  color: var(--text);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-sun,
:root[data-theme="light"] .theme-icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-icon-sun {
  display: block;
}

.theme-text {
  font-size: 13px;
  font-weight: 650;
}

.hero {
  max-width: 760px;
  padding: 86px 0 58px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 19px;
  height: 1px;
  background: currentColor;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 7.4vw, 88px);
  font-weight: 580;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

h1 strong {
  color: var(--muted);
  font-weight: inherit;
}

.intro {
  max-width: 610px;
  margin: 27px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.8;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.service-card {
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  min-height: 326px;
  overflow: hidden;
  flex-direction: column;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-decoration: none;
  isolation: isolate;
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.card-moviepilot {
  --accent: #ff9d50;
  --accent-soft: rgba(255, 157, 80, 0.12);
}

.card-qbittorrent {
  --accent: #4f9dff;
  --accent-soft: rgba(79, 157, 255, 0.12);
}

.card-jellyfin {
  --accent: #a879ff;
  --accent-soft: rgba(168, 121, 255, 0.13);
}

.card-edgetunnel {
  --accent: #40cdbb;
  --accent-soft: rgba(64, 205, 187, 0.12);
}

.service-card:hover {
  z-index: 1;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--surface-hover);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-5px);
}

.card-shine {
  position: absolute;
  z-index: -1;
  top: -170px;
  right: -130px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(100px);
  opacity: 0.04;
  transition: opacity 220ms ease;
}

.service-card:hover .card-shine {
  opacity: 0.13;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.service-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.service-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.open-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--subtle);
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.open-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.service-card:hover .open-icon {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translate(2px, -2px);
}

.card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 44px;
}

.service-type {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.service-name {
  font-size: 27px;
  font-weight: 690;
  letter-spacing: -0.035em;
}

.service-description {
  max-width: 390px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.service-url {
  margin-top: 23px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 52px;
  padding-bottom: 38px;
  color: var(--subtle);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 30px), var(--shell));
  }

  .topbar {
    height: 76px;
  }

  .brand-label,
  .brand-divider,
  .theme-text {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .hero {
    padding: 64px 0 42px;
  }

  h1 {
    font-size: clamp(45px, 14vw, 66px);
  }

  .intro {
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.7;
  }

  .services {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .service-card {
    min-height: 285px;
    padding: 23px;
    border-radius: 22px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
