/* ==========================================================================
   juliahalmetova.com — общие стили
   Значения взяты из переменных Figma (Primitives, Space/Type/Color tokens).
   Брейкпоинты: мобилка < 654 · планшет 654–1023 · десктоп ≥ 1024
   ========================================================================== */

:root {
  /* Color tokens */
  --text-primary: #000;
  --text-muted: #6b6b6b;
  --text-inverse: #fff;
  --surface-page: #fff;
  --surface-footer: #e6e6e6;
  --surface-placeholder: #e6e6e6;
  --stroke-hairline: #e6e6e6;
  --accent-blue: #00f;
  --accent-red: #d7244c;
  --accent-lime: #a1ff00;
  --decor-lettering: #e6e6e6;

  /* Fonts */
  --font-text: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --font-accent: "Dosis", "Helvetica Neue", Arial, sans-serif;

  /* Space tokens — Desktop */
  --page-padding-x: 160px;
  --page-padding-20: 20px;
  --page-padding-40: 40px;
  --page-header-top: 80px;
  --page-chrome-inset: 40px;
  --page-section-gap: 120px;
  --page-section-top: 80px;
  --page-section-bottom: 80px;
  --page-hero-top: 144px;
  --page-content-pad-top: 80px;
  --page-content-pad-bottom: 80px;
  --content-block-gap: 48px;
  --content-content-gap: 12px;
  --content-text-gap: 20px;
  --content-title-gap: 4px;
  --content-column-gap: 176px;
  --grid-card-gap: 16px;
  --grid-tile-gap: 10px;
  --grid-preview-gap-x: 44px;
  --grid-preview-gap-y: 56px;
  --card-inner-gap: 8px;
  --case-shot-gap: 30px;
  --offset-title: 160px;
  --offset-grid-inset: 69px;
  --rhythm-xs: 2px;
  --rhythm-sm: 12px;
  --rhythm-md: 24px;
  --rhythm-lg: 40px;
  --rhythm-xl: 80px;
  --nav-social-gap: 40px;
  --rail-offset-x: 24px;
  --rail-offset-y: 252px;

  /* Type tokens — Desktop */
  --size-heading-page: 52px;
  --size-heading-subtitle: 24px;
  --size-heading-card: 24px;
  --size-heading-block: 24px;
  --size-heading-menu: 52px;
  --size-body: 20px;
  --size-body-small: 16px;
  --size-caption: 16px;
  --size-meta: 20px;
  --size-tagline: 20px;
  --size-micro: 14px;
  --size-copyright: 16px;
  --size-list: 24px;
  --size-button: 18px;
}

/* Tablet 654–1023 */
@media (max-width: 1023.98px) {
  :root {
    --page-padding-x: 60px;
    --page-header-top: 60px;
    --page-section-gap: 80px;
    --page-section-top: 60px;
    --page-section-bottom: 60px;
    --page-hero-top: 96px;
    --page-content-pad-top: 60px;
    --page-content-pad-bottom: 60px;
    --content-block-gap: 40px;
    --content-content-gap: 10px;
    --content-text-gap: 16px;
    --content-column-gap: 64px;
    --grid-preview-gap-x: 16px;
    --grid-preview-gap-y: 32px;
    --case-shot-gap: 20px;
    --offset-title: 140px;
    --offset-grid-inset: 24px;
    --rhythm-md: 20px;
    --rhythm-lg: 32px;
    --rhythm-xl: 64px;
    --rail-offset-x: 20px;
    --rail-offset-y: 180px;

    --size-heading-page: 40px;
    --size-heading-subtitle: 20px;
    --size-heading-card: 16px;
    --size-heading-block: 20px;
    --size-body: 16px;
    --size-body-small: 14px;
    --size-meta: 16px;
    --size-tagline: 16px;
  }
}

