:root {
  color-scheme: light dark;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --ink: #17221d;
  --muted: #5c6b63;
  --line: #d9e1dc;
  --green: #157a4a;
  --green-soft: #dff4e9;
  --amber: #a45b00;
  --amber-soft: #fff0d7;
  --red: #b4232d;
  --red-soft: #fde5e7;
  --accent: #225dcc;
  --shadow: 0 1.5rem 4rem rgb(23 34 29 / 10%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101713;
    --surface: #18221d;
    --ink: #edf5f0;
    --muted: #b4c1b9;
    --line: #34443a;
    --green: #69d59d;
    --green-soft: #173b29;
    --amber: #ffc168;
    --amber-soft: #3c2a11;
    --red: #ff8e96;
    --red-soft: #431e22;
    --accent: #9ab9ff;
    --shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

.site-header,
main,
footer {
  width: min(68rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header { padding: 1.25rem 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand img { border-radius: .65rem; }

main { padding: clamp(2.5rem, 8vw, 6.5rem) 0 4rem; }

.checker {
  max-width: 50rem;
  margin-inline: auto;
  text-align: center;
}

.status-orb {
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
}

.status-orb span {
  width: 2rem;
  height: 2rem;
  border: .45rem solid var(--green);
  border-radius: 50%;
}

.checker--checking .status-orb { background: var(--amber-soft); }
.checker--checking .status-orb span {
  border-color: var(--amber) transparent var(--amber) var(--amber);
  animation: spin .9s linear infinite;
}
.checker--offline .status-orb { background: var(--red-soft); }
.checker--offline .status-orb span {
  border-color: var(--red);
  position: relative;
}
.checker--offline .status-orb span::after {
  content: "";
  position: absolute;
  width: 2.6rem;
  height: .45rem;
  left: 50%;
  top: 50%;
  border-radius: 1rem;
  background: var(--red);
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2 { letter-spacing: -.035em; }

h1 {
  max-width: 16ch;
  margin: 0 auto;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: .98;
}

.checker-detail {
  max-width: 38rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
}

.explanation {
  max-width: 40rem;
  margin: 2rem auto 0;
  color: var(--muted);
  text-align: left;
}

.explanation summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.explanation p { margin: .8rem 0 0; }

.app-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  max-width: 58rem;
  margin: clamp(4rem, 10vw, 8rem) auto 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-card > img { border-radius: 1rem; }
.app-card h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.app-card p:not(.eyebrow) { margin: .4rem 0 0; color: var(--muted); }

.store-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  min-width: 12.5rem;
}

.store-actions [hidden] { display: none; }
#store-badge-wrap:not([hidden]) { display: flex; }
.store-actions ms-store-badge::part(img) { width: 11.5rem; max-width: 100%; height: auto; }
.store-listing-link {
  padding: .45rem .75rem;
  border: 1px solid var(--muted);
  border-radius: .5rem;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.store-listing-link:hover { background: var(--bg); }

@media (prefers-color-scheme: dark) {
  #store-badge-wrap:not([hidden]) {
    border-radius: .5rem;
    outline: 1px solid var(--muted);
    outline-offset: 2px;
  }
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.privacy-main { padding-top: clamp(2rem, 5vw, 4rem); }

.privacy-article {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.privacy-article h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}
.privacy-article h2 { margin: 2.2rem 0 .55rem; font-size: 1.35rem; }
.privacy-article p { margin: .7rem 0; }
.privacy-article .intro,
.privacy-article .updated { color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: .2rem solid var(--accent); outline-offset: .2rem; }

@media (max-width: 42rem) {
  .app-card { grid-template-columns: auto 1fr; }
  .store-actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
