:root {
  --bg: #0b1420;
  --bg-alt: #101c2c;
  --surface: #131f31;
  --border: #22314a;
  --text: #eef1f6;
  --text-muted: #8c99ac;
  --accent-teal: #35d6c4;
  --accent-teal-dim: rgba(53, 214, 196, 0.14);
  --accent-gold: #e8a33d;
  --accent-gold-dim: rgba(232, 163, 61, 0.16);
  --radius: 14px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(20px, 5vw, 64px);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.lang-btn {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.2s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--accent-teal);
}

.lang-divider {
  color: var(--border);
  font-size: 11px;
}

.nav-admin {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}

.nav-admin:hover {
  color: var(--text);
  border-color: var(--accent-teal);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px clamp(20px, 5vw, 64px) 96px;
}

.contour {
  position: absolute;
  inset: -10% -5%;
  width: 110%;
  height: 120%;
  z-index: 0;
  opacity: 0.5;
}

.contour-lines path {
  fill: none;
  stroke: var(--accent-teal);
  stroke-width: 1.2;
  opacity: 0.35;
}

.contour-lines path:nth-child(2) {
  stroke: var(--accent-gold);
  opacity: 0.22;
}

.contour-lines path:nth-child(4) {
  stroke: var(--accent-gold);
  opacity: 0.18;
}

.contour-lines {
  animation: drift 24s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-1.5%, 1%) scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contour-lines {
    animation: none;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-text {
  max-width: 720px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-gold);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0;
}

/* ---------- Apps grid ---------- */
main {
  padding: 0 clamp(20px, 5vw, 64px) 48px;
}

.apps-section {
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 24px clamp(20px, 5vw, 64px) 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.section-head {
  margin-bottom: 36px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  margin: 8px 0 0;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-teal);
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.app-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

.status-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-live {
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  border-color: rgba(53, 214, 196, 0.3);
}

.status-beta {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-color: rgba(232, 163, 61, 0.3);
}

.status-coming_soon {
  background: rgba(140, 153, 172, 0.12);
  color: var(--text-muted);
  border-color: var(--border);
}

.app-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.app-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
  flex-grow: 1;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

.app-link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-teal);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-link-beta {
  color: var(--accent-gold);
}

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

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-sub {
  font-size: 14px;
}

.empty-state a {
  color: var(--accent-teal);
}

.site-footer {
  padding: 32px clamp(20px, 5vw, 64px);
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ---------- Admin ---------- */
.admin-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px clamp(20px, 5vw, 64px) 96px;
}

.admin-panel h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 8px;
}

.admin-sub {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}

.admin-form label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: 2px solid var(--accent-teal);
  outline-offset: 1px;
}

.admin-form button[type='submit'] {
  margin-top: 18px;
  background: var(--accent-teal);
  color: #06201c;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.admin-form button[type='submit']:hover {
  filter: brightness(1.08);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  margin-top: 14px;
}

.checkbox-label input {
  width: auto;
}

.form-error {
  color: #ff8a8a;
  font-size: 13px;
  margin-top: 10px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-head-actions {
  display: flex;
  gap: 10px;
}

.admin-head-actions button,
.btn-ghost,
.btn-danger {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

#btn-new {
  background: var(--accent-teal);
  color: #06201c;
  border: none;
}

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

.btn-danger {
  color: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.3);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-sub {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  margin-top: 2px;
}

.btn-edit {
  border: none;
  background: transparent;
  color: var(--accent-teal);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.overlay-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

.overlay-panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 4px;
}

.overlay-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  gap: 12px;
}

.overlay-actions button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.overlay-actions button[type='submit'] {
  margin-top: 0;
}

.overlay-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------- How to join beta page ---------- */
.beta-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px) 64px;
}

.beta-nav {
  margin-bottom: 28px;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-teal);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: border-color 0.2s ease;
}

.step-card-highlight {
  border-color: rgba(53, 214, 196, 0.4);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(19, 31, 49, 0.85) 100%);
  box-shadow: 0 4px 20px rgba(53, 214, 196, 0.05);
}

.step-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(53, 214, 196, 0.25);
}

.step-body {
  flex: 1;
}

.step-body h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
}

.step-body p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.step-body p:last-child {
  margin-bottom: 0;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: all 0.2s ease;
}

.step-btn:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  transform: translateY(-1px);
}

.step-btn-primary {
  background: var(--accent-teal);
  color: #06201c;
  border-color: var(--accent-teal);
}

.step-btn-primary:hover {
  background: #4ae0cf;
  color: #06201c;
}

.step-notice {
  font-size: 13px;
  color: var(--accent-gold);
  font-family: var(--font-mono);
  background: var(--accent-gold-dim);
  padding: 8px 14px;
  border-radius: 6px;
  display: inline-block;
}

/* ---------- Accessibility & responsive ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 48px;
    padding-bottom: 64px;
  }

  .step-card {
    padding: 20px;
    gap: 14px;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}