/*
 * Yail.OS — the public launcher (Views/Home/Index.cshtml), a standalone page outside the shell.
 * Loaded after yail-tokens.css; colours are role tokens only.
 */
:root {
  --shadow-tile: 0 1px 1px color-mix(in srgb, var(--yail-shadow) 4%, transparent), 0 12px 32px color-mix(in srgb, var(--yail-shadow) 8%, transparent);
  --font-display: "Fraunces", "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--yail-font-sans);
  background: var(--yail-page);
  color: var(--yail-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, color-mix(in srgb, var(--yail-shadow) 4%, transparent) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 60%, color-mix(in srgb, var(--yail-shadow) 3%, transparent) 50%, transparent 50%),
    radial-gradient(1px 1px at 40% 80%, color-mix(in srgb, var(--yail-shadow) 4%, transparent) 50%, transparent 50%);
  background-size: 220px 220px, 180px 180px, 260px 260px;
  opacity: .9;
}

.page { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 28px 48px 80px; }

/* Top nav */
.topnav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 14px 22px;
  background: color-mix(in srgb, var(--yail-surface) 66%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--yail-border);
  border-radius: 999px;
  box-shadow: var(--shadow-card-soft);
}
.topnav .brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -.01em; font-size: 16px; color: var(--yail-text); }
.topnav .brand img { width: 28px; height: 28px; }
.topnav .brand .os { color: var(--yail-accent); }
.topnav nav { display: flex; gap: 26px; justify-self: center; }
.topnav nav a { font-size: 13px; color: var(--yail-text-muted); padding: 6px 4px; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.topnav nav a:hover { color: var(--yail-text-strong); border-bottom-color: var(--yail-accent); }
.topnav nav a.on { color: var(--yail-text-strong); font-weight: 500; }
.topnav .right { display: flex; gap: 10px; align-items: center; }
.pill-status {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 11.5px; color: var(--yail-text-muted); letter-spacing: .08em;
  padding: 6px 12px; border: 1px solid var(--yail-border); border-radius: 999px; background: var(--yail-surface);
}
.pill-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yail-good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yail-good) 18%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--yail-good) 18%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--yail-good) 5%, transparent); } }
.pill-status.is-degraded .dot { background: var(--yail-warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yail-warn) 18%, transparent); }
.pill-status.is-down .dot { background: var(--yail-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yail-danger) 18%, transparent); animation: none; }
.pill-status.is-probing .dot { background: var(--yail-surface-sunken); box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; line-height: 1;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--yail-inverse); color: var(--yail-text-on-inverse); }
.btn-primary:hover { background: var(--yail-inverse-hover); }
.btn-ghost { background: transparent; color: var(--yail-text-strong); border-color: var(--yail-border); }
.btn-ghost:hover { border-color: var(--yail-border-strong); }

