:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --border: #1e1e22;
  --text: #e8e6e3;
  --muted: #8a8680;
  --accent: #f7931a;
  --accent-dim: rgba(247, 147, 26, 0.12);
  --accent-hover: #ff9f2e;
  --danger: #e05a5a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.tos-locked {
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
  pointer-events: none;
}

.glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}

.page-main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
}

.page-header {
  width: 100%;
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.legal-doc {
  width: 100%;
  max-width: 42rem;
  text-align: left;
}

.legal-doc h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.legal-doc h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.35rem;
  color: var(--muted);
  font-weight: 600;
}

.legal-doc p,
.legal-doc li {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.legal-doc ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.legal-doc a {
  color: var(--accent);
}

.notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem !important;
  color: var(--text) !important;
}

.notice + .notice {
  margin-top: 0.75rem;
}

.home-main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.logo {
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(247, 147, 26, 0.08), 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 28rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.card {
  max-width: 26rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
}

.card p + p {
  margin-top: 0.75rem;
}

.site-footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.85;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/* Terms gate overlay */
.tos-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(8px);
}

.tos-gate[hidden] {
  display: none !important;
}

.tos-panel {
  width: 100%;
  max-width: 26rem;
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.tos-panel .logo {
  margin-left: auto;
  margin-right: auto;
}

.tos-panel h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tos-panel .intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  text-align: left;
}

.tos-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}

.tos-check input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.tos-check a {
  color: var(--accent);
}

.tos-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.tos-decline-msg {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 1.2em;
}
