/* Issue #217 — MeshContinuum's public front page.
 *
 * Dark by default (matches the Reader's own default theme, and the
 * `color-scheme: dark` meta tag), high-contrast, no external fonts or
 * frameworks — this page has no build step, so nothing here can be a
 * bundled dependency.
 */

:root {
  --bg: #0b0e14;
  --bg-panel: #12161f;
  --border: #262c3a;
  --text: #e8ebf1;
  --text-muted: #9aa3b5;
  --accent: #5eb1ff;
  --accent-strong: #8fc9ff;
  --success: #6ee7a8;
  --error: #ff8a8a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.wordmark-short {
  color: var(--text-muted);
  font-weight: 400;
}

.invitation-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

@media (min-width: 800px) {
  .content {
    flex-direction: row;
    align-items: flex-start;
    padding-top: 4rem;
  }
}

.hero {
  flex: 1.3;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 1rem;
}

.independence-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--border);
}

.github-link {
  display: inline-block;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.github-link:hover,
.github-link:focus-visible {
  border-bottom-color: var(--accent-strong);
}

.login-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}

.login-state.hidden {
  display: none;
}

.login-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.login-copy {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#login-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#login-form input[type="email"] {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

#login-form input[type="email"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#login-submit {
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #05131f;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

#login-submit:hover:not(:disabled) {
  background: var(--accent-strong);
}

#login-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

#login-submit:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.login-status {
  min-height: 1.2em;
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
}

.login-status-sent {
  color: var(--success);
}

.login-status-error,
.login-status-throttled {
  color: var(--error);
}

.login-status-pending {
  color: var(--text-muted);
}

.open-reader-button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #05131f;
  font-weight: 600;
  text-decoration: none;
}

.open-reader-button:hover {
  background: var(--accent-strong);
}

.page-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.page-footer p {
  max-width: 960px;
  margin: 0 auto;
}

.page-footer a {
  color: inherit;
}

/* Issue #551 — architecture diagram and use-case showcase, added below
 * the existing hero/login row rather than inside it: both are wider
 * than the 960px `.content` column, and neither belongs to the login
 * flow. */

.wide-section {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.wide-section h2 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.section-lede {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  max-width: 720px;
}

.section-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

.architecture-diagram {
  width: 100%;
  height: auto;
  display: block;
}

.optional-boundary {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.boundary-label {
  fill: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.diagram-box {
  fill: var(--bg-panel);
  stroke: var(--border);
  stroke-width: 1.5;
}

.diagram-box-core {
  stroke: var(--success);
}

.diagram-box-accent {
  stroke: var(--accent);
}

.box-title {
  fill: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.box-line {
  fill: var(--text-muted);
  font-size: 12px;
}

.diagram-arrow {
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.arrow-head {
  fill: var(--text-muted);
}

.edge-label {
  fill: var(--text-muted);
  font-size: 11px;
}

.works-alone-label {
  fill: var(--success);
  font-size: 11px;
  font-style: italic;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 800px) {
  .showcase-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.showcase-item {
  margin: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.showcase-item img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--border);
}

.showcase-item figcaption {
  padding: 1rem 1.25rem 1.25rem;
}

.showcase-item h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.showcase-item p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