/* Mobile < 654 */
@media (max-width: 653.98px) {
  :root {
    --page-padding-x: 20px;
    --page-padding-20: 10px;
    --page-padding-40: 20px;
    --page-header-top: 40px;
    --page-section-gap: 64px;
    --page-section-top: 32px;
    --page-section-bottom: 32px;
    --page-hero-top: 64px;
    --page-content-pad-top: 20px;
    --page-content-pad-bottom: 20px;
    --content-block-gap: 20px;
    --content-content-gap: 8px;
    --content-text-gap: 8px;
    --content-column-gap: 24px;
    --grid-card-gap: 12px;
    --grid-tile-gap: 8px;
    --grid-preview-gap-x: 8px;
    --grid-preview-gap-y: 16px;
    --case-shot-gap: 16px;
    --offset-title: 32px;
    --offset-grid-inset: 8px;
    --rhythm-sm: 8px;
    --rhythm-md: 16px;
    --rhythm-lg: 24px;
    --rhythm-xl: 48px;
    --nav-social-gap: 28px;
    --rail-offset-y: 140px;

    --size-heading-page: 24px;
    --size-heading-subtitle: 16px;
    --size-heading-card: 14px;
    --size-heading-block: 14px;
    --size-body: 12px;
    --size-body-small: 12px;
    --size-caption: 14px;
    --size-meta: 14px;
    --size-tagline: 10px;
    --size-list: 20px;
    --size-button: 16px;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.5;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

body.is-locked { overflow: hidden; }

/* --------------------------------------------------------------------------
   Text styles
   -------------------------------------------------------------------------- */

.t-heading-page { font: 400 var(--size-heading-page)/1.2 var(--font-text); }
.t-heading-subtitle { font: 300 var(--size-heading-subtitle)/1.2 var(--font-text); }
.t-heading-card { font: 600 var(--size-heading-card)/1.4 var(--font-accent); }
.t-heading-block { font: 600 var(--size-heading-block)/1.4 var(--font-accent); }
.t-body { font: 400 var(--size-body)/1.5 var(--font-text); }
.t-body-small { font: 400 var(--size-body-small)/1.4 var(--font-text); }
.t-caption { font: 600 var(--size-caption)/1.4 var(--font-accent); }
.t-meta { font: 300 var(--size-meta)/1.2 var(--font-text); }
.t-micro { font: 400 var(--size-micro)/1.2 var(--font-text); }

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.page > main { flex: 1 0 auto; }

/* --------------------------------------------------------------------------
   nav-burger — кнопка меню, 22×22, правый верхний угол
   -------------------------------------------------------------------------- */

.nav-burger {
  position: fixed;
  top: var(--page-chrome-inset);
  right: var(--page-chrome-inset);
  z-index: 50;
  width: 22px;
  height: 22px;
}

/* мобилка: 20 от правого края, 40 сверху */
@media (max-width: 653.98px) {
  .nav-burger { right: 20px; }
}

/* увеличенная зона нажатия */
.nav-burger::before { content: ""; position: absolute; inset: -11px; }

.nav-burger__bar {
  position: absolute;
  right: 0;
  height: 2px;
  background: var(--text-primary);
  transition: width .2s ease;
}
.nav-burger__bar:nth-child(1) { top: 0; width: 22px; }
.nav-burger__bar:nth-child(2) { top: 6px; width: 22px; }
.nav-burger__bar:nth-child(3) { top: 12px; width: 14px; }

.nav-burger:hover .nav-burger__bar:nth-child(3),
.nav-burger:focus-visible .nav-burger__bar:nth-child(3) { width: 22px; }

/* --------------------------------------------------------------------------
   social-links — один блок: колонка слева на десктопе (Layout=Rail),
   ряд над копирайтом в подвале на планшете и мобилке (Layout=Row)
   -------------------------------------------------------------------------- */

.social {
  position: fixed;          /* десктоп: колонка слева, всегда по центру высоты окна */
  top: 50%;
  left: var(--rail-offset-x);
  z-index: 20;
  transform: translateY(-50%);
}

.social-links { display: flex; flex-direction: column; align-items: center; gap: 32px; }

.social-links__link {
  display: block;
  width: 26px;
  height: 24px;
  color: var(--text-primary);
  transition: color .15s ease;
}
.social-links__link:hover,
.social-links__link:focus-visible { color: var(--accent-blue); }
.social-links__link .icon { display: block; width: 26px; height: 24px; }

@media (max-width: 1023.98px) {
  .social {
    position: absolute;
    top: auto;
    bottom: 73px;           /* подвал 120: отступ 23 + копирайт 38 + 12 */
    left: 50%;
    transform: translateX(-50%);
  }
  .social-links { flex-direction: row; gap: 20px; }
  .social-links li:first-child { order: 1; }   /* в ряду почта стоит последней */
}

@media (max-width: 653.98px) {
  .page:not(.page-home) .social { bottom: 70px; }   /* мобильный подвал 118: 24 + 38 + 8 */
}

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

.site-footer {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  height: 180px;
  padding: 0 40px;
  background: var(--surface-footer);
}

.site-footer__copyright {
  font: 300 var(--size-copyright)/1.2 var(--font-text);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1023.98px) {
  .site-footer {
    align-items: center;
    height: 120px;
    padding: 36px 60px 0;   /* 36 = место под ряд иконок (24 + 12) */
  }
  .site-footer__copyright { text-align: center; }
}

@media (max-width: 653.98px) {
  .page:not(.page-home) .site-footer { height: 118px; padding: 32px 20px 0; }
}

/* --------------------------------------------------------------------------
   Overlays: меню и форма контактов
   -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--page-padding-20);
  background: #000;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .2s ease;
}

.overlay__close {
  position: absolute;
  top: var(--page-chrome-inset);
  right: var(--page-chrome-inset);
  width: 22px;
  height: 22px;
  color: #e6e6e6;
  transition: color .15s ease;
}
.overlay__close::before { content: ""; position: absolute; inset: -11px; }
.overlay__close:hover, .overlay__close:focus-visible { color: #fff; }
.overlay__close svg { width: 22px; height: 22px; }
@media (max-width: 653.98px) {
  .overlay__close { right: 20px; }
}

/* menu-overlay */
.menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--content-text-gap);
}

