/* ============================================================
   Арсений Кудрявцев — портфолио
   Мир: ретро-брутализм / webflow-mockup сетка. Чёрное на белом,
   толстые (4px) чёткие векторные обводки на каждом элементе —
   без скетч-эффекта, halftone-точки — единственный источник
   фактуры (звёздочка у имени + адресная строка/экран плеера),
   жёсткие тени без blur на "коробочных" элементах. Golos Text
   (800) = тяжёлый гротеск для имени/заголовков, JetBrains Mono =
   вся остальная типографика (навигация, лейблы, тело, чром окна).

   Обводки теперь plain CSS border (не SVG): jitter-фильтр убрали
   ещё на прошлом проходе, а стретч-фит SVG-техника имела смысл
   только ради него — обычный border даёт тот же чёткий результат
   проще. SVG остался только там, где нужна форма/паттерн, которые
   CSS border не может: уголки-метки, halftone-звезда, шеврон,
   play-треугольник.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --paper: #ffffff;
  --ink: #000000;

  --font-display: 'Golos Text', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --frame-inset: 1.5rem;
  --frame-pad: 3rem;
  --shadow-offset: 0.6rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Halftone (only texture device in the system) ---------- */

.halftone-soft {
  background-image: radial-gradient(circle at center, var(--ink) 1.1px, transparent 1.3px);
  background-size: 11px 11px;
}

/* ---------- Shared page frame ---------- */

.page {
  position: relative;
  min-height: 100svh;
  margin: var(--frame-inset);
  padding: var(--frame-pad);
  border: 4px solid var(--ink);
  background: var(--paper);
}

/* A section whose content is honestly short (Contact) sizes to its
   own content instead of forcing a full viewport of empty paper. */
.page--compact {
  min-height: 0;
}

.page--compact .page__body {
  padding-block: 1.5rem;
}

.tick {
  position: absolute;
  width: 1.75rem;
  height: 1.75rem;
  pointer-events: none;
  z-index: 2;
}

.tick svg { display: block; width: 100%; height: 100%; }

.tick--tl { top: -0.875rem; left: -0.875rem; }
.tick--tr { top: -0.875rem; right: -0.875rem; transform: rotate(90deg); }
.tick--br { bottom: -0.875rem; right: -0.875rem; transform: rotate(180deg); }
.tick--bl { bottom: -0.875rem; left: -0.875rem; transform: rotate(270deg); }

.page__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.page__content {
  flex: 1;
  min-width: 0;
}

.page__heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 1.6vw + 1.4rem, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 42rem;
}