.acct-form { display: inline; margin: 0; padding: 0; }
.acct-form button {
  background: transparent; border: 1px solid var(--yail-border); color: var(--yail-text-strong);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1;
  transition: border-color .15s;
}
.acct-form button:hover { border-color: var(--yail-border-strong); }
.acct-name {
  font-size: 12.5px; color: var(--yail-text-muted); padding: 6px 12px;
  border: 1px solid var(--yail-border); border-radius: 999px; background: var(--yail-surface);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* HERO */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 88px 0 48px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--yail-text-muted); margin: 0 0 26px;
}
.hero-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--yail-accent); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(56px, 7.2vw, 104px);
  line-height: .92;
  letter-spacing: -.035em;
  margin: 0;
  color: var(--yail-text);
}
.hero-title em { font-style: italic; font-weight: 400; color: var(--yail-text-strong); }
.hero-title .dot { color: var(--yail-accent); font-style: normal; display: inline-block; transform: translateY(-.05em); }
.hero-sub {
  margin: 28px 0 0;
  color: var(--yail-text-muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 52ch;
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; align-items: center; margin-top: 36px; flex-wrap: wrap; }
.hero-actions .meta { font-size: 12px; color: var(--yail-text-muted); letter-spacing: .04em; margin-left: 4px; }
.launcher-key { font-family: ui-monospace, monospace; color: var(--yail-text-strong); font-size: 13px; border: 1px solid var(--yail-border); padding: 1px 6px; border-radius: 4px; background: var(--yail-surface); }
.hero-actions .meta b { color: var(--yail-text-strong); font-weight: 600; }

/* Constellation */
.constellation {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  justify-self: end;
}
.constellation svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--yail-accent); }
.constellation .spokes { stroke-opacity: .22; }
.constellation .spokes-inner { stroke-opacity: .3; }
.center-mark {
  position: absolute;
  left: 50%; top: 50%;
  width: 20%; height: 20%;
  transform: translate(-50%, -50%);
  background: var(--yail-surface);
  border: 1px solid var(--yail-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--yail-shadow) 6%, transparent), 0 24px 60px color-mix(in srgb, var(--yail-shadow) 8%, transparent);
  z-index: 3;
}
.center-mark img { width: 70%; height: 70%; }
.center-mark::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed var(--yail-border);
  opacity: .7;
  animation: spin 80s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.orbit {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--yail-accent) 14%, transparent);
}
.orbit-inner {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--yail-accent) 12%, transparent);
}
.sat {
  position: absolute;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  background: var(--yail-logo-tile);
  border: 1.5px solid var(--yail-logo-edge);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  box-shadow: var(--shadow-card-soft);
  z-index: 2;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, border-color .25s;
}
.sat.inner { width: 52px; height: 52px; padding: 9px; }
.sat img { width: 100%; height: 100%; }
.sat:hover {
  transform: translate(-50%, calc(-50% - 4px)) scale(1.1);
  border-color: var(--yail-accent);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--yail-shadow) 16%, transparent);
  z-index: 4;
}
.sat .lbl {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--yail-text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sat:hover .lbl, .sat:focus-visible .lbl { opacity: 1; }
.sat.is-off { opacity: .45; filter: grayscale(1); }
.sat.is-off:hover { transform: translate(-50%, -50%); border-color: var(--yail-border); box-shadow: var(--shadow-card-soft); }

/* Section header */
.section { margin-top: 96px; }
.section-h {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: baseline; margin-bottom: 28px;
  padding-bottom: 16px; border-bottom: 1px solid var(--yail-border);
}
.section-num { font-size: 11px; color: var(--yail-accent); letter-spacing: .22em; font-weight: 600; }
.section-t { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0; color: var(--yail-text); }
.section-t em { font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--yail-text-strong); }
.section-d { font-size: 12.5px; color: var(--yail-text-muted); justify-self: end; max-width: 42ch; text-align: right; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 22px;
}
.filter-bar .lbl { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--yail-text-muted); margin-right: 4px; }
.filter-pill {
  background: var(--yail-surface); border: 1px solid var(--yail-border);
  color: var(--yail-text-muted);
  padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  transition: color .15s, border-color .15s, background .15s;
}
.filter-pill:hover { color: var(--yail-text-strong); border-color: var(--yail-border-strong); }
.filter-pill.on { background: var(--yail-inverse); border-color: var(--yail-inverse); color: var(--yail-text-on-inverse); }
.filter-bar .grow { flex: 1; }
.filter-bar .search {
  display: flex; align-items: center; gap: 8px;
  background: var(--yail-surface); border: 1px solid var(--yail-border);
  border-radius: 999px; padding: 6px 14px;
  width: 280px; max-width: 100%;
}
.filter-bar .search input {
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 13px; color: var(--yail-text);
  flex: 1;
}
.filter-bar .search input::placeholder { color: var(--yail-text-muted); }
.filter-bar .search svg { color: var(--yail-text-muted); flex-shrink: 0; }
.filter-bar .kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px; color: var(--yail-text-muted);
  border: 1px solid var(--yail-border); border-radius: 4px;
  padding: 2px 6px; background: var(--yail-fill-subtle);
}

