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

:root {
  --bg: #f2eee7;
  --ink: #1e1a18;
  --ink-soft: #5f584f;
  --line: #d8cec1;
  --card: rgba(255, 250, 244, 0.84);
  --card-solid: #fffaf3;
  --accent: #a5562b;
  --accent-2: #d48049;
  --danger: #b24332;
  --shadow-soft: 0 20px 50px rgba(71, 45, 23, 0.12);
  --shadow-card: 0 10px 28px rgba(89, 55, 29, 0.09);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Space Grotesk", "Trebuchet MS", "Tahoma", sans-serif;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.7;
}

.ambient-a {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(212, 128, 73, 0.35), transparent 70%);
  top: -180px;
  left: -120px;
}

.ambient-b {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(84, 119, 125, 0.28), transparent 65%);
  right: -220px;
  bottom: -230px;
}

.container {
  width: min(1280px, 100% - 36px);
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 110;
  background: rgba(242, 238, 231, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(160, 135, 113, 0.2);
}

.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(155deg, #794322 0%, #be7643 100%);
  box-shadow: var(--shadow-card);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.03em;
}

.brand-text small {
  font-size: 12px;
  color: var(--ink-soft);
}

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

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 7px 10px;
  border: 1px solid rgba(160, 135, 113, 0.4);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
}

.language-switcher select {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  outline: 0;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.btn-primary {
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(164, 90, 47, 0.35);
}

.btn-soft {
  background: rgba(164, 90, 47, 0.1);
  color: var(--ink);
  border-color: rgba(164, 90, 47, 0.28);
}

.btn-outline {
  background: rgba(255, 251, 246, 0.85);
  color: var(--ink);
  border-color: rgba(134, 109, 87, 0.4);
}

.btn-danger {
  background: rgba(178, 67, 50, 0.12);
  color: #6b1c10;
  border-color: rgba(178, 67, 50, 0.35);
}

.hero {
  padding: 56px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

.hero h1 {
  margin-top: 12px;
  max-width: 820px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 20px 0 0;
  max-width: 720px;
  line-height: 1.7;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-metrics {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.hero-metrics article {
  border: 1px solid rgba(161, 135, 112, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.72);
  padding: 14px;
}

.hero-metrics strong {
  display: block;
  font-size: 26px;
}

.hero-metrics span {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.hero-card {
  background: linear-gradient(165deg, rgba(255, 249, 240, 0.95), rgba(253, 239, 226, 0.93));
  border: 1px solid rgba(173, 138, 102, 0.3);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.hero-card h2 {
  font-size: 24px;
  font-family: "Cormorant Garamond", Georgia, serif;
  margin-bottom: 8px;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.75;
  color: #54483d;
  font-size: 14px;
}

.hero-card-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(139, 100, 67, 0.5);
  border-radius: var(--radius-sm);
  color: #5e4f42;
  font-size: 13px;
  background: rgba(255, 250, 243, 0.7);
}

.value-strip {
  padding: 8px 0 24px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 12px;
}

.value-grid article {
  background: rgba(255, 250, 244, 0.8);
  border: 1px solid rgba(175, 145, 118, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
}

.value-grid h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.value-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.planner-section {
  padding: 18px 0 36px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(32px, 4.5vw, 54px);
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 0.95;
}

.section-heading p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 900px;
}

.planner-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 14px;
}

.planner-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 1240px;
  overflow: auto;
  padding-right: 2px;
}

.panel-block {
  background: var(--card);
  border: 1px solid rgba(168, 138, 110, 0.33);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 14px;
}

.panel-block h3 {
  font-size: 17px;
  margin-bottom: 9px;
}

.panel-block label {
  display: block;
  margin-bottom: 8px;
}

.panel-block label span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.panel-block input,
.panel-block select,
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(135, 111, 90, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.panel-block input:focus,
.panel-block select:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(172, 93, 48, 0.16);
}

.field-grid {
  display: grid;
  gap: 8px;
}

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

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

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

.preset-button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(155, 121, 91, 0.38);
  background: rgba(255, 253, 250, 0.84);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.preset-button strong {
  display: block;
  font-size: 13px;
}

.preset-button small {
  font-size: 11px;
  color: var(--ink-soft);
}

.selected-details {
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(140, 112, 84, 0.45);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 8px;
  min-height: 56px;
}

.planner-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.button-grid {
  display: grid;
  gap: 8px;
}

.button-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 8px;
}

.fake-file-btn {
  width: 100%;
}

#importJsonInput {
  display: none;
}

.workspace {
  background: var(--card);
  border: 1px solid rgba(165, 135, 107, 0.34);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.workspace-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-head h3 {
  font-size: 22px;
}

.workspace-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.canvas-shell {
  margin-top: 10px;
  border-radius: 18px;
  overflow: hidden;
  background: #f7f0e6;
  border: 1px solid rgba(145, 110, 77, 0.34);
  min-height: 620px;
}

canvas {
  width: 100%;
  height: 620px;
  display: block;
}

.workspace-footer {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.summary-card {
  border-radius: 12px;
  border: 1px solid rgba(142, 113, 86, 0.3);
  background: rgba(255, 254, 251, 0.82);
  padding: 10px;
}

.summary-card strong {
  display: block;
  font-size: 20px;
}

.summary-card span {
  font-size: 12px;
  color: var(--ink-soft);
}

.module-table-wrap {
  border: 1px solid rgba(153, 124, 98, 0.3);
  border-radius: 12px;
  overflow: auto;
  max-height: 210px;
  background: rgba(255, 252, 248, 0.83);
}

.module-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.module-table th,
.module-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(179, 151, 124, 0.2);
  text-align: left;
}

.module-table tr:last-child td {
  border-bottom: 0;
}

.module-table tbody tr {
  cursor: pointer;
}

.module-table tbody tr.active {
  background: rgba(190, 119, 74, 0.17);
}

.projects,
.about,
.contacts {
  padding: 42px 0;
}

.project-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.project-grid article {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(155, 123, 92, 0.3);
  background: rgba(255, 252, 247, 0.84);
}

.project-grid p,
.about p,
.contacts p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.about-grid,
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.about-card,
.contact-form {
  border-radius: var(--radius-md);
  border: 1px solid rgba(163, 132, 102, 0.31);
  background: rgba(255, 252, 247, 0.85);
  padding: 16px;
}

.about-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.contact-list {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.contact-list li {
  color: var(--ink-soft);
}

.contact-list a {
  color: var(--accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form h3 {
  font-size: 20px;
}

.contact-form label span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.contact-result {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: #2f7a4f;
}

.footer {
  border-top: 1px solid rgba(154, 121, 92, 0.3);
  padding: 18px 0 24px;
  background: rgba(242, 236, 227, 0.8);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(26, 22, 18, 0.92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1140px) {
  .hero-grid,
  .planner-layout,
  .workspace-footer,
  .about-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .planner-panel {
    max-height: none;
  }

  .canvas-shell,
  canvas {
    min-height: 520px;
    height: 520px;
  }
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

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

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

  .value-grid,
  .hero-metrics,
  .summary-cards,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .field-grid.two,
  .button-grid.two,
  .preset-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 72px;
  }

  .container {
    width: min(1280px, 100% - 24px);
  }

  .header-actions .btn {
    display: none;
  }

  .field-grid.two,
  .button-grid.two,
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .canvas-shell,
  canvas {
    min-height: 420px;
    height: 420px;
  }
}
