/* ═══════════════════════════════════════
   TRYSHYZOV.RU — СТИЛИ
   ═══════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Переменные: светлая тема (по умолчанию) ── */
:root {
  --bg: #F2F0E9;
  --text: #0A0A0A;
  --accent: #2438E8;
  --line: rgba(10, 10, 10, 0.1);
  --playfair: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --header-shadow: transparent;
}

/* ── Переменные: тёмная тема ── */
[data-theme="dark"] {
  --bg: #1A1A1A;
  --text: #E8E6DF;
  --accent: #4A5CE8;
  --line: rgba(232, 230, 223, 0.1);
  --header-shadow: rgba(0, 0, 0, 0.3);
}

html {
  font-size: 16px;
  /* Плавный скролл через JS, не CSS */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Скрываем нативный курсор когда есть кастомный */
@media (hover: hover) and (pointer: fine) {
  body, a, button, .projects__link, .contacts__btn, .theme-toggle {
    cursor: none;
  }
}

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

/* ═══════════ КАСТОМНЫЙ КУРСОР ═══════════ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(10, 10, 10, 0.15);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  will-change: transform, width, height;
  background: rgba(10, 10, 10, 0.06);
}

[data-theme="dark"] .cursor {
  border-color: rgba(232, 230, 223, 0.15);
  background: rgba(232, 230, 223, 0.06);
}

.cursor--hover {
  width: 56px;
  height: 56px;
  border-color: var(--accent);
}

/* Скрыть на тач-устройствах */
@media (hover: none) and (pointer: coarse) {
  .cursor { display: none; }
}

/* ═══════════ ШАПКА ═══════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--header-shadow);
  transition: background-color 0.4s ease, box-shadow 0.3s ease, border-color 0.4s ease;
}

.header.scrolled {
  box-shadow: 0 2px 20px var(--header-shadow);
}

.header__brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.header__name {
  font-family: var(--playfair);
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  letter-spacing: 0;
}

.header__city {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ── Переключатель темы ── */
.theme-toggle {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.theme-toggle:hover {
  opacity: 0.7;
}

.theme-toggle__icon {
  display: none;
}

.theme-toggle__icon--light {
  display: block;
}

[data-theme="dark"] .theme-toggle__icon--light {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--dark {
  display: block;
}

.header__nav {
  display: flex;
  gap: 2rem;
}

.header__link {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  position: relative;
  transition: color 0.2s;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.header__link:hover::after {
  width: 100%;
}

/* ═══════════ ПЕРВЫЙ ЭКРАН ═══════════ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero__title {
  position: relative;
  z-index: 2;
  font-family: var(--playfair);
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: 1.1;
  text-align: center;
  mix-blend-mode: normal;
}

.hero__title em {
  font-style: italic;
}

/* Canvas-матрица */
.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
  cursor: crosshair;
}

/* Подписи в углах */
.hero__corner-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero__corner {
  font-family: var(--mono);
  font-size: clamp(0.55rem, 0.7vw, 0.65rem);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1.6;
}

.hero__corner--tl { top: 4.5rem; left: 2rem; }
.hero__corner--tr { top: 4.5rem; right: 2rem; text-align: right; }
.hero__corner--bl { bottom: 3.5rem; left: 2rem; }
.hero__corner--br { bottom: 3.5rem; right: 2rem; text-align: right; }

/* Листай внизу */
.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.hero__scroll-text {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  opacity: 0.6;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: var(--text);
  opacity: 0.3;
}

/* ═══════════ РАЗДЕЛЫ (общее) ═══════════ */
.section {
  padding: 6rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.section__number {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.7vw, 0.7rem);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 3rem;
  display: block;
}

.section__divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}

/* ═══════════ ОБО МНЕ ═══════════ */
.about__content {
  max-width: 640px;
}

.about__text {
  font-family: var(--playfair);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.4;
  margin-bottom: 0.3em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.about__text.visible {
  opacity: 1;
  transform: translateY(0);
}

.about__text em {
  font-style: italic;
}

.about__final {
  font-family: var(--sans);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.6;
  margin-top: 3rem;
  color: rgba(10, 10, 10, 0.65);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
}

[data-theme="dark"] .about__final {
  color: rgba(232, 230, 223, 0.55);
}

.about__final.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════ ПРОЕКТЫ ═══════════ */
.projects__heading {
  font-family: var(--playfair);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 3.5rem;
}

.projects__list {
  list-style: none;
}

.projects__item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.projects__item:first-child {
  border-top: 1px solid var(--line);
}

.projects__link {
  display: contents;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.projects__number {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  width: 2rem;
}

.projects__name {
  font-family: var(--playfair);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  flex-shrink: 0;
  transition: font-style 0.25s ease, transform 0.3s ease;
  min-width: 12rem;
}

.projects__desc {
  font-family: var(--sans);
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: rgba(10, 10, 10, 0.6);
  flex: 1;
}

[data-theme="dark"] .projects__desc {
  color: rgba(232, 230, 223, 0.5);
}

.projects__link:hover .projects__name {
  font-style: italic;
  transform: translateX(8px);
}

/* ═══════════ КОНТАКТЫ ═══════════ */
.contacts {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem;
}

.contacts__heading {
  font-family: var(--playfair);
  font-size: clamp(2rem, 5vw, 4.5rem);
  margin-bottom: 3.5rem;
  line-height: 1.2;
}

.contacts__char {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.05s;
}

.contacts__char.set {
  opacity: 1;
}

.contacts__chars {
  opacity: 0;
  transition: opacity 0.3s;
}

.contacts__chars.revealed {
  opacity: 1;
}

.contacts__buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.contacts__btn {
  font-family: var(--mono);
  font-size: clamp(0.7rem, 0.8vw, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  padding: 0.85rem 2rem;
  border: 1px solid var(--line);
  transition: border-color 0.25s, color 0.25s;
}

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

/* ═══════════ ПОДВАЛ ═══════════ */
.footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer__item {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: rgba(10, 10, 10, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

[data-theme="dark"] .footer__item {
  color: rgba(232, 230, 223, 0.3);
}

/* ═══════════ АДАПТИВ ═══════════ */
@media (max-width: 768px) {
  .header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header__nav {
    gap: 1.25rem;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .hero__corner {
    font-size: 0.5rem;
    letter-spacing: 0.15em;
  }

  .hero__corner--tl { top: 5.5rem; left: 1.25rem; }
  .hero__corner--tr { top: 5.5rem; right: 1.25rem; }
  .hero__corner--bl { bottom: 3rem; left: 1.25rem; }
  .hero__corner--br { bottom: 3rem; right: 1.25rem; }

  .projects__item {
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    padding: 1rem 0;
  }

  .projects__name {
    min-width: unset;
  }

  .contacts {
    padding: 4rem 1.25rem;
  }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .header__nav {
    gap: 0.85rem;
  }

  .header__link {
    font-size: 0.55rem;
  }

  .hero__corner {
    display: none;
  }

  .hero__corner--tl,
  .hero__corner--bl {
    display: block;
    font-size: 0.5rem;
  }
}

/* ═══════════ УМЕНЬШЕНИЕ ДВИЖЕНИЯ ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .about__text,
  .about__final {
    opacity: 1;
    transform: none;
  }

  .cursor { display: none; }
}