.menu-links a {
  display: block;
  font: 400 var(--size-heading-menu)/1.2 var(--font-accent);
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  transition: color .15s ease;
}
/* hover = серый + белый 60% поверх */
.menu-links a:hover, .menu-links a:focus-visible { color: #c4c4c4; }
.menu-links a[aria-current="page"] { color: var(--text-inverse); }

@media (max-height: 520px) {
  .menu-links { gap: 4px; }
  .menu-links a { font-size: 36px; }
}

/* contact-overlay */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 480px;
  margin: auto 0;
}

.contact-form__title {
  font: 400 var(--size-heading-menu)/1.2 var(--font-accent);
  color: var(--text-inverse);
}

.field { display: flex; flex-direction: column; gap: 8px; }

.field__label {
  align-self: flex-start;
  font: 600 var(--size-caption)/1.4 var(--font-accent);
  color: var(--text-inverse);
}

.field__input {
  width: 100%;
  min-height: 40px;
  padding: 5px 0 4px;
  border: 0;
  border-bottom: 1px solid var(--stroke-hairline);
  border-radius: 0;
  background: transparent;
  color: var(--text-inverse);
  font: 400 var(--size-body)/1.5 var(--font-text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
textarea.field__input { display: block; resize: none; overflow: hidden; }
.field__input::placeholder { color: var(--text-muted); opacity: 1; }
.field__input:focus-visible { border-bottom-color: #fff; }

.field.is-error .field__label,
.field.is-error .field__input,
.field.is-error .field__input::placeholder { color: var(--accent-red); }

/* ловушка для ботов — людям не видна */
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.button-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 40px;
  border-radius: 4px;
  background: var(--accent-blue);
  color: var(--text-inverse);
  font: 600 var(--size-button)/1.4 var(--font-accent);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.button-submit:hover, .button-submit:focus-visible { color: var(--accent-lime); }
.button-submit:active { background: var(--accent-lime); color: var(--accent-blue); }
.button-submit[disabled] { opacity: .6; cursor: default; }

.contact-form__message {
  margin-top: -8px;
  font: 400 var(--size-body)/1.2 var(--font-text);
  color: var(--text-muted);
}
.contact-form__message[hidden] { display: none; }

/* --------------------------------------------------------------------------
   page-top — шапка типовой страницы: заголовок, подзаголовок, стрелки
   -------------------------------------------------------------------------- */

.page-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: var(--page-header-top) var(--page-padding-x) 0;
}

.page-header { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-header__title { font: 400 var(--size-heading-page)/1.2 var(--font-text); }
.page-header__subtitle { font: 300 var(--size-heading-subtitle)/1.2 var(--font-text); }

/* текстовые ссылки: подчёркнуты, при наведении синие */
.text-link, .page-header__subtitle a, .case-text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: .12em;
  transition: color .15s ease;
}
.text-link:hover, .text-link:focus-visible,
.page-header__subtitle a:hover, .page-header__subtitle a:focus-visible,
.case-text a:hover, .case-text a:focus-visible { color: var(--accent-blue); }

.page-nav { flex: none; display: flex; align-items: center; gap: var(--rhythm-sm); }

.page-nav__arrow {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--text-primary);
  transition: color .15s ease, transform .15s ease;
}
.page-nav__arrow svg { display: block; }
.page-nav__arrow--next svg { transform: scaleX(-1); }
.page-nav__arrow:hover, .page-nav__arrow:focus-visible { color: var(--accent-blue); }
.page-nav__arrow--prev:hover, .page-nav__arrow--prev:focus-visible { transform: translateX(-2px); }
.page-nav__arrow--next:hover, .page-nav__arrow--next:focus-visible { transform: translateX(2px); }

.page-nav__dot {
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: background-color .15s ease, transform .15s ease;
}
.page-nav__dot::before { content: ""; position: absolute; inset: -9px; }
.page-nav__dot:hover, .page-nav__dot:focus-visible { background: var(--accent-blue); transform: scale(1.3333); }

@media (max-width: 653.98px) {
  .page-top { flex-direction: column; align-items: stretch; gap: 8px; }
  .page-header { max-width: calc(100% - 40px); }   /* место под бургер */
  .page-nav { justify-content: space-between; gap: 8px; }
}

/* --------------------------------------------------------------------------
   page-content
   -------------------------------------------------------------------------- */

.page-content {
  padding: var(--page-content-pad-top) var(--page-padding-x) var(--page-content-pad-bottom);
}

/* --------------------------------------------------------------------------
   card-project — превью в сетках Portfolio / Art Gallery / Blog
   -------------------------------------------------------------------------- */

.card-project {
  position: relative;
  display: block;
  aspect-ratio: 228 / 152;
  overflow: hidden;
  background: var(--surface-placeholder);
}
.card-project > img { width: 100%; height: 100%; object-fit: cover; }

.card-project__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgba(255, 255, 255, .9);
  opacity: 0;
  transition: opacity .15s ease;
}
.card-project:hover .card-project__caption,
.card-project:focus-visible .card-project__caption { opacity: 1; }

