/* Geshev Automation – responsive rebuild of the original 2010 design (template 1).
   Desktop reproduces the 984px layout; below 760px the layout collapses to one column. */

:root {
  --red: #ff000a;
  --red-mark: #f20006;
  --link: #b8000a;
  --ink: #000;
  --muted: #545454;
  --page: #a5a5a5;
  --font: Verdana, Geneva, "DejaVu Sans", Tahoma, sans-serif;
  --pad-l: 40px;
  --pad-r: 44px;
}

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

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

body {
  margin: 0;
  background: var(--page) url(../img/page-bg.png) repeat-x 0 0;
  color: var(--ink);
  font: 11px/1.5 var(--font);
}

img, video { max-width: 100%; height: auto; }
img { border: 0; }

a { color: var(--link); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: #fff; color: var(--ink); padding: 8px 12px; font-weight: bold;
}
.skip:focus { top: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.site { max-width: 984px; margin: 0 auto; padding: 30px 0 10px; }

/* ------------------------------------------------------------------ header */
.masthead {
  position: relative;
  height: clamp(84px, 14.74vw, 145px);
  overflow: hidden;
  background: #000;
}
.slides img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: right center;
}
.slides img:nth-child(2) { opacity: 0; animation: slide2 18s linear infinite; }
.slides img:nth-child(3) { opacity: 0; animation: slide3 18s linear infinite; }
@keyframes slide2 {
  0%, 33.33% { opacity: 0; }
  41.67%, 75% { opacity: 1; }
  75.01%, 100% { opacity: 0; }
}
@keyframes slide3 {
  0%, 66.67% { opacity: 0; }
  75%, 91.67% { opacity: 1; }
  100% { opacity: 0; }
}
.logo {
  position: absolute; left: 0.1%; top: 1.4%;
  height: 104.2%;         /* logo artwork is 151px on a 145px stage, as in the Flash original */
  display: block;
}
.logo img { height: 100%; width: auto; max-width: none; display: block; }