/* Launcher grid */
.launcher {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tile {
  position: relative;
  background: var(--yail-surface);
  border: 1px solid var(--yail-border);
  border-radius: 18px;
  padding: 22px 22px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  min-height: 240px;
  box-shadow: var(--shadow-card-soft);
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, border-color .2s;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 4px;
  background: var(--yail-accent);
  opacity: 0;
  transform: translateY(-4px);
  transition: transform .3s, opacity .25s;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--yail-accent);
  box-shadow: var(--shadow-tile);
}
.tile:hover::before { opacity: 1; transform: translateY(0); }
.tile:hover .tile-cta { color: var(--yail-text-strong); gap: 10px; }
.tile:hover .tile-cta::after { transform: translateX(2px); }

.tile-head { display: flex; align-items: center; justify-content: space-between; }
.tile-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; padding: 8px; background: var(--yail-logo-tile); border: 1.5px solid var(--yail-logo-edge); border-radius: 14px; }
.tile-icon img { width: 100%; height: 100%; object-fit: contain; }

.tile-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid transparent;
}
.tile-status.live { color: var(--yail-good); border-color: var(--yail-good-border); background: var(--yail-good-tint); }
.tile-status.beta { color: var(--yail-accent); border-color: color-mix(in srgb, var(--yail-accent) 30%, transparent); background: var(--yail-accent-tint); }
.tile-status.soon { color: var(--yail-text-muted); border-color: var(--yail-border); background: var(--yail-fill-subtle); }
.tile-status .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tile-name { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; color: var(--yail-text); }
.tile-tagline { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--yail-accent); margin-top: 4px; font-weight: 600; }
.tile-desc { margin: 0; color: var(--yail-text-muted); font-size: 13px; line-height: 1.55; text-wrap: pretty; }

.tile-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; border-top: 1px solid var(--yail-border);
}
.tile-slug { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: var(--yail-text-muted); }
.tile-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--yail-text-muted); font-weight: 600;
  transition: color .2s, gap .2s;
}
.tile-cta::after { content: "→"; color: var(--yail-accent); transition: transform .2s; }

.tile.is-hidden { display: none; }
.tile.is-disabled { opacity: .55; cursor: not-allowed; }
.tile.is-disabled:hover { transform: none; border-color: var(--yail-border); box-shadow: var(--shadow-card-soft); }
.tile.is-disabled:hover::before { opacity: 0; }
.tile.is-disabled .tile-cta::after { content: none; }

/* Status strip */
.strip {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 36px;
}
.panel {
  background: var(--yail-surface); border: 1px solid var(--yail-border);
  border-radius: 18px; padding: 22px 24px;
  box-shadow: var(--shadow-card-soft);
}
.panel h4 {
  margin: 0 0 4px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--yail-text-strong);
}
.panel .pd { font-size: 11.5px; color: var(--yail-text-muted); margin: 0 0 16px; letter-spacing: .04em; }

.health { display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.health-row {
  display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px;
  align-items: center;
  font-size: 12.5px; color: var(--yail-text-strong);
}
.health-row .swatch { width: 22px; height: 22px; border-radius: 6px; padding: 3px; background: var(--yail-logo-tile); border: 1.5px solid var(--yail-logo-edge); }
.health-row .swatch img { width: 100%; height: 100%; }
.health-row .nm { font-weight: 500; color: var(--yail-text); }
.health-row .lat { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--yail-text-muted); }
.health-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yail-good); }
.health-row .dot.warn { background: var(--yail-warn); }
.health-row .dot.down { background: var(--yail-danger); }
.health-row .dot.probing { background: var(--yail-surface-sunken); animation: probe-pulse 1.2s ease-in-out infinite; }
@keyframes probe-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.keyboard { display: grid; gap: 10px; }
.kbd-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; font-size: 12.5px; color: var(--yail-text);
}
.kbd-row .keys { display: inline-flex; gap: 4px; }
.kbd-row .keys span {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px; color: var(--yail-text-strong);
  border: 1px solid var(--yail-border); border-radius: 4px;
  padding: 3px 7px; background: var(--yail-fill-subtle);
}
.kbd-row .lbl { color: var(--yail-text-muted); }

