@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4efe6;
  --bg-strong: #efe4d4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #fffaf4;
  --border: rgba(95, 73, 45, 0.14);
  --text: #2f271d;
  --muted: #6d614f;
  --accent: #c2613a;
  --accent-strong: #9f4b2a;
  --success: #2f7d57;
  --shadow: 0 20px 50px rgba(78, 53, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(160deg, #f8f3eb 0%, var(--bg) 45%, #efe1cf 100%);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.topbar-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-links a {
  text-decoration: none;
  color: var(--muted);
}

.hero,
.card,
.editor-shell,
.login-shell,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  border-radius: 32px;
  padding: 3rem;
  display: grid;
  gap: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--accent-strong);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
  line-height: 1.05;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  max-width: 12ch;
}

.hero p,
.card p,
.meta,
.instructions-body,
.login-copy {
  color: var(--muted);
  line-height: 1.7;
}

.actions,
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button,
button,
.link-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.button:hover,
button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.button-primary,
button,
.link-button {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #d9784f 100%);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.5rem;
}

.card {
  border-radius: 24px;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  max-width: none;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.instructions-wrap {
  display: grid;
  gap: 1.5rem;
}

.language-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.language-link {
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
}

.language-link.is-active {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #d9784f 100%);
  border-color: transparent;
}

.instructions-body {
  background: var(--surface-strong);
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: clamp(1.3rem, 2vw, 2.4rem);
  box-shadow: var(--shadow);
}

.instructions-body h2,
.instructions-body h3,
.instructions-body h4 {
  color: var(--text);
  margin-top: 2rem;
}

.instructions-body p:first-child {
  margin-top: 0;
}

.instructions-body ul,
.instructions-body ol {
  padding-left: 1.25rem;
}

.instructions-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow: hidden;
}

.instructions-body td,
.instructions-body th {
  border: 1px solid rgba(95, 73, 45, 0.18);
  padding: 0.75rem;
  text-align: left;
}

.instructions-body a {
  color: var(--accent-strong);
}

.instructions-body img {
  border-radius: 18px;
  margin: 1.5rem auto;
  box-shadow: var(--shadow);
}

.login-page,
.admin-page {
  min-height: 100vh;
}

.login-shell,
.editor-shell {
  border-radius: 28px;
  padding: clamp(1.4rem, 2vw, 2rem);
}

.login-shell {
  max-width: 520px;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field label {
  font-weight: 600;
}

.field input {
  border: 1px solid rgba(95, 73, 45, 0.18);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  font: inherit;
  background: white;
}

.meta-row,
.editor-toolbar,
.editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-row {
  margin-bottom: 1rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(47, 125, 87, 0.12);
  color: var(--success);
  font-weight: 600;
}

.error {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(172, 52, 35, 0.12);
  color: #842e1f;
}

.editor-toolbar {
  margin-bottom: 1rem;
}

.editor-toolbar h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  max-width: none;
  margin-bottom: 0.35rem;
}

.editor-host {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(95, 73, 45, 0.14);
}

.editor-actions {
  margin-top: 1rem;
}

.editor-actions form {
  margin: 0;
}

.logout-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(95, 73, 45, 0.16);
}

.help-text {
  font-size: 0.95rem;
  color: var(--muted);
}

.empty-state {
  border-radius: 24px;
  padding: 2rem;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1rem, 1040px);
    padding-top: 1rem;
  }

  .hero,
  .editor-shell,
  .login-shell,
  .instructions-body {
    border-radius: 24px;
    padding: 1.3rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .meta-row,
  .editor-toolbar,
  .editor-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
