:root {
  --bg: #f5efe4;
  --surface: #fffaf2;
  --surface-strong: #fff;
  --surface-dark: #2d241c;
  --text: #2a2118;
  --muted: #6d5c4c;
  --line: rgba(42, 33, 24, 0.12);
  --brand: #c65f2d;
  --brand-strong: #9f4317;
  --accent: #efc15b;
  --success: #2e7d58;
  --danger: #9c3b30;
  --shadow: 0 18px 40px rgba(42, 33, 24, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 193, 91, 0.35), transparent 32%),
    linear-gradient(180deg, #f8f2e6 0%, #f1e7d8 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

.site-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(255, 250, 242, 0.86);
  border-bottom: 1px solid var(--line);
}

.site-nav__inner {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a,
.nav-links button {
  border: 0;
  background: transparent;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links button:hover,
.nav-links .is-active {
  background: rgba(198, 95, 45, 0.12);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.page { padding: 2rem 0 4rem; }

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: end;
  min-height: 28rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: center;
  color: #fff8ee;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 11, 8, 0.14), rgba(16, 11, 8, 0.72));
}

.hero-card > * { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.16);
  border: 1px solid rgba(255, 248, 238, 0.24);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-card h1,
.section-header h1,
.section-header h2 {
  margin: 0.7rem 0 0.8rem;
  line-height: 1.05;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
}

.hero-card p,
.section-header p {
  max-width: 44rem;
  margin: 0;
  color: rgba(255, 248, 238, 0.92);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.section-header h1,
.section-header h2,
.section-header p { color: var(--text); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.8rem 1.15rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 14px 28px rgba(159, 67, 23, 0.24);
}

.btn--secondary {
  color: var(--brand-strong);
  background: rgba(198, 95, 45, 0.12);
}

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.grid { display: grid; gap: 1.2rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card__media {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}

.card__body { padding: 1.25rem; }
.card h3, .card h2 { margin: 0 0 0.55rem; font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 0.8rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(42, 33, 24, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.stack { display: flex; flex-direction: column; gap: 1.2rem; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
}

.panel {
  padding: 1.3rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.panel h2, .panel h3 { margin: 0 0 0.8rem; }
.panel p { color: var(--muted); line-height: 1.6; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(198, 95, 45, 0.08);
}

.stat strong {
  display: block;
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.95rem; }

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.85rem 0.95rem;
  color: var(--text);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.message {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-size: 0.96rem;
}

.message--info { color: #23507a; background: rgba(35, 80, 122, 0.12); }
.message--success { color: var(--success); background: rgba(46, 125, 88, 0.12); }
.message--danger { color: var(--danger); background: rgba(156, 59, 48, 0.12); }

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(42, 33, 24, 0.08);
}

.list-item__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-item__meta small { color: var(--muted); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
}

.search {
  display: flex;
  align-items: center;
  min-width: min(24rem, 100%);
  border-radius: 999px;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.75rem 1rem;
  outline: none;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-size: 0.84rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.showcase {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer { padding: 2rem 0 3rem; color: var(--muted); }

.footer__inner {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.auth-card {
  width: min(28rem, calc(100% - 2rem));
  margin: 3rem auto;
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.centered-page {
  min-height: calc(100vh - 5rem);
  display: grid;
  place-items: center;
}

.demo-credentials { display: grid; gap: 0.75rem; }

.credential {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(42, 33, 24, 0.05);
  color: var(--muted);
}

.puppet-stage {
  position: relative;
  min-height: 22rem;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top center, rgba(239, 193, 91, 0.3), transparent 28%),
    linear-gradient(180deg, #3a2d22 0%, #241912 100%);
  overflow: hidden;
}

.puppet-stage__character {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  width: clamp(9rem, 20vw, 12rem);
  height: clamp(12rem, 25vw, 16rem);
}

.puppet-part {
  position: absolute;
  background: linear-gradient(180deg, #efc15b, #c65f2d);
  border-radius: 999px;
}

.puppet-head {
  width: 4.3rem;
  height: 4.3rem;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.puppet-body {
  width: 5.4rem;
  height: 6.7rem;
  left: 50%;
  top: 3.5rem;
  transform: translateX(-50%);
  border-radius: 32px;
}

.puppet-arm-left,
.puppet-arm-right {
  width: 1.2rem;
  height: 5.5rem;
  top: 4.2rem;
}

.puppet-arm-left { left: 1rem; transform-origin: top center; }
.puppet-arm-right { right: 1rem; transform-origin: top center; }

.puppet-leg-left,
.puppet-leg-right {
  width: 1.35rem;
  height: 5.7rem;
  bottom: 0;
}

.puppet-leg-left { left: 3.2rem; }
.puppet-leg-right { right: 3.2rem; }

.muted { color: var(--muted); }

@media (max-width: 1080px) {
  .grid--4, .showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page { padding-top: 1.25rem; }
  .site-nav__inner { align-items: flex-start; flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .grid--2, .grid--3, .grid--4, .showcase, .stats, .form-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 22rem; }
  .list-item { flex-direction: column; align-items: flex-start; }
  .toolbar { align-items: stretch; }
  .search { width: 100%; }
}
