/* ============================================================
   cv.ownerpeace.ru — резюме Владимира Аветисянца
   Дизайн-система OwnerPeace: светлая «бумага», рисованные
   sketch-акценты, оранжевый. Портировано из ownerpeace.ru.
   ============================================================ */

:root {
  --paper: #f6f1e7;
  --ink: #2b2a28;
  --main: #e8703a;
  --main-light: #fbe3d8;
  --gray: #9a9a96;
  --light-gray: #e7e4dc;
  --white: #ffffff;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Oswald", "Arial Narrow", "PT Sans Narrow", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius-sketch: 14px 10px 16px 8px / 8px 16px 10px 14px;
  --maxw: 1180px;
}

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

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

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
  /* тонкая бумажная зернистость — как на ownerpeace.ru */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

::selection { background: var(--main); color: var(--white); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 0.98;
  text-transform: uppercase;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

/* ---------- служебное ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.section-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--main);
  text-transform: uppercase;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- sketch-примитивы ---------- */

.sketch-box {
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  background: var(--white);
  box-shadow: 6px 6px 0 0 var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sketch-box-hover:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 0 var(--main);
}

.btn-sketch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  background: var(--main);
  color: var(--white);
  box-shadow: 5px 5px 0 0 var(--ink);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn-sketch:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 0 var(--ink); }
.btn-sketch:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--ink); }
.btn-sketch--ghost { background: var(--white); color: var(--ink); }
.btn-sketch--sm {
  padding: 0.55rem 1rem;
  font-size: 0.7rem;
  box-shadow: 3px 3px 0 0 var(--ink);
}
.btn-sketch--sm:hover { box-shadow: 5px 5px 0 0 var(--ink); }

.ink-underline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M2 8 C 25 2, 45 12, 70 6 S 110 3, 118 7' stroke='%23e8703a' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 100% 0.5em;
  padding-bottom: 0.12em;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-bottom: 2px solid transparent;
}
.site-header.scrolled {
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--ink);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  border-left: 2px solid var(--light-gray);
  padding-left: 10px;
}
@media (max-width: 560px) { .brand .brand-sub { display: none; } }

.nav-desktop { display: none; align-items: center; gap: 20px; }
.nav-desktop a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s ease;
}
.nav-desktop a:hover { color: var(--main); }
.nav-desktop a .idx { font-family: var(--font-mono); font-size: 0.7rem; color: var(--main); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.lang-switch button {
  padding: 0.4rem 0.6rem;
  background: var(--white);
  border: 0;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
}
.lang-switch button[a-current="true"],
.lang-switch button.is-active { background: var(--main); color: var(--white); }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  cursor: pointer;
}
.nav-toggle span { height: 2px; width: 20px; background: var(--ink); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1080px) {
  .nav-desktop { display: flex; }
  .nav-toggle { display: none; }
}

.nav-mobile {
  position: fixed;
  inset: 66px 0 0 0;
  z-index: 40;
  background: var(--paper);
  padding: 32px 20px;
  display: none;
}
.nav-mobile.open { display: block; }
.nav-mobile nav { display: flex; flex-direction: column; gap: 20px; }
.nav-mobile nav a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.875rem;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.nav-mobile nav a .idx { font-family: var(--font-mono); font-size: 0.9rem; color: var(--main); }
@media (min-width: 1080px) { .nav-mobile { display: none !important; } }

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

.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
@media (min-width: 768px) { .hero { padding: 88px 0 104px; } }

/* hero: сетка текст + 3D */
@media (min-width: 1024px) {
  .hero-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    gap: 40px;
    align-items: center;
  }
  .hero--no3d .hero-wrap { display: block; }
}

.hero-3d {
  position: relative;
  margin-top: 44px;
  height: min(68vh, 440px);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
@media (min-width: 1024px) {
  .hero-3d { margin-top: 0; height: min(78vh, 680px); }
}

.hero-3d__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-3d.is-ready .hero-3d__canvas { opacity: 1; }
.hero-3d__canvas:active { cursor: grabbing; }

.hero-3d::after {
  content: "";
  position: absolute;
  left: 56%;
  bottom: 12%;
  width: 40%;
  height: 24px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(43, 42, 40, 0.22), rgba(43, 42, 40, 0) 70%);
  filter: blur(2px);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hero-3d.is-ready::after { opacity: 1; }

.hero-3d__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
  opacity: 0;
  pointer-events: none;
}
.hero-3d.is-ready .hero-3d__hint { animation: hint-fade 5s ease forwards; }
@keyframes hint-fade {
  0%, 15% { opacity: 0; }
  30%, 70% { opacity: 0.75; }
  100% { opacity: 0; }
}

.hero-3d__loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 7px;
}
.hero-3d__loader span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--main);
  animation: dot 1s ease-in-out infinite;
}
.hero-3d__loader span:nth-child(2) { animation-delay: 0.15s; }
.hero-3d__loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.hero h1 {
  max-width: 18ch;
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: 1.02;
  margin-top: 22px;
}
.hero h1 .line { display: block; overflow: hidden; padding: 0.06em 0; }
.hero h1 .word { display: inline-block; white-space: nowrap; }
.hero h1 .ltr { display: inline-block; }

