/* sshorg.com — эстетика apple.com: системный шрифт, крупная типографика,
   чередование светлых полос и чёрных секций, pill-кнопки, блюр-навбар. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --bar: rgba(251, 251, 253, 0.8);
  --bar-ink: #1d1d1f;
  --chip-border: #d2d2d7;
  /* hero и финал следуют теме (запрос владельца 20.08) */
  --hero-bg: #ffffff;
  --hero-ink: #1d1d1f;
  --hero-muted: #6e6e73;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #161617;
    --card: #1d1d1f;
    --ink: #f5f5f7;
    --muted: #86868b;
    --accent: #2997ff;
    --accent-hover: #48a6ff;
    --bar: rgba(22, 22, 23, 0.8);
    --bar-ink: #f5f5f7;
    --chip-border: #424245;
    --hero-bg: #000000;
    --hero-ink: #f5f5f7;
    --hero-muted: #86868b;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #161617;
  --card: #1d1d1f;
  --ink: #f5f5f7;
  --muted: #86868b;
  --accent: #2997ff;
  --accent-hover: #48a6ff;
  --bar: rgba(22, 22, 23, 0.8);
  --bar-ink: #f5f5f7;
  --chip-border: #424245;
  --hero-bg: #000000;
  --hero-ink: #f5f5f7;
  --hero-muted: #86868b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Навбар ─── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 0.3s ease;
}

.topbar.scrolled { box-shadow: 0 1px 12px rgba(0, 0, 0, 0.12); }

.topbar-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bar-ink);
}

.monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
}

.topbar-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-spacer { flex: 1; }

.lang-switch { display: flex; gap: 2px; }

.lang-btn,
.theme-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 980px;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}


.lang-btn:hover,
.theme-btn:hover { color: var(--ink); }