.card-project__title { font: 600 var(--size-heading-card)/1.4 var(--font-accent); }
.card-project__subtitle { font: 400 var(--size-micro)/1.2 var(--font-text); }

/* --------------------------------------------------------------------------
   lightbox — просмотр картинок (компонент gallery-lightbox) + увеличение
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: var(--page-padding-40) var(--page-padding-40) 24px;
  background: rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .2s ease; }

.lightbox__viewer {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  padding-top: 56px;
  overflow: hidden;
}
.lightbox.is-zoomed .lightbox__viewer { overflow: auto; overscroll-behavior: contain; }

/* margin:auto центрирует картинку и не обрезает её, когда она больше окна */
.lightbox__img {
  flex: none;
  display: block;
  margin: auto;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .15s ease;
}
.lightbox.is-loading .lightbox__img { opacity: 0; }
.lightbox.can-zoom .lightbox__img { cursor: zoom-in; }
.lightbox.is-zoomed .lightbox__img { cursor: grab; }
.lightbox.is-dragging .lightbox__img { cursor: grabbing; }

/* миниатюры над controls — только в постах блога */
.lightbox__thumbs { flex: none; display: flex; justify-content: center; gap: 10px; max-width: 100%; }
.lightbox__thumbs[hidden] { display: none; }
.lightbox__thumb { flex: none; width: 80px; height: 80px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .5; transition: opacity .15s ease; }
.lightbox__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover, .lightbox__thumb:focus-visible, .lightbox__thumb[aria-current] { opacity: 1; }
@media (max-width: 653.98px) {
  .lightbox__thumbs { gap: 8px; }
  .lightbox__thumb { width: 56px; height: 56px; }
}
.lightbox.is-single .lightbox__arrow, .lightbox.is-single .lightbox__counter { display: none; }

