/* CSS Variables */
:root {
  /* Colors */
  --color-text: #272727;
  --color-black: #000000;
  --color-background: #FFFFFF;
  --color-background-dark: #1f1f20;
  --color-background-accent: #F7F7F7;
  --color-blockquote-border: #CAC7C0;
  --color-button-outline-border: #b8b8b5;
  --color-forced-link-underline: #8e8e8d;

  --layout-left-right-indent: 20px;

  --text-line-height-base: 1.618;
  --text-line-height-heading: 1.3;

  --text-font-size-mobile-base: 17px;
  --text-font-size-tablet-base: 19px;
  --text-font-size-desktop-base: 20px;

  --button-font-size-mobile: 15px;
  --button-font-size-desktop: 18px;

  --text-paragraph-margin-bottom: 1.4em;
}

/* Base styles */

body {
  font-family: 'Roboto Flex', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-font-size-mobile-base);
  font-weight: 300;
  line-height: var(--text-line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
.glossary-term {
  font-family: 'Roboto Flex', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  line-height: var(--text-line-height-heading);
  padding: 0 20px;
  margin-top: 50px;
  margin-bottom: 10px;
}

/* Elegant Serif Italic for accents */
i,
em {
  font-family: 'Roboto Serif';
  font-style: italic;
  font-weight: 300;
}

/* Visually hidden elements for SEO, screen readers and machine parsers (LLMs)
   These elements are completely invisible to users but remain in the DOM
   for accessibility tools, search engines, and AI assistants to parse */
.site-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h2,
.glossary-term {
  font-size: 26px;
  margin-bottom: 30px;
}

h2>.badge {
  font-weight: 400;
  opacity: 0.3;
}

h2.sub-header {
  font-size: 17px;
  font-weight: 400;
  line-height: var(--text-line-height-base);
  margin-top: 40px;
  margin-bottom: 0;
  opacity: 0.5;
}

h2.sub-header+h2 {
  margin-top: 15px;
}

p {
  padding: 0 var(--layout-left-right-indent);
  margin-bottom: var(--text-paragraph-margin-bottom);
}

strong {
  font-weight: 500;
}

ul {
  list-style: none;
  padding: 0 var(--layout-left-right-indent);
  margin-bottom: 24px;
}

ul>li:last-child {
  padding-bottom: 0;
}

.dashed-list li {
  position: relative;
  left: 0;

  padding-left: 1.2em;
  padding-bottom: 0.25em;
}

.dashed-list li:before {
  content: "\2014\a0\a0";
  position: absolute;
  left: 0;
}

.long-text li {
  padding-bottom: var(--text-paragraph-margin-bottom);
}

blockquote {
  font-weight: 500;
  padding: 0;
  margin: 50px 0 50px 20px;
  border-left: 4px solid var(--color-blockquote-border);
}

blockquote.note>p {
  font-size: .85em;
  font-weight: 300;
  color: var(--color-text);
  border-left-color: transparent;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

/* Forced Link (Explicit text link) */
a.forced-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-forced-link-underline);
  cursor: pointer;
}

a.forced-link:hover {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-text);
}

/* Glossary Links */
.term-link {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dotted rgba(0, 0, 0, 0);
  cursor: help;
  transition: border-bottom-color 0.3s ease;
}

.term-link:hover {
  border-bottom-color: rgba(0, 0, 0, 0.8);
}

/* Images - Breakout effect on desktop */
figure,
.quote-block {
  margin: 40px 0;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-blockquote-border);
  margin: 40px 0;
}

/* Quote block - featured quote with background */
.quote-block {
  background-color: var(--color-background-accent);
  padding: 60px 60px;
  border: none;
}

.quote-block p {
  margin-left: auto;
  margin-right: auto;
  max-width: max-content;
  text-align: left;
}

.quote-block p:last-child {
  margin-bottom: 0;
}


