:root {
  --bg: #fffaf3;
  --surface: #ffffff;
  --text: #2a2118;
  --muted: #6b5f52;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --border: #eadfce;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1712;
    --surface: #262019;
    --text: #f4ece1;
    --muted: #b8a995;
    --accent: #f97316;
    --accent-text: #1c1712;
    --border: #3a3128;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.site-header,
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 24px;
}

.site-header { border-bottom: 1px solid var(--border); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; margin-top: 48px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.brand-mark { height: 38px; width: auto; border-radius: 8px; background: #ffffff; }

nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--accent); }
nav .login { font-weight: 600; color: var(--accent); }

main { max-width: 880px; margin: 0 auto; padding: 0 24px; }

.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: center; gap: 32px; padding: 48px 0 32px; }
.hero-logo { width: 100%; max-width: 360px; height: auto; justify-self: center; border-radius: 24px; background: #ffffff; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; margin: 0 0 12px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0 0 24px; }

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.section { padding: 32px 0 0; }
.section h2 { margin: 0 0 12px; font-size: 24px; }
.hint { color: var(--muted); margin: 0 0 16px; }

.cards { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards li { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.cards h3 { margin: 0 0 6px; }
.cards p { margin: 0; color: var(--muted); }

/* Environment switch: always floating, bottom-centre of the viewport. */
body { padding-bottom: 88px; }

.env-switch {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.env-label { color: var(--muted); letter-spacing: 0.04em; }
.env-label[data-active="true"] { color: var(--text); }

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--muted);
  cursor: pointer;
  transition: background 0.2s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] .knob { transform: translateX(22px); }

#env-origin {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 520px) {
  #env-origin { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .switch, .switch .knob { transition: none; }
}