.lightbox__controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--rhythm-lg);
  max-width: 100%;
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}
.lightbox__title { font: 600 var(--size-heading-card)/1.4 var(--font-accent); color: var(--text-inverse); }
.lightbox__counter { font: 400 var(--size-body)/1.5 var(--font-text); color: var(--text-muted); }

.lightbox__arrow {
  flex: none;
  position: relative;
  width: 24px;
  height: 24px;
  color: #fff;
  transition: transform .15s ease;
}
.lightbox__arrow::before { content: ""; position: absolute; inset: -10px; }
.lightbox__arrow svg { display: block; }
.lightbox__arrow--next svg { transform: scaleX(-1); }
.lightbox__arrow--prev:hover, .lightbox__arrow--prev:focus-visible { transform: translateX(-2px); }
.lightbox__arrow--next:hover, .lightbox__arrow--next:focus-visible { transform: translateX(2px); }

.lightbox__tools {
  position: absolute;
  z-index: 1;
  top: var(--page-chrome-inset);
  right: var(--page-chrome-inset);
  display: flex;
  gap: 24px;
}
.lightbox__tool {
  position: relative;
  width: 22px;
  height: 22px;
  color: #e6e6e6;
  transition: color .15s ease, opacity .15s ease;
}
.lightbox__tool::before { content: ""; position: absolute; inset: -11px; }
.lightbox__tool svg { display: block; width: 22px; height: 22px; }
.lightbox__tool:hover, .lightbox__tool:focus-visible { color: #fff; }
.lightbox__tool[disabled] { opacity: .3; cursor: default; }
.lightbox:not(.can-zoom) .lightbox__tool[data-act="in"],
.lightbox:not(.can-zoom) .lightbox__tool[data-act="out"] { display: none; }

.lightbox :focus-visible { outline-color: #fff; }
.lightbox:focus { outline: none; }

@media (max-width: 653.98px) {
  .lightbox__tools { right: 20px; }
}

/* --------------------------------------------------------------------------
   Страницы-заглушки: 404 и «Coming soon»
   -------------------------------------------------------------------------- */

.stub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--content-block-gap);
}
.stub__decor { display: block; max-width: none; height: auto; }
.stub__decor--404 { width: 303px; }
.stub__decor--tools { width: 219px; margin: -3.5px; }
.stub__message { font: 400 var(--size-body)/1.5 var(--font-text); }
.stub .button-submit { width: auto; }

@media (max-width: 1023.98px) {
  .stub__decor--404 { width: 251px; }
}
@media (max-width: 653.98px) {
  .stub__decor--404 { width: 174px; }
  .stub__decor--tools { width: 137.4px; margin: -2.2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