.hero .role {
  margin-top: 20px;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: var(--main);
  letter-spacing: 0;
}

.hero .lead {
  margin-top: 24px;
  max-width: 46ch;
  font-size: 1.075rem;
  color: rgba(43, 42, 40, 0.82);
}
@media (min-width: 768px) { .hero .lead { font-size: 1.2rem; } }

.hero .cta-row { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero .stats {
  margin-top: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
@media (min-width: 640px) { .hero .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hero .stats .stat { padding: 18px 20px; }
.hero .stats .stat dt { font-family: var(--font-display); font-size: 2.25rem; color: var(--main); line-height: 1; }
.hero .stats .stat dd { margin-top: 6px; font-size: 0.875rem; color: rgba(43, 42, 40, 0.7); }

/* ---------- секции ---------- */

.section { padding: 72px 0; scroll-margin-top: 90px; }
@media (min-width: 768px) { .section { padding: 104px 0; } }
.section:nth-of-type(even) { background: rgba(231, 228, 220, 0.4); }

.section-head { margin-bottom: 48px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 768px) { .section-head { margin-bottom: 64px; } }
.section-head h2 { max-width: 20ch; font-size: clamp(2rem, 5vw, 3.5rem); }
.section-head .intro { max-width: 52ch; font-size: 1.075rem; color: rgba(43, 42, 40, 0.75); }

/* достижения */
.ach-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 640px) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ach {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ach .num { font-family: var(--font-display); font-size: 2.4rem; color: var(--main); line-height: 1; }
.ach .txt { font-size: 0.95rem; color: rgba(43, 42, 40, 0.82); }
.ach .src { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--gray); text-transform: uppercase; }

/* опыт */
.xp-list { display: flex; flex-direction: column; gap: 22px; }
.xp {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xp-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.xp .idx { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gray); }
.xp h3 { font-size: 1.4rem; }
.xp .period { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--gray); white-space: nowrap; text-transform: uppercase; }
.xp .xp-role { font-size: 0.92rem; color: var(--main); font-weight: 500; }
.xp ul { list-style: none; display: flex; flex-direction: column; gap: 8px; border-top: 2px dashed var(--light-gray); padding-top: 16px; }
.xp ul li { display: flex; gap: 10px; font-size: 0.95rem; color: rgba(43, 42, 40, 0.85); }
.xp ul li::before { content: "→"; color: var(--main); flex-shrink: 0; }
.xp .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.xp .tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1.5px solid var(--light-gray);
  border-radius: 999px;
  color: var(--gray);
}

/* навыки */
.skill-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 640px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .skill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.skill { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.skill h3 { font-size: 1.05rem; letter-spacing: 0.02em; }
.skill .idx { font-family: var(--font-mono); font-size: 0.7rem; color: var(--main); }
.skill p { font-size: 0.9rem; color: rgba(43, 42, 40, 0.8); }

/* образование / сертификаты */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 768px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card-block { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.card-block > .idx { font-family: var(--font-mono); font-size: 0.72rem; color: var(--main); text-transform: uppercase; letter-spacing: 0.06em; }
.card-block h3 { font-size: 1.3rem; }
.item { display: flex; flex-direction: column; gap: 2px; }
.item .item-title { font-weight: 600; }
.item .item-sub { font-size: 0.88rem; color: rgba(43, 42, 40, 0.7); }
.item .item-year { font-family: var(--font-mono); font-size: 0.7rem; color: var(--gray); }
.item + .item { border-top: 2px dashed var(--light-gray); padding-top: 14px; }

/* контакты */
.contact-box { padding: 30px; display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 768px) { .contact-box { padding: 44px; } }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-item { display: flex; flex-direction: column; gap: 3px; }
.contact-item .label { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); }
.contact-item a, .contact-item span { font-size: 1.02rem; text-decoration: none; }
.contact-item a:hover { color: var(--main); }
.contact-cta { display: flex; flex-wrap: wrap; gap: 14px; }

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

.site-footer {
  border-top: 2px solid var(--ink);
  padding: 40px 0;
  font-size: 0.85rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--main); text-decoration: none; }
.site-footer .muted { color: var(--gray); font-family: var(--font-mono); font-size: 0.72rem; }

/* ---------- reveal-анимация ---------- */

.js .reveal { opacity: 0; }
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.js .reveal.is-visible { animation: fade-in-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-visible { opacity: 1 !important; animation: none !important; }
  .hero h1 .ltr { transform: none !important; opacity: 1 !important; }
}

/* ---------- печать ---------- */
@media print {
  .site-header, .site-footer, .hero .cta-row, .contact-cta, .nav-mobile { display: none !important; }
  body { background: #fff; }
  .section:nth-of-type(even) { background: #fff; }
  .sketch-box { box-shadow: none; border-color: #ccc; }
}
