/* =========================================================
   Kivijärvi Juustola — фирменные стили
   Токены: болотно-зелёный фон, брусничный акцент, шрифты
   Fraunces (дисплей) + Karla (текст) + JetBrains Mono (данные)
   ========================================================= */

:root {
  --bg: #EEF0E3;
  --bg-alt: #E4E8D6;
  --surface: #FBFAF3;
  --ink: #232B1E;
  --ink-soft: #4B5442;
  --wood: #6B4A34;
  --accent: #A23E32;
  --accent-2: #4C6B4F;
  --line: rgba(35, 43, 30, 0.14);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius: 4px;
  --container: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand img { width: 40px; height: 40px; }

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

.brand-text strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  padding: 76px 0 64px;
  border-bottom: 1px solid var(--line);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  margin: 0 0 20px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-2);
}

.hero p.lead {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary { background: var(--accent); color: #FBFAF3; }
.btn-primary:hover { background: #8a3128; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }

.hero-figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.hero-figure svg { width: 100%; height: auto; }

.hero-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Section shell ---------- */

section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  margin: 0;
}

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

/* ---------- Cheese-wheel selector (signature element) ---------- */

.wheel-select {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.wheel {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #E7B65C 0deg 60deg,
    #D9A548 60deg 120deg,
    #C9944E 120deg 180deg,
    #B98B4A 180deg 240deg,
    #A9793F 240deg 300deg,
    #8E6A3C 300deg 360deg
  );
  box-shadow: inset 0 0 0 10px var(--surface), 0 0 0 1px var(--line);
  list-style: none;
  margin: 0 auto;
  padding: 0;
}

.wheel li { position: absolute; inset: 0; }

.wheel button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%);
  transform-origin: 50% 50%;
}

.wheel li:nth-child(1) button { transform: rotate(0deg); }
.wheel li:nth-child(2) button { transform: rotate(60deg); }
.wheel li:nth-child(3) button { transform: rotate(120deg); }
.wheel li:nth-child(4) button { transform: rotate(180deg); }
.wheel li:nth-child(5) button { transform: rotate(240deg); }
.wheel li:nth-child(6) button { transform: rotate(300deg); }

.wheel button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%);
  background: rgba(35, 43, 30, 0.28);
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.wheel-legend {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.wheel-legend li { padding: 3px 0; }
.wheel-legend b { color: var(--ink); }

.cheese-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: none;
}

.cheese-card[data-active="true"] { display: block; }

.cheese-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 4px;
}

.cheese-card .subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 18px;
}

.cheese-card p { margin: 0 0 18px; color: var(--ink-soft); }

.spec-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.spec-row div { font-size: 13px; }
.spec-row b {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ---------- Generic cards / grid ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 10px;
}

.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wood);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

/* ---------- Tabs (services page) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tabs button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  background: transparent;
  border: 0;
  padding: 12px 18px;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}

.tabs button[aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel[data-active="true"] { display: block; }

.tab-panel .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.tab-panel ul { padding-left: 20px; color: var(--ink-soft); }
.tab-panel li { margin-bottom: 8px; }

/* ---------- Timeline (about page) ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 34px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.timeline .year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.timeline h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 4px 0 6px;
}

.timeline p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.field textarea { min-height: 120px; resize: vertical; }

.field input:focus,
.field textarea:focus,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.info-list b {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 20px;
}

footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

footer .foot-nav {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

footer .foot-nav a { text-decoration: none; color: var(--ink-soft); }
footer .foot-nav a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .wheel-select { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .tab-panel .two-col { grid-template-columns: 1fr; }
  nav.main-nav ul { gap: 16px; flex-wrap: wrap; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}