:root {
  --ink: #4f3c27;
  --ink-soft: #725b40;
  --cream: #eee6dc;
  --milk: #f8f2e8;
  --latte: #d7c5ae;
  --caramel: #b1885b;
  --gold: #c9a46d;
  --shadow: 0 24px 70px rgba(73, 52, 29, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 248, 236, 0.95), transparent 28rem),
    radial-gradient(circle at 80% 16%, rgba(181, 143, 94, 0.18), transparent 24rem),
    linear-gradient(135deg, #eee4d8 0%, #d9c8b3 48%, #f5efe6 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border: 1px solid rgba(91, 66, 39, 0.16);
  border-radius: 28px;
  background: rgba(248, 242, 232, 0.74);
  box-shadow: 0 14px 38px rgba(76, 54, 31, 0.1);
  backdrop-filter: blur(22px);
}

.brand-mark {
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(80, 58, 35, 0.12);
  border-radius: 50%;
  background: var(--milk);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(93, 66, 38, 0.08);
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink-soft);
  background: transparent;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

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

.tab.is-active {
  color: var(--milk);
  background: var(--ink);
}

.view {
  display: none;
  animation: riseIn 0.48s ease both;
}

.view.is-visible {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(310px, 0.96fr);
  gap: 28px;
  align-items: center;
  min-height: 560px;
  padding: 34px 0 22px;
}

.hero-copy {
  padding: 28px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--caramel);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.96;
}

h1 {
  font-size: clamp(4.5rem, 14vw, 9.4rem);
  font-weight: 600;
}

h2 {
  font-size: clamp(2.2rem, 6vw, 4.3rem);
  font-weight: 600;
}

h3 {
  font-size: 2rem;
  font-weight: 600;
}

.hero-text {
  max-width: 560px;
  margin: 18px 0 0;
  color: #6d5a43;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

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

.primary-action,
.ghost-action,
.checkout-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.primary-action,
.checkout-button {
  color: #fff9ef;
  background: linear-gradient(135deg, #4c3824, #8c6842);
  box-shadow: 0 16px 34px rgba(79, 60, 39, 0.22);
}

.ghost-action {
  color: var(--ink);
  border: 1px solid rgba(79, 60, 39, 0.18);
  background: rgba(255, 251, 244, 0.48);
}

.primary-action:hover,
.ghost-action:hover,
.checkout-button:hover {
  transform: translateY(-2px);
}

.hero-visual {
  position: relative;
  min-height: 450px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 42px;
  border: 1px solid rgba(77, 55, 33, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.78), rgba(216, 196, 170, 0.58)),
    url("assets/karma-avatar.jpg") center / cover;
  box-shadow: var(--shadow);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(238, 228, 214, 0.68);
  backdrop-filter: blur(2px);
}

.hero-visual img {
  position: relative;
  width: min(78%, 420px);
  border-radius: 30px;
  box-shadow: 0 28px 90px rgba(71, 50, 28, 0.24);
  animation: floatLogo 5.2s ease-in-out infinite;
}

.orbit {
  position: absolute;
  z-index: 2;
  width: 78%;
  height: 38%;
  border: 2px solid rgba(77, 55, 33, 0.46);
  border-color: rgba(77, 55, 33, 0.5) transparent transparent transparent;
  border-radius: 50%;
  animation: orbitDrift 7s ease-in-out infinite;
}

.orbit-one {
  transform: rotate(-14deg);
}

.orbit-two {
  width: 52%;
  height: 26%;
  transform: rotate(158deg);
  animation-delay: -2s;
}

.spark {
  position: absolute;
  z-index: 3;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  background: var(--ink);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: sparkle 2.6s ease-in-out infinite;
}

.spark-one {
  top: 25%;
  right: 21%;
}

.spark-two {
  left: 24%;
  bottom: 24%;
  animation-delay: 1.1s;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 34px;
}

.stats-strip div,
.product-card,
.cart-panel,
.product-form,
.crm-panel,
.admin-summary,
.order-item {
  border: 1px solid rgba(83, 60, 36, 0.13);
  background: rgba(255, 250, 242, 0.56);
  box-shadow: 0 14px 44px rgba(77, 55, 33, 0.09);
  backdrop-filter: blur(18px);
}

.stats-strip div {
  padding: 18px;
  border-radius: 24px;
}

.stats-strip strong {
  display: block;
  font-size: 1.6rem;
}

.stats-strip span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  border: 1px solid rgba(79, 60, 39, 0.16);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: rgba(255, 249, 239, 0.62);
}

