:root {
  --accent: #f49301;
  --accent-dark: #cc7a00;
  --accent-ink: #1a1a1a;
  --bg: #ffffff;
  --bg-alt: #f7f6f4;
  --dark: #3f3f46;
  --dark-alt: #f0f0f0;
  --text: #16151a;
  --muted: #69707d;
  --border: #e7e5e1;
  --radius: 16px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: 999px;
}

.tabs__btn {
  border: none;
  background: transparent;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.tabs__btn:hover { color: var(--text); }

.tabs__btn.is-active {
  background: var(--dark);
  color: #fff;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.burger span {
  width: 16px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform .25s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding-bottom: 56px;
}

.hero__banner {
  height: 160px;
  background-image:
    url('../img/Wallpaper.webp'),
    linear-gradient(180deg, rgba(22,21,26,0) 60%, rgba(22,21,26,0.05) 100%),
    linear-gradient(120deg, #ff8a5c 0%, var(--accent) 45%, #c2410c 100%);
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

.hero__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: -64px auto 0;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  background: var(--bg-alt);
}
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 40px;
  color: var(--accent);
  background: #ffe7db;
}
.hero__avatar--fallback::before { content: "АЗ"; }

.hero__name { margin: 20px 0 4px; font-size: 30px; font-weight: 800; }
.hero__role { margin: 0; color: var(--muted); font-size: 14px; }

.hero__lead {
  max-width: 640px;
  margin: 44px auto 0;
  font-size: 26px;
  line-height: 1.4;
  color: #3a3a3f;
  font-weight: 500;
}

.hero__cols {
  max-width: 720px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  text-align: left;
  padding: 0 24px;
}
.hero__col h3 {
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.hero__col p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- sections ---------- */

.section { padding: 72px 0; }
.section--dark { background: var(--dark-alt); color: var(--text); }
.section--dark .timeline__role { color: var(--text); }
.section--dark p { color: var(--muted); }

.section__title { font-size: 26px; font-weight: 800; margin: 0 0 40px; text-align: center; }
.section--dark .section__title { color: var(--text); }

.page-head { text-align: center; padding: 56px 0 8px; }
.section__sub { color: var(--muted); margin-top: -24px; margin-bottom: 40px; }

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.section--dark .timeline::before { background: rgba(0,0,0,.12); }

.timeline__item {
  display: flex;
  gap: 20px;
  padding-bottom: 56px;
  position: relative;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 1;
}

.timeline__date { margin: 2px 0 4px; font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.timeline__role { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.timeline__body p { margin: 0 0 10px; line-height: 1.55; font-size: 15px; color: var(--muted); }
.timeline__body p:last-child { margin-bottom: 0; }

/* ---------- footer / social ---------- */

.site-footer { padding: 32px 0 56px; }
.site-footer__inner { display: flex; align-items: center; justify-content: center; position: relative; flex-wrap: wrap; gap: 16px; }

.social { list-style: none; display: flex; gap: 14px; padding: 0; margin: 0; }
.social a {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  transition: transform .15s ease, filter .15s ease;
}
.social a:hover { transform: translateY(-2px); filter: brightness(.92); }

/* оригинальные фирменные цвета площадок + цвет иконки, подобранный по контрасту */
.social a.social__telegram { background: #229ED9; color: #fff; }
.social a.social__vk { background: #0077FF; color: #fff; }
.social a.social__github { background: #181717; color: #fff; }

.site-footer__brand {
  position: absolute;
  left: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color .15s ease;
}
.site-footer__brand:hover { color: var(--text); }

.to-top {
  position: absolute;
  right: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .site-footer__inner { flex-direction: column; gap: 20px; }
  .site-footer__brand,
  .to-top { position: static; }
  .to-top { margin-top: 4px; }
}

/* ---------- portfolio ---------- */

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 96px;
}
@media (max-width: 720px) { .case-grid { grid-template-columns: 1fr; } }

.case-card {
  border: none;
  border-radius: var(--radius);
  padding: 32px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,.18);
}
.case-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}
.case-card__arrow { align-self: flex-end; font-size: 20px; opacity: .7; }
.case-card__title { font-size: 26px; font-weight: 800; line-height: 1.25; margin: 24px 0 12px; }
.case-card__desc { margin: 0; font-size: 14px; line-height: 1.55; opacity: .96; }

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%) translateY(-12px);
  background: var(--dark);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { font-size: 16px; color: var(--toast-accent, var(--accent)); }
.toast .toast-break { display: none; }

/* ---------- flarum: мой форум ---------- */

.myforum { margin-bottom: 48px; }
.myforum__card {
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 32px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color .15s ease, transform .15s ease;
}
.myforum__card:hover { border-color: var(--accent); transform: translateY(-2px); }
.myforum__preview {
  flex: none;
  width: 120px;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}
.myforum__preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.myforum__text { flex: 1; min-width: 0; }
.myforum__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a36200; /* темнее --accent-dark — на bg-alt тот не проходит контраст WCAG AA (3.06:1) */
}
.myforum__name { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.myforum__desc { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.myforum__arrow { font-size: 22px; color: var(--muted); flex: none; }
@media (max-width: 560px) {
  .myforum__card { flex-wrap: wrap; }
  .myforum__preview { width: 100%; aspect-ratio: 16 / 9; }
  .myforum__arrow { display: none; }
}

/* ---------- flarum: extensions grid ---------- */

.ext-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 72px;
}
@media (max-width: 900px) { .ext-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .ext-grid { grid-template-columns: 1fr; } }

.ext-grid__status { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px 0; }

.ext-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.ext-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.ext-card__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ext-card__top > div { min-width: 0; }
.ext-card__icon {
  /* фон и цвет иконки задаются инлайново — из composer.json каждого расширения */
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex: none;
}
.ext-card__name { font-weight: 700; font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.ext-card__repo { font-size: 12px; color: var(--muted); margin: 2px 0 0; overflow-wrap: anywhere; }
.ext-card__desc { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; flex: 1; }
.ext-card__meta { display: flex; gap: 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.ext-card__meta i { margin-right: 4px; }

/* ---------- order form ---------- */

.order {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 40px;
  align-items: start;
}
.order__intro { min-width: 0; }
.order__intro h2 { text-align: left; margin-bottom: 16px; }
.order__intro p { color: var(--muted); line-height: 1.6; }

@media (max-width: 800px) {
  .order { grid-template-columns: 1fr; }
  .order__intro { text-align: center; }
  .order__intro h2 { text-align: center; }
}

.order-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 16px;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.order-form__row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.order-form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.order-form input, .order-form select, .order-form textarea {
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  resize: vertical;
  /* select без этого может потребовать себе ширину по самому длинному <option>
     и вытолкнуть страницу за пределы экрана на мобильных (особенно iOS Safari) */
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.order-form select {
  padding-right: 36px;
  appearance: none;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.order-form input:focus, .order-form select:focus, .order-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.order-form__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.btn {
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
  /* если в карточке формы останется лишняя высота — пусть уходит наверх,
     а кнопка со статусом отправки прижимаются к низу, а не наоборот */
  margin-top: auto;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: default; }

.order-form__status { margin: 0; font-size: 14px; }
.order-form__status:empty { display: none; }
.order-form__status.is-ok { color: #1a7f37; }
.order-form__status.is-error { color: #c22; }

/* ---------- tab panels ---------- */

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel { display: none; }
.panel.is-active { display: block; animation: panelFadeIn .35s ease; }

@media (prefers-reduced-motion: reduce) {
  .panel.is-active { animation: none; }
}

/* ---------- responsive nav ---------- */

@media (max-width: 768px) {
  .tabs {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    padding: 10px;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s .2s;
    pointer-events: none;
  }
  .tabs.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
  }
  .tabs__btn { text-align: left; border-radius: 10px; }
  .burger { display: flex; }

  .hero__cols { grid-template-columns: 1fr; }
  .hero__lead { font-size: 21px; }

  .toast .toast-break { display: block; }
  .toast { line-height: 1.3; padding: 12px 20px; }

  .order-form select { font-size: 14px; padding-right: 32px; }
  .order { padding-bottom: 24px; }
}
