/* ============================================================
   БАЗА — Component primitives
   Buttons, inputs, cards, badges, layout
   ============================================================ */

/* ============ LAYOUT ============ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--s-11);
  padding-bottom: var(--s-11);
}

.section-tight { padding-top: var(--s-9); padding-bottom: var(--s-9); }

/* ============ TAB-PILL (signature element from reference) ============
   Black rounded pill with white uppercase label — like "ЧАСТИНА П'ЯТЬ"
   ============================================================ */
.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 14px;
  background: var(--ink-900);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  border-radius: var(--r-2);
  white-space: nowrap;
}

.tab-pill--kiwi {
  background: var(--kiwi-400);
  color: var(--ink-900);
}

.tab-pill--outline {
  background: transparent;
  color: var(--ink-900);
  border: 1.5px solid var(--ink-900);
}

.tab-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kiwi-400);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: none;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--kiwi-400);
  color: var(--ink-900);
}
.btn--primary:hover {
  background: var(--kiwi-300);
  box-shadow: var(--shadow-lime);
}

.btn--ink {
  background: var(--ink-900);
  color: var(--bone);
}
.btn--ink:hover {
  background: var(--ink-700);
}

.btn--outline {
  background: transparent;
  color: var(--ink-900);
  border: 1.5px solid var(--ink-900);
}
.btn--outline:hover {
  background: var(--ink-900);
  color: var(--bone);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
}
.btn--ghost:hover { background: var(--ink-50); }

.btn--lg {
  padding: 18px 32px;
  font-size: 17px;
  border-radius: var(--r-3);
}

.btn--xl {
  padding: 22px 40px;
  font-size: 19px;
  border-radius: var(--r-3);
}

.btn--block { width: 100%; }

.btn--arrow::after {
  content: '→';
  font-size: 1.1em;
  margin-left: 4px;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn--arrow:hover::after { transform: translateX(4px); }

/* ============ CARDS ============ */
.card {
  background: var(--paper);
  border: var(--border-hair);
  border-radius: var(--r-4);
  padding: var(--s-7);
  transition: border-color var(--dur-base) var(--ease-out);
}
.card:hover { border-color: var(--line-2); }

.card--ink {
  background: var(--ink-900);
  color: var(--bone);
  border: none;
}
.card--ink p { color: var(--ink-200); }

.card--kiwi {
  background: var(--kiwi-400);
  color: var(--ink-900);
  border: none;
}

.card--flat {
  background: var(--bone-2);
  border: none;
}

/* Rule card — numbered, used for "4 правила" blocks */
.rule-card {
  background: var(--paper);
  border: var(--border-hair);
  border-radius: var(--r-4);
  padding: var(--s-7);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  position: relative;
  overflow: hidden;
}
.rule-card__num {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--kiwi-600);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
.rule-card__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-900);
  letter-spacing: var(--ls-snug);
}
.rule-card__body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-2);
}

/* ============ INPUTS ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.field__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.field__hint {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.4;
}

.input {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink-900);
  border: 1.5px solid var(--line);
  border-radius: var(--r-2);
  outline: none;
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  width: 100%;
}
.input:focus {
  border-color: var(--kiwi-500);
  box-shadow: 0 0 0 4px var(--kiwi-100);
}
.input::placeholder { color: var(--fg-3); font-weight: 400; }

.input--num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-group .input { padding-right: 56px; }
.input-group__suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

/* Range slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: var(--r-pill);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--kiwi-400);
  border: 3px solid var(--ink-900);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--kiwi-400);
  border: 3px solid var(--ink-900);
  border-radius: 50%;
  cursor: pointer;
}

/* Select */
.select {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  padding: 14px 40px 14px 16px;
  background: var(--paper);
  color: var(--ink-900);
  border: 1.5px solid var(--line);
  border-radius: var(--r-2);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%230E0F0A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  width: 100%;
}
.select:focus { border-color: var(--kiwi-500); box-shadow: 0 0 0 4px var(--kiwi-100); }

/* Segmented control — for period / intensity choices */
.segmented {
  display: inline-flex;
  background: var(--bone-2);
  border-radius: var(--r-3);
  padding: 4px;
  gap: 2px;
}
.segmented__option {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--fg-2);
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
  font-family: var(--font-body);
  white-space: nowrap;
}
.segmented__option:hover { color: var(--ink-900); }
.segmented__option--active {
  background: var(--ink-900);
  color: var(--bone);
}
.segmented__option--active:hover { color: var(--bone); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.badge--kiwi { background: var(--kiwi-400); color: var(--ink-900); }
.badge--soft { background: var(--kiwi-100); color: var(--kiwi-800); }
.badge--ink { background: var(--ink-900); color: var(--bone); }
.badge--outline { background: transparent; color: var(--ink-900); border: 1px solid var(--ink-900); }

/* ============ DIVIDERS ============ */
.divider { height: 1px; background: var(--line); margin: var(--s-7) 0; }
.divider--ink { background: var(--ink-900); height: 1px; }
.divider--lime { background: var(--kiwi-400); height: 2px; }

/* ============ STATS / METRIC BOX (for calculator output) ============ */
.metric {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.metric__label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--fg-3);
  font-weight: 600;
}
.metric__value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-900);
  font-feature-settings: 'tnum' 1;
}
.metric__delta {
  font-size: 14px;
  color: var(--positive);
  font-weight: 600;
}

/* ============ STEP / NUMBER MARKER ============ */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--kiwi-400);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  border-radius: 50%;
  flex-shrink: 0;
}
.step-num--ink { background: var(--ink-900); color: var(--bone); }
.step-num--outline { background: transparent; border: 1.5px solid var(--ink-900); }

/* ============ LOGO ROW (Starbucks/Nike/Apple) ============ */
.logo-row {
  display: flex;
  gap: var(--s-10);
  align-items: center;
  flex-wrap: wrap;
}
.logo-row img {
  height: 36px;
  width: auto;
  filter: grayscale(100%) brightness(0);
  opacity: 0.55;
  transition: opacity var(--dur-base) var(--ease-out);
}
.logo-row img:hover { opacity: 1; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 238, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: var(--border-hair);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-decoration: none;
}
.nav__brand__mark {
  width: 28px;
  height: 28px;
  background: var(--kiwi-400);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-900);
}
.nav__links {
  display: flex;
  gap: var(--s-7);
  align-items: center;
}
.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--dur-base) var(--ease-out);
}
.nav__link:hover { color: var(--ink-900); }
.nav__link--active { color: var(--ink-900); font-weight: 700; }
.nav__link__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

/* ============ PROGRESS STEPS ============ */
.steps {
  display: flex;
  gap: 4px;
  align-items: center;
}
.steps__dot {
  width: 32px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--line);
  transition: background var(--dur-base) var(--ease-out);
}
.steps__dot--done { background: var(--ink-900); }
.steps__dot--active { background: var(--kiwi-400); }

/* ============ NOISY KIWI BACKGROUND (signature) ============
   The reference shows the lime text with a subtle blur/glow.
   Use this on hero text for the signature treatment.
   ============================================================ */
.kiwi-glow {
  color: var(--kiwi-500);
  filter: drop-shadow(0 0 14px rgba(200, 232, 74, 0.4));
}

.kiwi-blur {
  position: relative;
  color: var(--ink-900);
}
.kiwi-blur::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: var(--kiwi-400);
  filter: blur(18px);
  z-index: -1;
  opacity: 0.85;
}