/* Authenticated band — your orgs + diagnostics */
.you-band {
  margin-top: 36px;
  background: var(--yail-surface);
  border: 1px solid var(--yail-border);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card-soft);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
}
.you-band h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--yail-text-strong); }
.you-band .pd { font-size: 11.5px; color: var(--yail-text-muted); margin: 0 0 14px; letter-spacing: .04em; }
.you-band ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.you-band li a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--yail-border); background: var(--yail-fill-subtle);
  font-size: 13px; color: var(--yail-text-strong); font-weight: 500;
  transition: border-color .15s, background .15s;
}
.you-band li a:hover { border-color: var(--yail-accent); background: var(--yail-surface); }
.you-band li a code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: var(--yail-text-muted); }
.you-band .empty { color: var(--yail-text-muted); font-size: 13px; }
.diag a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .04em; color: var(--yail-text-muted);
  padding: 4px 0;
}
.diag a:hover { color: var(--yail-text-strong); }

/* Footer */
footer {
  margin-top: 96px; padding-top: 28px;
  border-top: 1px solid var(--yail-border);
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: center;
  font-size: 11.5px; color: var(--yail-text-muted); letter-spacing: .04em;
}
footer .brand-foot { display: flex; align-items: center; gap: 10px; }
footer .brand-foot img { width: 22px; height: 22px; }
footer .links { display: flex; gap: 22px; justify-self: center; }
footer .links a:hover { color: var(--yail-text-strong); }
footer .meta { display: flex; gap: 16px; }
footer .meta b { color: var(--yail-text-strong); font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; }
  .constellation { max-width: 460px; justify-self: start; }
  .sat:not(.inner) { width: 10%; height: auto; aspect-ratio: 1 / 1; padding: 1.6%; }
  .launcher { grid-template-columns: repeat(3, 1fr); }
  .strip { grid-template-columns: 1fr; }
  .topnav nav { display: none; }
  .you-band { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page { padding: 20px 20px 60px; }
  .launcher { grid-template-columns: repeat(2, 1fr); }
  .strip { grid-template-columns: 1fr; }
  .section-h { grid-template-columns: 1fr; }
  .section-d { text-align: left; justify-self: start; }
  footer { grid-template-columns: 1fr; }
  footer .links { justify-self: start; flex-wrap: wrap; }
  .filter-bar .search { width: 100%; }
  /* The headline's last line ("operating system") is one unbreakable run: at the desktop floor of 56px
     it is wider than a phone, so the whole launcher scrolled sideways. */
  .hero-title { font-size: clamp(34px, 10.5vw, 56px); }
  /* The top bar keeps the brand, the health dot and Sign in / Sign out. The health wording is the pill's
     title and the fleet strip below; the person's name is on the account page. */
  .topnav { gap: 12px; padding: 10px 14px; }
  .topnav .right { gap: 8px; }
  .pill-status { padding: 8px; }
  .pill-status .pill-text { display: none; }
  .acct-name { display: none; }
  .acct-form button, .topnav .btn { white-space: nowrap; }
}

/* Fields are 16px on a phone or tablet: iOS Safari zooms the page in when a field under 16px takes focus,
   and leaves it zoomed. The same rule as yail-app-shell.css, which the launcher does not load.
   !important so it wins over every field style, whichever stylesheet set it. */
@media (max-width: 767.98px), (pointer: coarse) {
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]),
  select,
  textarea { font-size: 16px !important; }
}
