/* Арти — минимальная главная */
:root {
  --bg: #f6f5f1;
  --surface: #fffdfa;
  --ink: #17160f;
  --muted: #74705f;
  --line: rgba(23, 22, 15, .11);
  --soft: #efede6;
  --tg: #2aabee;
  --shadow: 0 24px 60px -28px rgba(23, 22, 15, .35);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d;
    --surface: #171715;
    --ink: #f2f0e9;
    --muted: #9a958a;
    --line: rgba(242, 240, 233, .13);
    --soft: #1f1f1c;
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, .85);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* тихий фон */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  width: 62vw;
  height: 62vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}

.glow-a { top: -28vw; right: -16vw; background: radial-gradient(circle, rgba(214, 196, 158, .5), transparent 68%); }
.glow-b { bottom: -34vw; left: -20vw; background: radial-gradient(circle, rgba(162, 178, 176, .35), transparent 68%); }

@media (prefers-color-scheme: dark) {
  .glow { opacity: .3; }
  .glow-a { background: radial-gradient(circle, rgba(120, 100, 60, .4), transparent 68%); }
  .glow-b { background: radial-gradient(circle, rgba(64, 92, 96, .4), transparent 68%); }
}

.page {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 8px;
}

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

.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(56px, 12vh, 120px) 0 clamp(44px, 8vh, 80px);
  animation: rise .8s cubic-bezier(.22, .8, .24, 1) both;
}

.avatar {
  width: clamp(112px, 15vw, 148px);
  height: clamp(112px, 15vw, 148px);
  border-radius: 50%;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 40px -22px rgba(23, 22, 15, .5);
}

.avatar img,
.avatar-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
}

.avatar-letter {
  background:
    radial-gradient(120% 120% at 25% 18%, rgba(255, 255, 255, .55), transparent 58%),
    linear-gradient(145deg, #ded8c8, #c6c0af);
  color: #3a372d;
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 62px);
  line-height: 1;
  padding-bottom: 4px;
}

@media (prefers-color-scheme: dark) {
  .avatar-letter {
    background:
      radial-gradient(120% 120% at 25% 18%, rgba(255, 255, 255, .12), transparent 58%),
      linear-gradient(145deg, #2c2b26, #1d1c19);
    color: #cfc8b6;
  }
}

.name {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 8vw, 78px);
  line-height: .98;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.tagline {
  margin: 14px 0 0;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--muted);
}

.about {
  max-width: 46ch;
  margin: 22px 0 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  opacity: .82;
  text-wrap: pretty;
  white-space: pre-line;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 21px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), background .2s, border-color .2s, box-shadow .3s;
}

.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.btn:hover { transform: translateY(-2px); border-color: rgba(23, 22, 15, .24); box-shadow: 0 12px 22px -16px rgba(23, 22, 15, .5); }

.btn-primary { background: var(--ink); color: var(--bg); border-color: transparent; position: relative; }
.btn-primary:hover { background: var(--ink); opacity: .9; border-color: transparent; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0533c;
  box-shadow: 0 0 0 3px rgba(224, 83, 60, .18);
}

/* ---------------------------------------------------------- проекты */

.projects {
  padding: clamp(20px, 5vh, 48px) 0 clamp(56px, 9vh, 96px);
  border-top: 1px solid var(--line);
}

.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.projects h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.count {
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--muted);
  vertical-align: 2px;
}

.arrows { display: flex; gap: 8px; }

.arrows button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background .2s, opacity .2s;
}

.arrows button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.arrows button:hover { background: var(--surface); }
.arrows button:disabled { opacity: .28; cursor: default; }

.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 4px 4px 18px;
  margin: 0 -4px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 auto;
  width: clamp(236px, 26vw, 306px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s, border-color .3s;
}

.card:hover { transform: translateY(-5px); border-color: rgba(23, 22, 15, .2); box-shadow: var(--shadow); }

.card-media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.card:hover .card-media img { transform: scale(1.035); }

.card-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--serif);
  font-size: 54px;
  color: var(--muted);
}

.card-body { display: block; padding: 15px 17px 17px; }

.card-title { display: block; font-size: 15.5px; font-weight: 500; letter-spacing: -.01em; }