/* ------------------------------------------------------------------ menu */
.nav {
  margin-top: 20px;
  border: 1px solid #000;
  border-radius: 4px;
  background: linear-gradient(to bottom,
    #9a1515 0, #c52a2a 5px, #d63838 9px, #e44e4f 13px, #df6365 19px,
    #c70004 19px, #ba0005 24px, #9c0005 30px, #790005 33px, #4f0003 100%);
  box-shadow: inset 14px 0 12px -12px rgba(0,0,0,.45), inset -14px 0 12px -12px rgba(0,0,0,.45);
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.nav li { flex: 1 1 0; }
.nav li + li { border-left: 1px solid rgba(90, 0, 0, .35); }
.nav a {
  display: flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 4px;
  color: #fff; font: bold 15px/1.1 var(--font); text-decoration: none; text-align: center;
}
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; color: #fff; }
.nav a:focus-visible { outline-color: #fff; outline-offset: -4px; }
.nav-toggle { display: none; }

/* ------------------------------------------------------------------ body */
.body {
  margin-top: 20px;
  background: #fff url(../img/drawing.jpg) no-repeat 0 0;
  min-height: 560px;
  display: flow-root;
}
.body.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 237px; min-height: 724px; }
.side { background: #000 url(../img/side.jpg) no-repeat 0 0; }
.side-home { position: relative; }
.side-home::before {         /* decorative red rule from the original right column */
  content: ""; position: absolute; left: 10px; top: 79px;
  width: 220px; height: 3px;
  background: linear-gradient(to right, #e10009, #890005 45%, #1f0001);
}

.content { padding: 60px var(--pad-r) 50px var(--pad-l); min-width: 0; }
.with-side .content { padding-left: 42px; padding-right: 0; }

/* heading + red rule (cherta.gif) */
.rule {
  margin: 0 0 12px;
  font-size: 13px; font-weight: bold; line-height: 1.35;
}
.rule::after {
  content: ""; display: block; margin-top: 3px; height: 4px;
  background: linear-gradient(to bottom, #fe1d26 0, #ff000a 25%, #ff000a 75%, #fc484f 100%);
}
.with-side .rule::after { margin-right: 5px; }
.rule-thin::after { height: 2px; }
.rule .sub { display: block; }

.text { font-size: 13px; line-height: 1.55; }
.text p { margin: 0 0 1.1em; }
.text ul, .text ol { margin: 0 0 1.1em; padding-left: 1.6em; }
.text li { margin-bottom: .35em; }
.page-activity .text, .page-partners .text > p:first-child { text-align: justify; hyphens: auto; }

/* square red bullets (to4ka.gif) */
.dots ul { list-style: none; padding: 0; }
.dots li { position: relative; padding-left: 16px; }
.dots li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 9px; height: 9px; border: 2px solid var(--red-mark);
}

/* ------------------------------------------------------------------ home */
.home-title { font-size: 15px; }
.welcome {
  display: grid; grid-template-columns: 370fr 285fr; column-gap: 40px;
  margin: 40px 0 0 10px;
}
.welcome-text { font-size: 13px; line-height: 1.55; }
.welcome-text p { margin: 0 0 1.1em; }
.welcome-points { font-size: 12px; line-height: 1.5; }
.welcome-points ul { margin: 0; }
.welcome-points li { margin-bottom: 1.1em; }

.featured { margin-top: 28px; }
.featured h2 { font-size: 15px; padding-left: 10px; }
.featured h2 a, .feature h3 a, .project-list h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover, .feature h3 a:hover, .project-list h2 a:hover { text-decoration: underline; }
.featured-note { font-size: 12px; margin: 6px 0 0 10px; }
.featured-note a { color: var(--ink); font-weight: bold; text-decoration: none; }
.featured-note a:hover { text-decoration: underline; }
.feature { margin: 34px 0 0 10px; }
.feature h3 { font-size: 12px; line-height: 1.45; margin: 0 0 14px; }
.feature-media { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 40px; }
.feature-image img { display: block; height: 242px; width: auto; }
.feature-media .video { margin: 0; width: 320px; max-width: 100%; }

/* ------------------------------------------------------------------ media */
.video, .anim { margin: 1.5em auto; }
.video { max-width: 320px; }
.video.wide { max-width: 450px; }
.anim { max-width: 240px; }
.video video, .anim video { display: block; width: 100%; height: auto; background: #000; }
.anim video { background: #fff; }
.media-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 20px 30px; margin: 1.5em 0;
}
.media-row > figure, .media-row > p { margin: 0; }
.media-row .video { flex: 0 1 320px; }
.media-row .anim { flex: 0 1 240px; }

img.figure-center, img.figure-wide { display: block; margin: 1.5em auto; }
img.figure-left { float: left; margin: 6px 25px 15px 0; }
.project-text::after { content: ""; display: table; clear: both; }
.project-text p:has(> img.figure-center), .project-text p:has(> img.figure-wide) { margin: 0; }

.gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 1.5em 0; clear: both; }
.gallery p { display: contents; }
.gallery img { display: block; height: 205px; width: auto; }

.formula { font-family: "Times New Roman", Times, serif; font-size: 16px; font-style: italic; padding-left: 2em; }

/* ------------------------------------------------------------------ projects list */
.intro { font-size: 12px; }
.project-list { list-style: none; margin: 30px 0 0; padding: 0; }
.project-item {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 10px;
  margin-bottom: 30px;
}
.project-thumb img { display: block; width: 250px; height: auto; }
.project-summary { font-size: 12px; line-height: 1.5; }
.project-summary h2 { font-size: 12px; margin: 0 0 12px; line-height: 1.45; }
.project-summary h2 .sub { font-weight: bold; }
.project-summary p { margin: 0 0 .8em; }
.project-summary ul, .project-summary ol { margin: 0 0 .8em; padding-left: 1.5em; }
.more { color: var(--ink); font-weight: bold; }

.project-title { line-height: 1.45; }
.project-text { font-size: 12px; }
.project-text h2 { color: #f00; font-size: 16px; font-weight: bold; margin: 1.6em 0 .55em; line-height: 1.3; }
.project-text > h2:first-child, .project-text > p:first-child + h2 { margin-top: .6em; }
.project-text .accent { color: #f00; }

/* ------------------------------------------------------------------ partners */
.partner {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 10px;
  margin: 34px 0; align-items: start;
}
.partner > p { grid-column: 2; margin: 0 0 .9em; }
.partner > p:first-child { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
.partner-logo img { display: block; width: 125px; height: auto; }

/* ------------------------------------------------------------------ contacts */
.contact {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); column-gap: 128px;
  padding-left: 20px; min-height: 420px;
}
.contact > p:first-child { margin: 0; }
.contact-photo { display: block; width: 272px; height: auto; }
.contact-data p { margin: 0 0 .5em; }
.contact-data p strong { display: inline-block; margin-top: 1em; }
.contact-data p:first-child strong { margin-top: 0; }
.contact-data a { color: var(--ink); text-decoration: none; }
.contact-data a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ footer */
.footer {
  margin-top: 0;
  min-height: 170px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px;
  padding: 40px 40px 22px;
  color: #fff;
  background: linear-gradient(to bottom, #ac0209 0, #a40007 3px, #890003 5px, #680001 8px, #3e0000 10px, #3b0000 12px, #000 13px);
}
.copyright { margin: 0; font-size: 11px; }
.credit img { display: block; }

/* ------------------------------------------------------------------ tablet */
@media (max-width: 1000px) {
  .site { padding-top: 16px; }
  .body.with-side { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .side { display: none; }
  .with-side .content { padding-right: var(--pad-r); }
  .with-side .rule::after { margin-right: 0; }
  .welcome { column-gap: 28px; }
  .contact { column-gap: 48px; }
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 760px) {
  :root { --pad-l: 18px; --pad-r: 18px; }
  body { font-size: 13px; }
  .site { padding: 0; }

  .nav { margin-top: 0; border-radius: 0; border-width: 1px 0; }
  .nav-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
    padding: 0 18px; border: 0; background: none; cursor: pointer;
    color: #fff; font: bold 15px var(--font);
  }
  .nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
    display: block; width: 20px; height: 2px; background: #fff; position: relative;
  }
  .nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-icon::before { top: -6px; }
  .nav-toggle-icon::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }
  .js .nav ul { display: none; }
  .js .nav.open ul { display: flex; }
  .nav ul { flex-direction: column; background: linear-gradient(#b60005, #6a0004); }
  .nav li + li { border-left: 0; border-top: 1px solid rgba(0, 0, 0, .25); }
  .nav a { justify-content: flex-start; min-height: 44px; padding: 0 18px; }

  .body { margin-top: 0; min-height: 0; background-size: 760px auto; }
  .body.with-side { display: block; min-height: 0; }
  .side { display: none; }
  .content, .with-side .content { padding: 28px var(--pad-r) 36px var(--pad-l); }
  .with-side .rule::after { margin-right: 0; }

  .rule { font-size: 16px; }
  .project-text { font-size: 15px; }
  .project-text h2 { font-size: 19px; }
  .home-title, .featured h2 { font-size: 17px; }
  .text, .welcome-text { font-size: 15px; line-height: 1.6; }
  .page-activity .text, .page-partners .text > p:first-child { text-align: left; }

  .welcome { grid-template-columns: 1fr; margin: 24px 0 0; row-gap: 12px; }
  .welcome-points { font-size: 14px; }
  .featured h2 { padding-left: 0; }
  .featured-note, .feature { margin-left: 0; }
  .featured-note { font-size: 14px; }
  .feature h3 { font-size: 14px; }
  .feature-media { gap: 16px; }
  .feature-image img { height: auto; max-height: 300px; }

  img.figure-left { float: none; display: block; margin: 1em auto; }
  .gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery img { height: auto; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

  .project-item { grid-template-columns: 1fr; row-gap: 12px; }
  .project-thumb img { width: auto; max-width: 100%; max-height: 240px; }
  .project-summary, .intro { font-size: 14px; }
  .project-summary h2 { font-size: 15px; }

  .partner { grid-template-columns: 84px minmax(0, 1fr); margin: 26px 0; }
  .partner-logo img { width: 80px; }
  .partner > p:first-child { grid-row: 1 / span 1; }
  .partner > p:not(:first-child):not(:nth-child(2)) { grid-column: 1 / -1; margin-top: .6em; }

  .contact { grid-template-columns: 1fr; padding-left: 0; row-gap: 24px; min-height: 0; }
  .contact-photo { width: 100%; max-width: 272px; }

  .footer { min-height: 0; padding: 28px 18px 20px; }

}

@media (max-width: 340px) {
  .gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .slides img:nth-child(2), .slides img:nth-child(3) { animation: none; opacity: 0; }
}

@media print {
  body { background: #fff; }
  .nav, .masthead .slides, .side, .footer .credit { display: none; }
  .masthead { height: auto; background: none; }
  .logo { position: static; height: 80px; }
  .body { background: none; }
}
