:root {
  --bg: #f2f5f3;
  --card: #ffffff;
  --text: #18221c;
  --muted: #687369;
  --line: #d7dfd8;
  --accent: #1f6a4a;
  --accent-weak: #e7f2ec;
  --danger: #a33232;
  --clean: #2f8a5d;
  --unclean: #c44848;
  --questionable: #cc8a31;
  --levain: #2d7f89;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 0% -10%, #e8f2ec 0%, transparent 70%),
    radial-gradient(700px 400px at 100% 0%, #edf0f7 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.site-header a {
  color: var(--text);
  text-decoration: none;
  margin-left: 16px;
}

.site-header .brand {
  margin-left: 0;
  font-weight: 700;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  flex: 1;
}

.site-footer {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: start;
}

.footer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.footer-copy,
.footer-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links-left {
  grid-column: 1;
  justify-content: flex-start;
}

.footer-links-right {
  grid-column: 2;
  justify-content: flex-end;
}

.footer-meta {
  grid-column: 1 / -1;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.content,
.studio-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.content h1 {
  margin-top: 0;
}

.content p,
.content li {
  color: #33413a;
  line-height: 1.55;
}

.contact-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px;
}

.contact-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.contact-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.contact-form button {
  justify-self: start;
}

.contact-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.lp-shell {
  display: grid;
  gap: 18px;
  position: relative;
}

.lp-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 280px at 100% 0%, rgba(31, 106, 74, 0.14), transparent 70%),
    radial-gradient(620px 320px at 0% 12%, rgba(36, 79, 122, 0.1), transparent 72%);
}

.lp-hero,
.lp-section,
.lp-grid3 {
  position: relative;
  z-index: 1;
}

.lp-hero,
.lp-section,
.lp-card {
  border: 1px solid #dbe5de;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 28px -24px rgba(24, 34, 28, 0.55);
}

.lp-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  padding: 28px;
}

.lp-eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
}

.lp-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.lp-hero p {
  margin: 12px 0 0;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.5;
}

.lp-cta-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #1f6a4a, #2c8860);
  color: #fff;
  font-weight: 600;
}

.lp-store.is-disabled {
  background: #87928b;
  cursor: not-allowed;
}

.lp-phone {
  border: 1px solid #dbe9e0;
  border-radius: 18px;
  background: linear-gradient(180deg, #f5fbf7, #eef7f1);
  padding: 14px;
}

.lp-phone-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: #24342c;
  font-weight: 700;
}

