:root {
  color-scheme: light dark;
  --magenta: #e0007a;
  --cyan: #11b5d8;
  --green: #28c76f;
  --amber: #ffb84d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body[data-theme="dark"],
body[data-theme="auto"] {
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.18);
  --text: #f7f3f6;
  --muted: #c9c0c7;
  --soft-line: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.07);
  --button-bg: rgba(255, 255, 255, 0.08);
  --button-active: rgba(255, 255, 255, 0.2);
  --icon-bg: rgba(255, 255, 255, 0.11);
  --icon-border: rgba(255, 255, 255, 0.16);
  --icon-shadow: none;
  --arrow-bg: rgba(255, 255, 255, 0.09);
  --arrow-bg-hover: rgba(255, 255, 255, 0.16);
  --arrow-border: rgba(255, 255, 255, 0.16);
  --arrow-shadow: none;
  --toast-bg: rgba(19, 20, 24, 0.78);
  --grid-line: rgba(255, 255, 255, 0.035);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --page-bg:
    radial-gradient(circle at 18% 18%, rgba(224, 0, 122, 0.34), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(17, 181, 216, 0.28), transparent 25rem),
    radial-gradient(circle at 75% 84%, rgba(40, 199, 111, 0.18), transparent 22rem),
    linear-gradient(135deg, #17171b 0%, #111216 48%, #1a1018 100%);
}

@media (prefers-color-scheme: light) {
  body[data-theme="auto"] {
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 255, 255, 0.88);
    --line: rgba(30, 32, 38, 0.13);
    --text: #211923;
    --muted: #6f6270;
    --soft-line: rgba(30, 32, 38, 0.12);
    --surface: rgba(255, 255, 255, 0.62);
    --button-bg: rgba(255, 255, 255, 0.58);
    --button-active: rgba(224, 0, 122, 0.13);
    --icon-bg: rgba(255, 255, 255, 0.86);
    --icon-border: rgba(48, 35, 51, 0.2);
    --icon-shadow: 0 10px 26px rgba(69, 43, 67, 0.13);
    --arrow-bg: rgba(255, 255, 255, 0.84);
    --arrow-bg-hover: rgba(255, 255, 255, 0.96);
    --arrow-border: rgba(48, 35, 51, 0.2);
    --arrow-shadow: 0 10px 26px rgba(69, 43, 67, 0.12);
    --toast-bg: rgba(255, 255, 255, 0.86);
    --grid-line: rgba(31, 26, 34, 0.045);
    --shadow: 0 24px 70px rgba(72, 39, 62, 0.18);
    --page-bg:
      radial-gradient(circle at 18% 18%, rgba(224, 0, 122, 0.18), transparent 28rem),
      radial-gradient(circle at 85% 12%, rgba(17, 181, 216, 0.18), transparent 25rem),
      radial-gradient(circle at 75% 84%, rgba(40, 199, 111, 0.14), transparent 22rem),
      linear-gradient(135deg, #fff7fb 0%, #f3fbff 48%, #fffaf0 100%);
  }
}

body {
  background: var(--page-bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.page {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 40px 22px;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 44px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand > div:last-child {
  min-width: 0;
}

.logo {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(224, 0, 122, 0.95), rgba(17, 181, 216, 0.78));
  box-shadow: 0 18px 46px rgba(224, 0, 122, 0.22);
}

.logo svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.32));
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.brand p,
.status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.theme-switch,
.status {
  border: 1px solid var(--soft-line);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.theme-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  width: min(310px, 100%);
  padding: 5px;
  border-radius: 999px;
}

.theme-button {
  display: inline-flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-button span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.theme-button:hover,
.theme-button:focus-visible {
  color: var(--text);
  outline: none;
}

.theme-button[aria-pressed="true"] {
  background: var(--button-active);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
}

.status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(40, 199, 111, 0.16);
}

.hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: stretch;
}

.intro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 430px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.intro h2 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.intro p {
  max-width: 34rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.quick-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-tip strong {
  color: var(--text);
  font-size: 1.5rem;
}

.systems {
  display: grid;
  gap: 18px;
}

.system-card {
  position: relative;
  min-width: 0;
  display: grid;
  min-height: 132px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(24px);
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.system-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(120deg, var(--accent), transparent 55%);
  transition: opacity 180ms ease;
}

.system-card:hover,
.system-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: var(--panel-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
  transform: translateY(-4px);
  outline: none;
}

.system-card:hover::before,
.system-card:focus-visible::before {
  opacity: 0.28;
}

.icon,
.arrow {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
}

.icon {
  width: 70px;
  height: 70px;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  box-shadow: var(--icon-shadow);
  font-weight: 800;
  font-size: 1.25rem;
}

.card-copy {
  position: relative;
  min-width: 0;
}

.card-copy h3 {
  margin: 0 0 7px;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: 0;
}

.card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.arrow {
  width: 46px;
  height: 46px;
  border: 1px solid var(--arrow-border);
  background: var(--arrow-bg);
  box-shadow: var(--arrow-shadow);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.system-card:hover .arrow,
.system-card:focus-visible .arrow {
  background: var(--arrow-bg-hover);
  transform: translateX(4px);
}

.system-card:nth-child(1) {
  --accent: rgba(224, 0, 122, 0.9);
}

.system-card:nth-child(2) {
  --accent: rgba(17, 181, 216, 0.85);
}

.system-card:nth-child(3) {
  --accent: rgba(225, 47, 47, 0.88);
}

.system-card:nth-child(1) .icon {
  color: #d60074;
}

.system-card:nth-child(2) .icon {
  color: #0797bc;
}

.system-card:nth-child(3) .icon {
  color: #c82121;
}

body[data-theme="dark"] .system-card:nth-child(1) .icon,
body[data-theme="auto"] .system-card:nth-child(1) .icon {
  color: #ff86c7;
}

body[data-theme="dark"] .system-card:nth-child(2) .icon,
body[data-theme="auto"] .system-card:nth-child(2) .icon {
  color: #7ee8ff;
}

body[data-theme="dark"] .system-card:nth-child(3) .icon,
body[data-theme="auto"] .system-card:nth-child(3) .icon {
  color: #ff8a8a;
}

@media (prefers-color-scheme: light) {
  body[data-theme="auto"] .system-card:nth-child(1) .icon {
    color: #d60074;
  }

  body[data-theme="auto"] .system-card:nth-child(2) .icon {
    color: #0797bc;
  }

  body[data-theme="auto"] .system-card:nth-child(3) .icon {
    color: #c82121;
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: var(--toast-bg);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  backdrop-filter: blur(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    gap: 20px;
  }

  .intro {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .page {
    padding: 24px 14px;
  }

  header {
    margin-bottom: 24px;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(1.8rem, 10vw, 2.7rem);
    line-height: 1;
  }

  .brand p {
    font-size: 0.94rem;
  }

  .logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .logo svg {
    width: 40px;
    height: 40px;
  }

  .theme-switch,
  .status {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status {
    justify-content: center;
  }

  .intro {
    padding: 22px;
    border-radius: 22px;
  }

  .system-card {
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 18px;
    border-radius: 20px;
  }

  .icon {
    width: 54px;
    height: 54px;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .card-copy {
    grid-column: 1 / -1;
  }

  .arrow {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}