/* Buttons Base Style */
.button {
  display: flex;
  align-items: center;
  font-size: var(--button-font-size-mobile);
  line-height: 1;
  padding: 17px 30px 18px 30px;
  border: 2px solid var(--color-button-outline-border);
  border-radius: 60px;
  cursor: pointer;
  background: transparent;
  color: inherit;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

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

.button .badge {
  align-self: end;
  font-size: 0.8em;
  line-height: 1;
  opacity: 0.5;
  margin-left: 5px;
}

.text-center {
  text-align: center;
}


/* Layout */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
}

/* ================================================ 
  Hero Header Portrait Block
=================================================== */

.hero-header {
  padding: 0;
  margin-bottom: 30px;
  background-color: var(--color-background-dark);
  /* Dark background extending outside on wide screens */
}

.hero-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  /* Constrain image to content width */
  margin: 0 auto;
  /* Center image */
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.hero-icon {
  display: block;
  position: absolute;
  z-index: 10;
  transition: opacity 0.3s ease;
  opacity: 0.3;
}

.hero-icon img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
  /* Force white color */
}

.hero-icon:hover {
  opacity: 1;
}

.hero-contacts {
  position: absolute;
  top: 6.5%;
  right: 9%;
  display: flex;
  flex-direction: column;
  gap: 34px;
  /* Fixed spacing between icons */
  align-items: center;
}

.icon-phone {
  width: 15px;
  position: relative;
}

.icon-telegram {
  width: 22px;
  position: relative;
}

.icon-location {
  width: 17px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.location-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.location-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.9);
}

.location-tooltip.active {
  opacity: 1;
  visibility: visible;
}

.icon-scroll {
  width: 7.5%;
  /* Approx 32px / 430px */
  min-width: 32px;
  left: 50%;
  transform: translateX(-50%);
  bottom: 4%;
  cursor: pointer;
  opacity: 0.3;
}

.icon-scroll:hover {
  opacity: 1;
}

.icon-scroll:active,
.icon-scroll:focus,
.icon-scroll:visited {
  opacity: 0.3;
}






/* ================================================ 
  Footer
=================================================== */

.site-footer {
  padding: 20px 20px 160px 20px;
}

.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity 0.3s ease;
}

.footer-link:hover {
  opacity: 0.8;
}

.footer-location {
  cursor: default;
  gap: 8px;
}

.footer-location:hover {
  opacity: 1;
}

.footer-icon {
  width: 24px;
  height: 24px;
  display: block;
  opacity: 0.4;
  filter: brightness(0);
  /* Force black color */
}

.footer-icon-location {
  width: 27px;
  height: 27px;
}

.footer-echo,
.footer-copyright {
  font-size: 14px;
  opacity: 0.5;
}

.footer-echo {
  margin-bottom: 20px;
}

.footer-copyright {
  margin-top: 60px;
}






/* ================================================ 
  Glossary Page Specifics
=================================================== */

.glossary-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 80px;
}

.glossary-item {
  position: relative;
}

/* Anchor positioning */
.glossary-anchor {
  position: absolute;
  top: -50px;
  visibility: hidden;
}

/* Navigation Back Link */
.back-link {
  display: inline-block;
  padding: 0 20px;
  margin-top: 40px;
  margin-bottom: 40px;
  text-decoration: none;
  color: var(--color-text);
  opacity: 0.5;
  font-size: 14px;
  transition: opacity 0.3s ease;
}

.back-link:hover {
  opacity: 1;
}

.glossary-def {
  margin: 0;
}

/* Site Header */
.sticky-header {
  position: static;
  width: 100%;
  height: auto;
  background-color: var(--color-background);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 0;
}