.lang-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.theme-btn { font-size: 15px; padding: 4px 9px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Индикатор прочтения страницы ─── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 20;
  background: linear-gradient(90deg, #2997ff, #a972ff, #ff6482);
  transition: width 0.1s linear;
}

/* ─── Hero: следует теме (тёмный в dark, светлый в light) ─── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
  text-align: center;
  padding: clamp(90px, 16vh, 160px) 22px clamp(80px, 14vh, 140px);
}

/* амбиентное свечение за контентом — медленно дышит */
.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 45% at 30% 38%, rgba(41, 151, 255, 0.22), transparent 70%),
    radial-gradient(34% 42% at 70% 55%, rgba(169, 114, 255, 0.18), transparent 70%),
    radial-gradient(28% 36% at 52% 75%, rgba(255, 100, 130, 0.12), transparent 70%);
  filter: blur(40px);
  animation: aurora-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aurora-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* свечение, следующее за курсором (только hover-устройства, включается из JS) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    320px circle at var(--gx, 50%) var(--gy, 45%),
    rgba(41, 151, 255, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hero.glow-on::after { opacity: 1; }

/* вводная хореография hero: блюр-въезд каскадом */
@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

html.js .hero-greeting { animation: hero-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.js .hero-title {
  animation:
    gradient-pan 9s ease-in-out infinite alternate,
    hero-enter 0.9s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.js .hero-sub { animation: hero-enter 0.8s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.js .hero-location { animation: hero-enter 0.8s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.js .hero-actions { animation: hero-enter 0.8s 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  html.js .hero-greeting,
  html.js .hero-title,
  html.js .hero-sub,
  html.js .hero-location,
  html.js .hero-actions { animation: none; }
  .hero::after { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .scroll-progress { transition: none; }
}

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

/* живой граф (compose-graph в вебе): за текстом, поверх авроры */
.hero-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-greeting {
  margin: 0 0 18px;
  font-size: 21px;
  color: var(--hero-muted);
  min-height: 1.5em;
}

.typing-caret::after {
  content: "▍";
  color: var(--accent);
  animation: caret-blink 1s steps(1) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

.hero-title {
  margin: 0 auto;
  max-width: 15ch;
  font-size: clamp(40px, 7.5vw, 80px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #2997ff 0%, #a972ff 40%, #ff6482 60%, #a972ff 80%, #2997ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2997ff; /* фолбэк, если background-clip: text не поддержан */
  animation: gradient-pan 9s ease-in-out infinite alternate;
}

@keyframes gradient-pan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.hero-inner { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; }
}

.hero-sub {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--hero-ink);
  font-weight: 400;
}

.hero-location {
  margin: 14px auto 0;
  font-size: 15px;
  color: var(--hero-muted);
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Кнопки ─── */

.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 17px;
  border-radius: 980px;
  transition: background-color 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 11px 22px;
}

.btn-primary {
  transition: background-color 0.2s, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
}

.btn-quiet { color: var(--accent); padding: 11px 4px; }

.btn-quiet:hover { text-decoration: underline; }

.chips li { transition: border-color 0.2s, color 0.2s; }

.chips li:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover { transform: none; }
}

/* ─── Полосы-секции ─── */

.band { background: var(--bg); padding: clamp(64px, 10vh, 110px) 22px; }

.band-alt { background: var(--bg-alt); }

.band-dark {
  background: var(--hero-bg);
  color: var(--hero-ink);
  text-align: center;
}

.band-inner { max-width: 1024px; margin: 0 auto; }

/* ─── Полосы-высказывания (теглайны в духе Apple) ─── */

.statement {
  background: var(--bg);
  padding: clamp(84px, 15vh, 150px) 22px;
  text-align: center;
}

.statement.band-alt { background: var(--bg-alt); }

.statement-text {
  margin: 0 auto;
  max-width: 16ch;
  font-size: clamp(34px, 5.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  background: linear-gradient(100deg, #2997ff, #a972ff 60%, #ff6482);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2997ff;
}

/* ─── Кейноут-статы ─── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  text-align: center;
}

.stat-num {
  margin: 0;
  font-size: clamp(56px, 8vw, 104px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(120deg, #2997ff, #a972ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2997ff;
}

.stat-label {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .stats-row { grid-template-columns: 1fr; gap: 44px; }
}

.band-narrow { max-width: 720px; text-align: center; }

.band-title {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.lede {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.5;
  color: var(--muted);
}

.band-dark .lede { color: var(--hero-muted); }

/* ─── Бенто-карточки ─── */

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.bento-three { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* спотлайт под курсором (координаты приходят из JS) */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(41, 151, 255, 0.10),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::after { opacity: 1; }

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}

.card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }

.card p.card-stat {
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 18px;
  background: linear-gradient(100deg, #2997ff, #a972ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2997ff;
}

.card-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 15px;
  text-decoration: none;
  position: relative; /* поверх спотлайт-слоя ::after */
}

.card-link:hover { text-decoration: underline; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-head h3 { margin: 0; }

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--chip-border);
  border-radius: 980px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ─── Чипы стека ─── */

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chips li {
  border: 1px solid var(--chip-border);
  border-radius: 980px;
  padding: 8px 16px;
  font-size: 15px;
  color: var(--ink);
}

/* ─── Контакты ─── */

.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: center;
  align-items: center;
}

/* ─── Футер ─── */

.footer {
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 24px 22px 34px;
}

.footer p { margin: 4px 0; }

.footer-hobbies { font-size: 15px; letter-spacing: 2px; margin-bottom: 10px; }

/* ─── Появление при скролле ─── */

/* скрытое стартовое состояние — только при работающем JS (html.js вешает app.js),
   иначе контент был бы навсегда невидим без скриптов */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  /* пружинка на въезде — back.out по рекомендации motion-пресета */
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

html.js .reveal.in { opacity: 1; transform: none; }

/* каскад внутри бенто-сетки: карточки догоняют друг друга */
html.js .bento .reveal:nth-child(2) { transition-delay: 0.08s; }
html.js .bento .reveal:nth-child(3) { transition-delay: 0.16s; }
html.js .bento .reveal:nth-child(4) { transition-delay: 0.24s; }

html.js .stats-row .reveal:nth-child(2) { transition-delay: 0.1s; }
html.js .stats-row .reveal:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Мобильная сетка ─── */

@media (max-width: 820px) {
  .bento, .bento-three { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .topbar-name { display: none; }
}
