:root {
  color-scheme: light;
  --background: #f3f7f8;
  --surface: #ffffff;
  --text: #182126;
  --muted: #647277;
  --line: #d6e0e3;
  --accent: #2bb8d6;
  --accent-dark: #087e9b;
  --accent-soft: #d8f5fa;
  --marker: #c73737;
  --shadow: 0 18px 50px rgba(24, 48, 57, .11);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 16% 18%, rgba(216, 245, 250, .9), transparent 31rem),
    radial-gradient(circle at 85% 82%, rgba(201, 213, 217, .42), transparent 28rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

button, summary { font: inherit; }
a { color: inherit; }

:where(a, button, summary):focus-visible {
  outline: 3px solid rgba(43, 184, 214, .42);
  outline-offset: 3px;
}

.skip-link {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 8px;
  left: 16px;
  padding: 10px 16px;
  position: fixed;
  text-decoration: none;
  top: -100px;
  z-index: 2000;
}
.skip-link:focus { top: 12px; }

.topbar {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  box-shadow: 0 6px 24px rgba(24, 48, 57, .06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navigation {
  align-items: center;
  display: flex;
  gap: 18px;
  min-height: 72px;
  padding: 8px clamp(18px, 3.5vw, 48px);
  width: 100%;
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 11px;
  margin-right: 10px;
  text-decoration: none;
}
.brand img { display: block; height: 45px; object-fit: contain; width: 42px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 20px; letter-spacing: -.035em; line-height: 1.05; }
.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-menu {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
}

.nav-link {
  align-items: center;
  border-radius: 8px;
  color: #48585e;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 42px;
  padding: 9px 11px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover, .nav-group[open] > .nav-link { background: #edf9fb; color: var(--accent-dark); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.nav-link.is-disabled { color: #8a979c; cursor: default; }

.nav-group { min-height: 42px; position: relative; }
.nav-group summary { cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 6px;
  margin: -3px 2px 0 9px;
  transform: rotate(45deg);
  transition: transform .18s ease;
  width: 6px;
}
.nav-group[open] summary::after { margin-top: 3px; transform: rotate(225deg); }

.nav-submenu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  left: 0;
  min-width: 270px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 8px);
}
.nav-submenu-item { border-radius: 8px; display: grid; gap: 2px; padding: 10px 11px; }
.nav-submenu-item:hover { background: #f3f8f9; }
.nav-submenu-item strong { font-size: 14px; }
.nav-submenu-item small { color: var(--muted); font-size: 12px; }

.nav-actions { align-items: center; display: flex; gap: 10px; margin-left: auto; }
.system-state {
  align-items: center;
  color: #326b78;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  white-space: nowrap;
}
.system-state > span {
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
  height: 8px;
  width: 8px;
}
.signin-button {
  background: var(--surface);
  border: 1px solid #afdfe8;
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 800;
  min-height: 40px;
  padding: 8px 15px;
}
.signin-button:disabled { cursor: not-allowed; opacity: .7; }

.nav-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: none;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}
.nav-toggle span {
  background: var(--text);
  border-radius: 2px;
  display: block;
  height: 2px;
  position: absolute;
  transition: transform .18s ease, opacity .18s ease;
  width: 19px;
}
.nav-toggle span:first-child { transform: translateY(-6px); }
.nav-toggle span:last-child { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

main {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 75px);
  padding: 46px 20px;
}
.welcome {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(24, 48, 57, .11);
  max-width: 720px;
  padding: clamp(42px, 7vw, 74px);
  position: relative;
  text-align: center;
  width: 100%;
}
.machine-marker {
  background: var(--marker);
  border-radius: 1px;
  height: 9px;
  left: 50%;
  position: absolute;
  top: 22px;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
}
.brand-mark {
  align-items: center;
  display: inline-flex;
  height: clamp(136px, 22vw, 174px);
  justify-content: center;
  margin: 2px auto 30px;
  width: clamp(128px, 21vw, 164px);
}
.brand-mark img { display: block; height: 100%; object-fit: contain; width: 100%; }
.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  margin: 0 0 15px;
}
h1 { font-size: clamp(46px, 9vw, 76px); letter-spacing: -.055em; line-height: 1; margin: 0; }
.lead {
  color: var(--muted);
  font-size: clamp(17px, 3vw, 21px);
  line-height: 1.55;
  margin: 24px auto 14px;
  max-width: 510px;
}
.welcome-note {
  color: #7d8a8f;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 470px;
}

@media (max-width: 1120px) {
  .navigation { flex-wrap: wrap; }
  .brand { flex: 1 1 auto; }
  .nav-toggle { display: inline-flex; position: relative; }
  .nav-menu {
    align-items: stretch;
    border-top: 1px solid var(--line);
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0 4px;
  }
  .nav-menu.is-open { display: flex; }
  .nav-link, .nav-group { width: 100%; }
  .nav-submenu {
    border-radius: 8px;
    box-shadow: none;
    margin: 3px 0 7px 12px;
    min-width: 0;
    position: static;
    width: calc(100% - 12px);
  }
  .nav-actions {
    border-top: 1px solid var(--line);
    justify-content: space-between;
    margin: 6px 0 0;
    padding-top: 12px;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .navigation { padding-inline: 14px; }
  .brand-copy small { display: none; }
  main { padding: 24px 12px; }
  .welcome { border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-group summary::after, .nav-toggle span { transition: none; }
}