.pill.is-active {
  color: var(--milk);
  background: var(--ink);
}

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

.product-card {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  border-radius: 28px;
  padding: 18px;
  animation: riseIn 0.42s ease both;
}

.product-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -50% -20%;
  height: 150px;
  background: radial-gradient(circle, rgba(201, 164, 109, 0.36), transparent 62%);
  transition: transform 0.35s ease;
}

.product-card:hover::after {
  transform: translateY(-20px);
}

.product-art {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 28px;
  border-radius: 18px;
  color: #fff8ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  background: linear-gradient(135deg, #4d3824, #b38b59);
}

.product-card h3 {
  font-family: Inter, sans-serif;
  font-size: 1.12rem;
  line-height: 1.25;
}

.product-card p {
  min-height: 54px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.product-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.price {
  font-size: 1.35rem;
  font-weight: 900;
}

.buy-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  color: #fff9ee;
  font-weight: 800;
  background: var(--ink);
}

.cart-panel {
  position: fixed;
  right: max(14px, calc((100vw - 1180px) / 2));
  bottom: 16px;
  z-index: 30;
  width: min(360px, calc(100vw - 28px));
  max-height: 68vh;
  overflow: auto;
  padding: 18px;
  border-radius: 28px;
  transform: translateY(calc(100% - 78px));
  transition: transform 0.35s ease;
}

.cart-panel:hover,
.cart-panel.has-items {
  transform: translateY(0);
}

.cart-items {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.cart-item,
.crm-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.68);
}

.cart-item button,
.block-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(79, 60, 39, 0.1);
}

.checkout-button {
  width: 100%;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.order-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
}

.order-item p {
  margin: 7px 0 0;
  color: var(--ink-soft);
}

.status {
  border-radius: 999px;
  padding: 8px 10px;
  color: #fff8ed;
  font-weight: 800;
  background: linear-gradient(135deg, #4d3824, #9a754e);
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding-top: 34px;
}

.admin-summary,
.product-form,
.crm-panel {
  border-radius: 28px;
  padding: 20px;
}

.admin-summary {
  align-self: start;
  position: sticky;
  top: 96px;
}

.admin-summary p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.mini-metrics {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mini-metrics span {
  display: flex;
  justify-content: space-between;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 250, 241, 0.68);
}

.admin-workspace {
  display: grid;
  gap: 16px;
}

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

.product-form h3,
.product-form button,
.product-form label:nth-of-type(4),
.product-form label:nth-of-type(5) {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(79, 60, 39, 0.16);
  border-radius: 18px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 251, 244, 0.72);
  outline: 0;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(79, 60, 39, 0.46);
  box-shadow: 0 0 0 4px rgba(177, 136, 91, 0.15);
}

.crm-table {
  display: grid;
  gap: 10px;
}

.crm-row.is-blocked {
  opacity: 0.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px 18px;
  border-radius: 18px;
  color: #fff8ed;
  background: rgba(79, 60, 39, 0.94);
  box-shadow: var(--shadow);
  transform: translate(-50%, 80px);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@keyframes riseIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

@keyframes orbitDrift {
  0%,
  100% {
    opacity: 0.66;
    scale: 1;
  }

  50% {
    opacity: 1;
    scale: 1.04;
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: rotate(45deg) scale(0.82);
    opacity: 0.45;
  }

  50% {
    transform: rotate(45deg) scale(1.2);
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
  }

  .tabs {
    overflow-x: auto;
  }

  .hero,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 12px;
  }

  .hero-visual {
    min-height: 330px;
    border-radius: 30px;
  }

  .stats-strip,
  .product-grid,
  .product-form {
    grid-template-columns: 1fr;
  }

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

  .category-pills {
    justify-content: flex-start;
  }

  .admin-summary {
    position: static;
  }

  .cart-panel {
    transform: translateY(calc(100% - 72px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