.card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.rail-hint {
  margin: 2px 0 0;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--muted);
  opacity: .8;
  transition: opacity .3s;
}

.rail-hint.done { opacity: 0; }

/* ---------------------------------------------------------- подвал */

.site-footer {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}

.admin-link { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; opacity: .32; transition: opacity .2s; }
.admin-link:hover { opacity: .9; }
.admin-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* ---------------------------------------------------------- модалки */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 13, 10, .34);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s;
}

.overlay.open { opacity: 1; visibility: visible; }

.sheet {
  position: relative;
  width: min(432px, 100%);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.985);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1);
}

.overlay.open .sheet { transform: none; }

.sheet h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.sheet-sub { margin: 6px 0 18px; font-size: 13.5px; color: var(--muted); }
.sheet-note { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s;
}

.close:hover { background: var(--soft); color: var(--ink); }

.methods { display: flex; flex-direction: column; gap: 9px; }

.method {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .25s;
}

.method:hover { background: var(--bg); border-color: rgba(23, 22, 15, .22); transform: translateY(-1px); }

.method-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
}

.method-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.method-icon.tg { background: rgba(42, 171, 238, .13); color: var(--tg); }
.method-icon.tg svg { fill: var(--tg); stroke: none; }

.method-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.method-text b { font-size: 14.5px; font-weight: 550; }
.method-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method-go { margin-left: auto; color: var(--muted); font-size: 15px; }

/* проект */

.project-sheet { width: min(720px, 100%); padding: 0; overflow: hidden auto; }
.project-sheet .close { background: rgba(0, 0, 0, .35); color: #fff; z-index: 2; }
.project-sheet .close:hover { background: rgba(0, 0, 0, .55); color: #fff; }
.project-sheet.plain .close { background: var(--soft); color: var(--muted); }
.project-sheet.plain .close:hover { background: var(--line); color: var(--ink); }

.pm-media { background: var(--soft); }
.pm-media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.pm-body { padding: 24px 26px 28px; }
.pm-body h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.pm-desc { margin: 12px 0 0; font-size: 15px; line-height: 1.65; color: var(--muted); white-space: pre-line; }
.pm-body .btn { margin-top: 20px; }

/* чат */

.chat-card {
  width: min(452px, 100%);
  height: min(596px, 84vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.985);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1);
}

.overlay.open .chat-card { transform: none; }

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.chat-hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.close-inline { position: static; margin: -4px -6px 0 0; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px;
  background: var(--bg);
  overscroll-behavior: contain;
}

.chat-empty { margin: auto; max-width: 34ch; text-align: center; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.bubble {
  max-width: 82%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: bubble .25s ease both;
}

.bubble time { display: block; margin-top: 3px; font-size: 10px; opacity: .5; }
.bubble.user { align-self: flex-end; border-color: transparent; background: var(--ink); color: var(--bg); }
.bubble.user time { opacity: .6; }

.chat-status { margin: 0; padding: 0 18px; font-size: 12px; color: #c2452d; }
.chat-status:empty { display: none; }

.chat-form { display: flex; flex-direction: column; gap: 8px; padding: 13px; border-top: 1px solid var(--line); }

.chat-name,
.chat-row input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
  transition: border-color .2s;
}

.chat-row input:focus, .chat-name:focus { outline: none; border-color: var(--ink); }

.chat-row { display: flex; gap: 8px; }

.send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  transition: opacity .2s, transform .2s;
}

.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.send:hover { opacity: .88; }
.send:disabled { opacity: .4; }

/* ---------------------------------------------------------- анимации и мобильные */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bubble { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .page { width: calc(100% - 32px); }
  .hero { min-height: 86vh; }

  .actions { width: 100%; max-width: 340px; flex-direction: column; }
  .btn { width: 100%; }

  .projects-head { margin-bottom: 18px; }
  .arrows { display: none; }

  .card { width: min(78vw, 300px); }

  .site-footer { width: calc(100% - 32px); }

  .overlay { padding: 0; align-items: end; }
  .sheet,
  .chat-card {
    width: 100%;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    transform: translateY(24px);
  }
  .chat-card { height: 88vh; }
  .project-sheet { max-height: 92vh; }
  .sheet { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

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