.lp-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #dbe9e0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.lp-pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.lp-pill.clean { background: #e5f4ec; color: var(--clean); }
.lp-pill.unclean { background: #f9e6e6; color: var(--unclean); }
.lp-pill.questionable { background: #fff3e2; color: var(--questionable); }

.lp-grid3,
.lp-grid2 {
  display: grid;
  gap: 12px;
}

.lp-grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lp-grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lp-card {
  padding: 16px;
}

.lp-card h3,
.lp-section h2 {
  margin: 0;
}

.lp-card p,
.lp-section p {
  margin: 8px 0 0;
  color: var(--muted);
}

.lp-section {
  padding: 22px;
}

.lp-video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px dashed #c8d8cf;
  background: linear-gradient(135deg, #f5faf7, #edf5f0);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  padding: 10px;
  margin-bottom: 10px;
}

.lp-studio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lp-studio-link {
  background: linear-gradient(135deg, #244f7a, #346496);
}

.landing-shell {
  display: grid;
  gap: 22px;
  position: relative;
}

.landing-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(650px 300px at 90% -5%, rgba(31, 106, 74, 0.14), transparent 70%),
    radial-gradient(600px 260px at 10% 8%, rgba(36, 79, 122, 0.12), transparent 70%);
  pointer-events: none;
}

.landing-hero,
.landing-section,
.landing-proof {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(215, 223, 216, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 40px -36px rgba(20, 36, 28, 0.6);
  animation: fade-slide-in 0.45s ease both;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  padding: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-hero h1,
.landing-section h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero-copy {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 54ch;
  line-height: 1.5;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 15px;
  background: linear-gradient(135deg, #1f6a4a, #2c8860);
  color: #fff;
  font-weight: 600;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.store-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px -14px rgba(0, 0, 0, 0.55);
}

.store-button.is-disabled {
  background: #8b968e;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.store-button.studio-link {
  background: linear-gradient(135deg, #244f7a, #346496);
}

.hero-device-stack {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 12px;
}

.device-card {
  width: min(260px, 50%);
  background: linear-gradient(180deg, #fbfffc, #edf7f1);
  border: 1px solid #d9e7de;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 14px 30px -28px rgba(0, 0, 0, 0.55);
}

.device-card.first {
  margin-top: 12px;
}

.device-card.second {
  margin-bottom: 12px;
}

.device-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #27352e;
}

.device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #dce8e0;
  font-size: 13px;
}

.badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.badge.clean { background: #e5f4ec; color: var(--clean); }
.badge.unclean { background: #f9e6e6; color: var(--unclean); }
.badge.questionable { background: #fff3e2; color: var(--questionable); }

.landing-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.landing-proof article {
  border: 1px solid #dfebe3;
  border-radius: 14px;
  padding: 12px;
  background: #fcfffd;
}

.landing-proof h3 {
  margin: 0;
}

.landing-proof p {
  margin: 6px 0 0;
  color: var(--muted);
}

.landing-section {
  padding: 24px;
}

.section-heading {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
}

.landing-section p {
  color: var(--muted);
  line-height: 1.5;
}

.feature-grid,
.video-grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.video-card {
  border: 1px solid #dbe8e0;
  background: linear-gradient(180deg, #fcfffd, #f6fbf8);
  border-radius: 16px;
  padding: 16px;
}

.feature-card h3,
.video-card h3 {
  margin: 0;
}

.feature-card p,
.video-card p {
  margin: 8px 0 0;
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px dashed #c8dad0;
  background: linear-gradient(135deg, #f4faf6, #eef7f1);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  padding: 10px;
  margin-bottom: 10px;
}

.landing-download {
  text-align: center;
}

.download-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.landing-studio-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@keyframes fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.studio-header h2 {
  margin: 0 0 6px;
}

.studio-header p {
  margin: 0;
  color: var(--muted);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.load-bar {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.load-bar input {
  border-radius: 10px 0 0 10px;
  width: 260px;
  font-size: 13px;
}

.load-bar button {
  border-radius: 0 10px 10px 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.studio-doc-links {
  justify-content: flex-end;
}

.panel-header button {
  font-size: 13px;
}

.button-secondary {
  background: #244f7a;
}

.button-secondary:hover {
  background: #1e4070;
}

.button-icon {
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.button-icon:hover {
  background: var(--accent-weak);
  border-color: var(--accent);
}

.button-icon.copied {
  background: var(--accent-weak);
  border-color: var(--accent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { opacity: 0.93; }

.button-secondary {
  background: #244f7a;
}

.button-danger {
  background: var(--danger);
}

.status-strip {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.clean { background: #e5f4ec; color: var(--clean); }
.status-chip.unclean { background: #f9e6e6; color: var(--unclean); }
.status-chip.questionable { background: #fff3e2; color: var(--questionable); }
.status-chip.levain { background: #e6f5f6; color: var(--levain); }
.status-chip.neutral { background: #edf1ee; color: #55635b; }

.validation {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
}

.validation.ok { color: var(--accent); }
.validation.error { color: var(--danger); }

.validation-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--danger);
  font-size: 13px;
}

.studio-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fcfefd;
}

.panel h3 {
  margin: 0 0 12px;
}

.panel h4 {
  margin: 0 0 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.list-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.ingredient-list,
.entity-list {
  margin-top: 10px;
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.entity-item {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 6px;
}

.entity-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-weak);
}

.entity-title {
  font-weight: 700;
}

.entity-meta {
  color: var(--muted);
  font-size: 12px;
}

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

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.editor-form {
  display: grid;
  gap: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
  background: #f9fbf9;
}

.optional-panel,
.preview-panel {
  margin-top: 14px;
}

.ingredients-panel {
  margin-top: 14px;
}

.ingredients-grid {
  margin-top: 8px;
  grid-template-columns: 360px 1fr;
}

.optional-grid {
  margin-top: 8px;
  grid-template-columns: 320px 1fr;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
}

.preview-header h3 {
  margin: 0;
  flex-shrink: 0;
}

.preview-header .preview-actions {
  display: flex;
  gap: 8px;
}

#json-preview {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
  background: #f8fbf9;
}

@media (max-width: 980px) {
  .lp-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .lp-grid3,
  .lp-grid2 {
    grid-template-columns: 1fr;
  }

  .lp-section {
    padding: 16px;
  }

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

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .hero-device-stack {
    justify-content: center;
  }

  .device-card {
    width: min(280px, 100%);
  }

  .landing-proof {
    grid-template-columns: 1fr;
  }

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

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

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

  .ingredient-list,
  .entity-list {
    max-height: 320px;
  }

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

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

@media (max-width: 760px) {
  .container {
    padding: 10px;
  }

  .content,
  .studio-shell,
  .lp-hero,
  .lp-section,
  .lp-card,
  .landing-hero,
  .landing-section,
  .landing-proof {
    padding: 12px;
  }

  .lp-cta-row,
  .hero-actions {
    flex-direction: column;
  }

  .landing-studio-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .lp-store,
  .store-button {
    width: 100%;
  }

  .site-header {
    padding: 10px 12px;
  }

  .site-header nav {
    display: none;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-links-left,
  .footer-links-right {
    grid-column: auto;
  }
}
