@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #14151a;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --accent: #ff5b49;
  --accent-ink: #ffffff;
  --muted: #6b7280;
  --border: #e7e7e2;
  --nav-h: 72px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-links a {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: #d8d8dd;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-links a.active { background: var(--accent); color: var(--accent-ink); }
.nav-toggle { display: none; }
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  position: relative;
}
.nav-burger span, .nav-burger::before, .nav-burger::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.nav-burger::before { top: 14px; }
.nav-burger span { top: 19px; }
.nav-burger::after { top: 24px; }

@media (max-width: 760px) {
  .nav-burger { display: block; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--ink);
    padding: 8px 20px 20px;
    gap: 4px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: 0.18s ease;
  }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle:checked ~ .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---------- HERO ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 88px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,91,73,0.35), transparent 70%);
  top: -180px; right: -120px;
  pointer-events: none;
}
.hero .container { position: relative; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 720px;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead {
  font-size: 18px;
  color: #c7c7cf;
  max-width: 560px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.92; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- SECTIONS ---------- */
.section { padding: 72px 0; }
.section-head { margin-bottom: 40px; max-width: 620px; }
.section-head .eyebrow { color: var(--accent); }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 12px;
}
.section-head p { color: var(--muted); font-size: 16px; }

/* ---------- CARDS / GRID ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20,21,26,0.08); }
.card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
}
.card h3 { font-size: 19px; margin: 0 0 10px; font-weight: 700; }
.card p { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }
.card .card-link { font-weight: 700; font-size: 14px; color: var(--ink); }
.card .card-link::after { content: ' →'; }

/* ---------- ABOUT / SKILLS ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }
.avatar {
  width: 180px; height: 180px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), #ffb020);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 56px; font-weight: 800;
}
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.skill-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- CONTACTS ---------- */
.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: none; }
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.contact-label { font-size: 13px; color: var(--muted); }
.contact-value { font-size: 16px; font-weight: 700; }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- LOGIN / ADMIN ---------- */
.center-screen {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg);
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error-msg {
  background: #fff1ef;
  border: 1px solid #ffcfc8;
  color: #b3261e;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- TOOL PAGE ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit;
}
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.date-row { display: flex; gap: 12px; }
.date-row > div { flex: 1; }
.spinner { display: none; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- ADMIN TABLE ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-active { background: #e6f6ec; color: #1a7f37; }
.status-expired { background: #f2f2ee; color: var(--muted); }
.status-revoked { background: #fff1ef; color: #b3261e; }
.code-value { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; letter-spacing: 0.03em; }

.stats-row { display: flex; gap: 12px; margin: 20px 0; }
.stat-box { flex: 1; text-align: center; padding: 14px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.stat-box .num { font-size: 22px; font-weight: 800; }
.stat-box .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- ФИЛЬТРУЕМАЯ СЕТКА КЕЙСОВ ---------- */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-pill {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--muted);
}
.filter-pill:hover { border-color: var(--ink); color: var(--ink); }
.filter-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.case-card { position: relative; }
.case-card.js-hidden { display: none; }
.case-category-badge {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- КАРТОЧКА "В РАЗРАБОТКЕ" ---------- */
.card.upcoming {
  opacity: 0.65;
  cursor: default;
  background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 10px, #fafafa 10px, #fafafa 20px);
}
.card.upcoming:hover { transform: none; box-shadow: none; }
.badge-soon {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f2ee;
  color: var(--muted);
  margin-left: 10px;
  vertical-align: middle;
}