.page__subtext {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* ---------- Nav (top on hero, side rail elsewhere) ---------- */

.nav {
  display: flex;
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.nav__item--active {
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
}

.hero__nav-row {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.nav--top {
  flex: 1;
  min-width: 0;
}

.nav--top .nav__item {
  flex: 1;
  border-right-width: 0;
}

.nav--top .nav__item:last-child {
  border-right-width: 2px;
}

.lang-toggle {
  flex: none;
  display: flex;
  border: 2px solid var(--ink);
}

.lang-toggle__item {
  flex: none;
  min-width: 2.75rem;
  padding: 0 0.9rem;
  border: none;
  border-right: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.lang-toggle__item:last-child { border-right: none; }

.lang-toggle__item--active {
  background: var(--ink);
  color: var(--paper);
}

.nav--side {
  flex: none;
  width: 9.5rem;
  flex-direction: column;
}

.nav--side .nav__item {
  justify-content: flex-start;
  border-bottom-width: 0;
}

.nav--side .nav__item:last-child {
  border-bottom-width: 2px;
}

/* ---------- Hero ---------- */

.page--hero {
  display: flex;
  flex-direction: column;
}

.hero__grid {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr);
  column-gap: 2.25rem;
  align-items: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 34rem;
}

.hero__name {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 2.6vw + 1.8rem, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero__mark {
  width: 0.62em;
  height: 0.62em;
  flex: none;
  margin-top: 0.08em;
  overflow: visible;
}

.hero__tagline {
  max-width: 30rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero__divider {
  align-self: stretch;
  width: 4px;
  background: var(--ink);
}

/* ---------- Stamp (role label, reusable "stamped" chip) ---------- */

.stamp {
  display: inline-block;
  padding: 0.7em 1.3em;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.95rem, 0.3vw + 0.88rem, 1.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 0 var(--ink);
}

/* ---------- Player (OS-chrome video window) ---------- */

.player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 888 / 511;
}

/* ---------- About ---------- */

.prose {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 42rem;
}

.prose p {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- Portfolio ---------- */

.projects {
  margin-top: 2rem;
}

.project {
  border: 2px solid var(--ink);
  border-top-width: 0;
}

.project:first-child { border-top-width: 2px; }

.project__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.25rem 1.5rem;
  border: none;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.project__row-text { display: block; }

.project__title {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
}

.project__desc {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0.75;
}

.project__chevron {
  flex: none;
  width: 1.1rem;
  height: 0.7rem;
  transition: transform 0.2s ease;
}

.project__row[aria-expanded="true"] .project__chevron {
  transform: rotate(180deg);
}

.project__detail {
  display: grid;
  grid-template-rows: 0fr;
  border-top: 2px solid var(--ink);
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project__detail.is-open { grid-template-rows: 1fr; }

.project__detail[hidden] { display: none; }

.project__detail-clip {
  overflow: hidden;
  min-height: 0;
}

.project__detail-inner {
  padding: 1.75rem 1.5rem 2rem;
}

.project__detail--split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.project__detail--gallery {
  align-items: stretch;
}

.project__gallery {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.project__gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .project__detail { transition: none; }
}

.project__text h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1.25rem;
}

.project__text h3:first-child { margin-top: 0; }

.project__text p {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  line-height: 1.6;
}

.project__placeholder {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-style: italic;
  opacity: 0.7;
}

.project__collapse-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.project__collapse-row--split {
  justify-content: space-between;
}

.project__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project__collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.project__collapse-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.project__collapse-btn svg {
  width: 0.9rem;
  height: 0.55rem;
  flex: none;
}

.mini-player {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 3px solid var(--ink);
  aspect-ratio: 16 / 9;
  box-shadow: calc(var(--shadow-offset) * 0.75) calc(var(--shadow-offset) * 0.75) 0 0 var(--ink);
}

.mini-player__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.mini-player__frame--img {
  object-fit: cover;
}

.mini-player__screen {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-player__label {
  background: var(--paper);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.mini-player__controls {
  flex: none;
  height: 2rem;
  border-top: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Case extra (full-width detail below concept/logline) ---------- */

.case-extra {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.case-section > h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.1rem;
}

.case-refs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.case-ref {
  border: 2px solid var(--ink);
}

.case-ref img {
  display: block;
  width: 100%;
  height: 11rem;
  object-fit: cover;
}

.case-ref figcaption {
  padding: 0.75rem 0.9rem;
  border-top: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

.case-ref__note {
  display: block;
  margin-top: 0.4rem;
  font-style: italic;
  opacity: 0.75;
}

.case-table-wrap {
  overflow-x: auto;
}

.case-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.case-table th,
.case-table td {
  border: 2px solid var(--ink);
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.case-table th {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

.case-table td:nth-child(2) {
  white-space: nowrap;
  opacity: 0.75;
}

.case-prose {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.case-prose p {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.65;
}

.case-sections {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.case-list {
  margin-top: 0.25rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-list li {
  position: relative;
  padding-left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.65;
}

.case-list li::before {
  content: "\2013";
  position: absolute;
  left: 0;
}

/* ---------- Skills ---------- */

.experience {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.experience__entry {
  border-top: 2px solid var(--ink);
  padding-top: 1.5rem;
}

.experience__entry:first-child {
  border-top: none;
  padding-top: 0;
}

.experience__title {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1rem;
}

.experience__title strong { font-weight: 700; }

.experience__entry ul {
  margin-top: 0.75rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.experience__entry li {
  position: relative;
  padding-left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.55;
}

.experience__entry li::before {
  content: "\2013";
  position: absolute;
  left: 0;
}

.btn {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.85rem 1.75rem;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 0 var(--ink);
}

.btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- Contact ---------- */

.contact-list {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 34rem;
}

.contact-list__row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.contact-list__row:last-child { border-bottom: none; }

.contact-list dt { font-weight: 700; }

/* ---------- Resume ---------- */

.resume { max-width: 52rem; }

.resume__header {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.resume__photo {
  flex: none;
  width: 8.5rem;
  height: 8.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 0 var(--ink);
}

.resume__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(1) contrast(1.08);
}

.resume__identity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.resume__identity p {
  font-family: var(--font-mono);
  font-size: 0.98rem;
}

.resume__identity .stamp { margin-top: 0.5rem; align-self: flex-start; }

.resume__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 1.4vw + 1.3rem, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.resume__section {
  border-top: 2px solid var(--ink);
  padding-top: 2rem;
  margin-top: 2.5rem;
}

.resume__section:first-of-type { margin-top: 0; }

.resume__section > h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 1vw + 1.1rem, 1.6rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.75rem;
}

.resume__job {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.resume__job + .resume__job {
  border-top: 2px solid var(--ink);
  margin-top: 2rem;
  padding-top: 2rem;
}

.resume__job-dates {
  flex: none;
  width: 11rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
}

.resume__job-duration {
  font-weight: 400;
  opacity: 0.75;
}

.resume__job-body { flex: 1; min-width: 0; }

.resume__job-company {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.resume__job-meta {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  opacity: 0.75;
}

.resume__job-meta a { text-decoration: underline; }

.resume__tags {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  opacity: 0.75;
}

.resume__tags p { margin-top: 0.6rem; }
.resume__tags p:first-child { margin-top: 0; }

.resume__tags ul {
  margin-top: 0.3rem;
  list-style: none;
}

.resume__tags li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.5;
}

.resume__tags li::before {
  content: "\2022";
  position: absolute;
  left: 0;
}

.resume__job-title {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.resume__job-note {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-style: italic;
  opacity: 0.75;
}

.resume__label {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resume__list {
  margin-top: 0.6rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resume__list li {
  position: relative;
  padding-left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.55;
}

.resume__list li::before {
  content: "\2013";
  position: absolute;
  left: 0;
}

.resume__edu {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.resume__edu-year {
  flex: none;
  width: 11rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
}

.resume__edu-body { flex: 1; min-width: 0; }

.resume__edu-body h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}

.resume__edu-body p {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  opacity: 0.75;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root {
    --frame-inset: 1rem;
    --frame-pad: 1.75rem;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
    align-items: start;
  }

  .hero__text { order: 1; max-width: none; }
  .hero__divider { display: none; }
  .player { order: 2; }

  .hero__name { font-size: clamp(2.1rem, 6vw, 2.8rem); }

  .page__body {
    flex-direction: column;
    gap: 1.75rem;
  }

  .nav--side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav--side .nav__item {
    flex: 1 1 auto;
    border-bottom-width: 2px;
    border-right-width: 0;
  }

  .nav--side .nav__item:last-child { border-right-width: 2px; }

  .hero__nav-row {
    flex-wrap: wrap;
    margin-bottom: 2rem;
    gap: 0.75rem;
  }

  .nav--top {
    flex-wrap: wrap;
    min-width: 100%;
  }

  .nav--top .nav__item {
    flex: 1 1 auto;
    border-bottom-width: 2px;
    border-right-width: 0;
  }

  .nav--top .nav__item:last-child { border-right-width: 2px; }

  .project__detail--split {
    grid-template-columns: 1fr;
  }

  .case-refs {
    grid-template-columns: 1fr;
  }

  .resume__job,
  .resume__edu {
    flex-direction: column;
    gap: 0.5rem;
  }

  .resume__job-dates,
  .resume__edu-year {
    width: auto;
  }

  .mini-player { max-width: 26rem; }
}

@media (max-width: 520px) {
  :root {
    --frame-inset: 0.65rem;
    --frame-pad: 1.35rem;
    --shadow-offset: 0.4rem;
  }

  .page__heading { font-size: clamp(1.5rem, 6vw, 1.9rem); }

  .hero__tagline { font-size: 0.98rem; }

  .stamp { padding: 0.6em 1em; font-size: 0.85rem; }

  .nav--side .nav__item { padding: 0.65rem 0.8rem; font-size: 0.85rem; }

  .project__row { padding: 1rem 1.1rem; }
  .project__detail-inner { padding: 1.4rem 1.1rem 1.6rem; }

  .contact-list__row { grid-template-columns: 1fr; gap: 0.35rem; }

  .resume__header { flex-direction: column; }
  .resume__photo { width: 6.5rem; height: 6.5rem; }
}