.sticky-header .container {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.sticky-header__name {
  text-decoration: none;
}

.sticky-header__contacts {
  display: flex;
  align-items: center;
  gap: 24px;
}

.sticky-header__icon {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.sticky-header__icon:hover {
  opacity: 1;
}

.sticky-header__icon img {
  display: block;
  height: auto;
}

.sticky-header__icon--phone img {
  width: 12px;
}

.sticky-header__icon--telegram img {
  width: 18px;
}

.button-back-sticky {
  padding: 10px 24px;
  font-size: 14px;
  gap: 12px;
  border-width: 1px;
}

.button-back-sticky:hover {
  border-color: var(--color-text);
}






/* ================================================ 
  Design Images Gallery
=================================================== */

body.design-route {
  background-color: #fff;
  color: #111;
}

.design-gallery-page {
  min-height: 100vh;
  padding: 30px 0 90px 0;
}

.design-gallery-shell {
  width: 100%;
  margin: 0 auto;
}


.design-folder-nav {
  /* max-width: 680px; */
  margin: 0 auto 48px;
}

ul.design-folder-list {
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  list-style: none;
}

li.design-folder-entry+li.design-folder-entry {
  font-size: var(--button-font-size-desktop);
  margin-top: 24px;
}

a.design-folder-link {
  position: relative;
  display: inline-block;
  padding-left: 50px;
  text-decoration: none;
}

.design-folder-icon {
  position: absolute;
  top: 2px;
  left: 0;
}

.design-folder-icon img {
  display: block;
  width: 39px;
  height: 28px;
}

.design-folder-link--empty .design-folder-icon img {
  filter: grayscale(1);
  opacity: 0.58;
}

.design-folder-intro {
  max-width: 680px;
  margin: 12px 0 0 44px;
}

.design-folder-intro> :first-child {
  margin-top: 0;
}

.design-folder-intro> :last-child {
  margin-bottom: 0;
}

.design-page-intro {
  max-width: 680px;
  margin: 0 auto 60px;
}

.design-page-intro> :first-child {
  margin-top: 0;
}

.design-page-intro> :last-child {
  margin-bottom: 0;
}

.design-gallery-list {
  display: table;
  width: 100%;
  margin-bottom: 0;
  padding-bottom: 0;
  text-align: center;
}

.design-gallery-item {
  margin: 0;
  padding: 0 0 90px;
}

.design-gallery-item:last-child {
  padding-bottom: 0;
}

.design-gallery-item img {
  display: block;
  width: 100%;
  max-width: 1600px;
  height: auto;
  margin: 0 auto;
}

.design-file-link {
  display: flex;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px 0;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #d8d8d8;
  border-bottom: 1px solid #d8d8d8;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.design-file-type {
  flex: 0 0 auto;
  min-width: 58px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.design-file-name {
  overflow-wrap: anywhere;
}

.design-file-link:hover .design-file-name,
.design-file-link:focus-visible .design-file-name {
  text-decoration: underline;
}

.design-image-caption {
  width: min(100%, 680px);
  margin: 0 auto;
  padding-top: 20px;
  text-align: left;
}

.design-image-caption> :first-child {
  margin-top: 0;
}

.design-image-caption> :last-child {
  margin-bottom: 0;
}

.design-gallery-empty {
  max-width: 800px;
  margin: 0 auto;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}






/* ================================================ 
  @media
=================================================== */

/* Mobile styles (default) are above. 
   Tablet and Desktop overrides below. */

/* Tablets and small desktops */
@media (min-width: 481px) {
  .footer-contacts {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 34px;
    align-items: center;
  }

  body {
    font-size: var(--text-font-size-tablet-base);
  }

  h2,
  .glossary-term {
    font-size: 32px;
  }
}

/* Desktop */
@media (min-width: 768px) {
  body {
    font-size: var(--text-font-size-desktop-base);
  }

  h1,
  h2,
  h3,
  .glossary-term {
    margin-top: 60px;
  }

  .button {
    font-size: var(--button-font-size-desktop);
  }

  figure,
  .quote-block {
    margin: 50px 0;
  }

  /* Breakout images */
  .breakout {
    width: 120%;
    margin-left: -10%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .design-gallery-page {
    padding: 24px 16px 56px;
  }

  .design-page-intro {
    margin-bottom: 36px;
  }

  .design-folder-nav {
    margin-bottom: 36px;
  }

  .design-folder-entry+.design-folder-entry {
    margin-top: 20px;
  }

  .design-folder-link {
    font-size: 18px;
  }

  .design-gallery-item {
    padding-bottom: 56px;
  }
}
