/* msmoth.space — layout & theme */
:root {
  --bg-deep: #0c0e14;
  --bg-elevated: #12151f;
  --bg-card: #161a26;
  --border: rgba(232, 220, 200, 0.12);
  --text: #e8dcc8;
  --text-muted: rgba(232, 220, 200, 0.65);
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --accent-glow: rgba(201, 162, 39, 0.35);
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 162, 39, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(80, 60, 120, 0.08), transparent);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: #e4c04a;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.container.narrow {
  width: min(720px, 100% - 2.5rem);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

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

.logo-mark {
  color: var(--accent);
  font-size: 1rem;
}

.logo-tld {
  font-weight: 600;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(145deg, #d4af37, #a67c00);
  color: #0c0e14;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #e4c04a, #b8890a);
  color: #0c0e14;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: var(--accent-soft);
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--accent);
}

.btn-ghost:hover {
  background: rgba(201, 162, 39, 0.25);
  color: #f0d878;
}

.btn-block {
  width: 100%;
  padding: 0.85rem 1.25rem;
}

/* Hero */
main {
  position: relative;
  z-index: 1;
}

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 36ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.orbit {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 1;
}

.orbit-ring {
  position: absolute;
  inset: 10%;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: pulse-ring 6s ease-in-out infinite;
}

.orbit-glow {
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  animation: pulse-glow 5s ease-in-out infinite alternate;
}

@keyframes pulse-ring {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.7;
  }
}

@keyframes pulse-glow {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Sections */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-alt {
  background: rgba(18, 21, 31, 0.5);
  border-block: 1px solid var(--border);
}

.section h2,
.section-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

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

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.feature-icon {
  display: block;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  font-size: 0.95rem;
}

/* Auth */
.main-auth {
  padding: clamp(3rem, 8vw, 5rem) 0;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
}

.auth-panel {
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.auth-lead {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-message {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.form-message--error {
  color: #f0c4c4;
  background: rgba(180, 60, 60, 0.2);
  border-color: rgba(220, 100, 100, 0.45);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field input {
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox input {
  accent-color: var(--accent);
}

.link-muted {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.auth-note {
  margin: 1.75rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-aside {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(201, 162, 39, 0.04);
}

.auth-quote {
  margin: 0;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 28ch;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(12, 14, 20, 0.95);
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-copy {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232, 220, 200, 0.4);
}

@media (min-width: 769px) {
  .footer-copy {
    width: auto;
    text-align: right;
  }
}

/* Mobile */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    min-height: 200px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    order: -1;
    min-height: 120px;
  }
}

@media (max-width: 768px) {
  .site-header {
    position: relative;
  }

  .logo {
    order: 0;
    margin-right: auto;
  }

  .header-actions {
    order: 1;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .nav {
    order: 4;
    flex: 1 0 100%;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0;
    background: transparent;
    border-bottom: none;
    display: none;
  }

  body.nav-open .nav {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .header-actions {
    margin-left: 0;
  }

  .header-actions .btn {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}
