/* Стиль под кибербезопасность — чёрно-белый, техничный */

:root,
[data-theme="light"] {
  --bg: #fff;
  --fg: #0a0a0a;
  --muted: #444;
  --border: #1a1a1a;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --border: #e8e8e8;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a0a;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --border: #e8e8e8;
    color-scheme: dark;
  }
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--fg);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  transition: background-color 0.28s ease, color 0.28s ease;
}

/* Шапка */
.header {
  padding: clamp(3rem, 10vw, 5rem) 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.header-inner {
  max-width: 32rem;
  margin: 0 auto;
}

.header--compact {
  padding: 1rem 1.5rem 1.25rem;
}

.header--compact .photo-wrap {
  width: 80px;
  height: 80px;
  margin-bottom: 0;
}

.photo-wrap {
  margin: 0 auto 1.5rem;
  width: 160px;
  height: 160px;
  padding: 0;
  border: none;
  background: var(--bg);
}

.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Основной контент */
.main {
  flex: 1;
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  width: 100%;
}

.section {
  margin-bottom: 3rem;
}

.section:last-of-type {
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--muted);
}

.section-title-text {
  white-space: nowrap;
}

/* Страница заметок — сетка карточек */
.notes-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

.contacts {
  font-style: normal;
}

.main--notes {
  max-width: 56rem;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0.5rem;
}

.card {
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.card:last-child {
  border-bottom: none;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.card-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.card-excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  max-width: 38rem;
}

.card-btn {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  transition: background 0.2s, color 0.2s;
}

.card-btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.card-btn[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--fg);
}

.card-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.text {
  margin: 0;
  color: var(--fg);
  max-width: 38rem;
  font-size: 0.95rem;
}

/* Блок «обо мне» — проза с отступами и читаемостью */
.about-prose {
  max-width: 40rem;
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--fg);
}

.about-prose p {
  margin: 0 0 1.25rem;
}

.about-prose p:last-child {
  margin-bottom: 0;
}

.about-lead {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

/* Резюме */
.resume {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resume-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.resume-item:last-child {
  border-bottom: none;
}

.resume-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.resume-company {
  font-weight: 600;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.resume-years {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.resume-role {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.career-ladder {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.career-step {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.career-step:last-child {
  margin-bottom: 0;
}

.career-years {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.career-position {
  color: var(--fg);
}

.resume-desc {
  margin: 0.75rem 0 0;
  color: var(--fg);
  max-width: 36rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.resume-achievements-title {
  margin: 1rem 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--muted);
}

.resume-achievements {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 36rem;
}

.resume-achievements li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--fg);
}

.resume-achievements li:last-child {
  margin-bottom: 0;
}

.resume-achievements li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Ссылки */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li {
  margin-bottom: 0.5rem;
}

.links a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.links a:hover {
  opacity: 0.6;
}

/* Переключатель темы */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  margin: 0;
  padding: 0.35rem 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg);
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s, color 0.28s;
}

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

.theme-toggle:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

/* Подвал */
.footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.footer p {
  margin: 0;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer a:hover {
  border-bottom-color: currentColor;
}

.footer-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

/* 404 */
.body--error {
  min-height: 100vh;
}

.error-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(4rem, 12vw, 7rem) 1.5rem 4rem;
  width: 100%;
  animation: error-in 0.55s ease both;
}

.error-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 18vw, 8rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--fg);
  animation: error-code-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.error-title {
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  animation: error-in 0.55s ease 0.12s both;
}

.error-text {
  margin: 0.85rem 0 0;
  max-width: 28rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
  animation: error-in 0.55s ease 0.2s both;
}

.error-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.12em;
  background: var(--fg);
  animation: error-blink 1.05s steps(1) infinite;
}

.error-path {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  word-break: break-all;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  animation: error-in 0.55s ease 0.28s both;
}

.error-home {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: opacity 0.2s, border-color 0.2s;
  animation: error-in 0.55s ease 0.34s both;
}

.error-home:hover {
  opacity: 0.65;
}

@keyframes error-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes error-code-in {
  from {
    opacity: 0;
    transform: translateY(1.1rem) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes error-blink {
  0%,
  45% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-page,
  .error-code,
  .error-title,
  .error-text,
  .error-path,
  .error-home {
    animation: none;
  }

  .error-cursor {
    animation: none;
    opacity: 0.5;
  }
}
