/* A quieter, editorial layout for both IT-Code pages. */
:root { --editorial-space: clamp(72px, 8vw, 118px); }

/* Keep sections distinct through spacing, not panels. */
.section, .hero { border-bottom: 0; }
.section { padding-block: var(--editorial-space); }
.section-muted, .portfolio-section, .result, #contact { background: transparent; }
.section + .section { position: relative; }
.section + .section::before { content: ""; position: absolute; top: 0; left: max(24px, calc((100% - var(--max)) / 2)); right: max(24px, calc((100% - var(--max)) / 2)); border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(32px, 4vw, 56px); }
.section-head h2, .about-copy h2, .faq-grid h2 { max-width: 780px; }
.hero-note { padding: 8px 0 8px 24px; background: transparent; border: 0; border-left: 2px solid var(--accent); }
.note-meta { border: 0; padding-top: 0; }

/* Websites: lead with one full-size project, then vary the rhythm. */
.portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(42px, 6vw, 80px) clamp(22px, 3vw, 44px); }
.portfolio-card { display: block; overflow: visible; border: 0; background: transparent; transition: none; }
.portfolio-card:hover { border: 0; transform: none; }
.portfolio-shot { border: 0; aspect-ratio: 16 / 10; }
.portfolio-shot::after { display: none; }
.portfolio-shot img { transition: transform .45s ease; }
.portfolio-card:hover .portfolio-shot img { transform: scale(1.035); }
.portfolio-body { min-height: 0; padding: 18px 0 0; }
.portfolio-meta { justify-content: flex-start; gap: 20px; margin-bottom: 11px; }
.portfolio-meta span:last-child { text-align: left; }
.portfolio-body h3 { font-size: clamp(24px, 2.5vw, 36px); margin-bottom: 8px; }
.portfolio-body p { max-width: 580px; margin-bottom: 11px; }
.portfolio-domain { border: 0; margin-top: 0; padding-top: 0; }
.portfolio-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); align-items: end; gap: clamp(24px, 4vw, 60px); }
.portfolio-card:first-child .portfolio-shot { aspect-ratio: 16 / 9; }
.portfolio-card:first-child .portfolio-body { padding: 0 0 12px; }
.portfolio-card:first-child .portfolio-body h3 { font-size: clamp(32px, 4vw, 56px); }
.portfolio-card.is-unavailable .portfolio-shot { opacity: .6; }
.portfolio-open { border: 0; box-shadow: 0 4px 20px #0003; }

/* Unity work is a sequence of projects rather than a wall of cards. */
.cases { display: block; }
.case, .cases.all .case-hidden { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); align-items: center; gap: clamp(26px, 5vw, 80px); border: 0; background: transparent; overflow: visible; padding: 0 0 clamp(44px, 6vw, 80px); }
.case + .case { border-top: 1px solid var(--line); padding-top: clamp(44px, 6vw, 80px); }
.case:nth-child(even) .case-media { order: 2; }
.case-hidden { display: none; }
.case-media { aspect-ratio: 16 / 9; background: var(--panel2); }
.case-body { padding: 0; }
.case-kind { margin-bottom: 16px; }
.case h3 { font-size: clamp(27px, 3vw, 42px); letter-spacing: -.035em; line-height: 1.12; }
.case p:last-child { max-width: 450px; font-size: 17px; }
.portfolio-more { margin-top: 0; text-align: left; }
.portfolio-more .btn { border: 0; border-bottom: 1px solid var(--accent); border-radius: 0; padding: 8px 0; min-height: 0; }

/* Services and process read like a studio's working notes. */
.offer-grid { display: block; border: 0; background: transparent; }
.offer { display: grid; grid-template-columns: 70px minmax(210px, .65fr) minmax(0, 1fr); align-items: baseline; gap: clamp(14px, 3vw, 40px); min-height: 0; padding: 26px 0; border-bottom: 1px solid var(--line); background: transparent; }
.offer:first-child { border-top: 1px solid var(--line); }
.offer h3 { margin: 0; font-size: clamp(23px, 2.5vw, 32px); }
.offer p { max-width: 620px; }
.process-grid, .steps { border: 0; gap: clamp(18px, 3vw, 42px); }
.process-grid li, .steps li, .steps li:first-child { border: 0; border-top: 1px solid var(--line); min-height: 0; padding: 22px 0 0; }
.process-grid li + li, .steps li + li { border-left: 0; padding-left: 0; }
.process-grid h3, .steps h3 { margin: 40px 0 8px; }
.price-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border: 0; background: transparent; }
.price-strip > div { background: transparent; border-top: 1px solid var(--line); padding: 18px 0; }
.price-strip > p { background: transparent; padding: 0; }
.result-card { border: 0; border-left: 2px solid var(--accent); background: transparent; padding: 8px 0 8px clamp(24px, 3vw, 42px); }
.result-card strong { font-size: clamp(30px, 3vw, 43px); }

/* Let the contact form sit in the page instead of inside another box. */
.contact-form, .contact-grid .form, .form { border: 0; border-radius: 0; background: transparent; padding: 0; }
.form-row input, .form-row textarea, .field input, .field textarea { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 12px 0; }
.form-row input:focus, .form-row textarea:focus, .field input:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.direct { grid-template-columns: 1fr; }
.direct a { padding: 14px 0; }

/* The homepage also has an embedded Unity portfolio. */
.unity-grid { gap: clamp(30px, 4vw, 54px) !important; }
.unity-card { border: 0 !important; background: transparent !important; }
.unity-media { background: transparent !important; }
.unity-copy { padding: 18px 0 0 !important; }
.unity-copy h3 { margin: 8px 0 !important; }

@media (max-width: 920px) {
  .portfolio-card:first-child { grid-template-columns: 1fr; gap: 0; }
  .portfolio-card:first-child .portfolio-body { padding: 18px 0 0; }
  .case, .cases.all .case-hidden { grid-template-columns: 1fr; gap: 17px; }
  .case:nth-child(even) .case-media { order: 0; }
  .offer { grid-template-columns: 45px minmax(0, 1fr); gap: 12px 18px; }
  .offer p { grid-column: 2; }
  .price-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  :root { --editorial-space: 66px; }
  .section + .section::before { left: 16px; right: 16px; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 48px; }
  .portfolio-card:first-child { grid-column: auto; }
  .portfolio-card:first-child .portfolio-body h3 { font-size: 32px; }
  .portfolio-body { padding-top: 14px; }
  .portfolio-meta { margin-bottom: 8px; }
  .case, .cases.all .case-hidden { padding-bottom: 44px; }
  .case + .case { padding-top: 44px; }
  .case h3 { font-size: 29px; }
  .case p:last-child { font-size: 16px; }
  .offer { padding: 22px 0; }
  .offer h3 { font-size: 23px; }
  .process-grid, .steps { gap: 0; }
  .process-grid li, .process-grid li + li, .steps li, .steps li:first-child, .steps li + li { border: 0; border-top: 1px solid var(--line); padding: 18px 0 26px; }
  .process-grid h3, .steps h3 { margin-top: 12px; }
  .price-strip { grid-template-columns: 1fr; gap: 0; }
  .result-card { padding-left: 22px; }
  .contact-grid .form, .form, .contact-form { padding: 0; }
}

/* Focused refinements: keep the existing type, palette and page structure. */
@media (min-width: 921px) {
  /* The header already contains these destinations. Keep the theme control. */
  .ic-quick-nav {
    left: auto !important;
    right: 20px !important;
    bottom: 20px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .ic-quick-nav a { display: none !important; }
  .ic-quick-nav button[data-theme-toggle] {
    width: 42px !important;
    height: 42px !important;
    background: var(--bg) !important;
    border: 1px solid var(--line) !important;
  }
  .portfolio-card:nth-child(2n + 3) { margin-top: 44px; }
  #unity .unity-card:nth-child(even) { margin-top: 48px; }
}

/* Let the work itself be the link affordance, without a floating badge. */
.portfolio-open { display: none !important; }
.portfolio-shot, .case-media, .unity-media { border-radius: 0 !important; }
.portfolio-card:focus-visible .portfolio-shot,
.case-media:focus-visible,
.unity-media a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.portfolio-card:hover .portfolio-shot img,
.unity-card:hover .unity-media img { transform: scale(1.02) !important; }
.portfolio-card:hover, .case:hover, .unity-card:hover, .offer:hover {
  transform: none !important;
  box-shadow: none !important;
}
.portfolio-domain { display: inline-block; border-bottom: 1px solid var(--accent); padding-bottom: 3px; }

/* Repeated service photos share one quiet crop and align with their text. */
.service-row img, .service-row.featured img {
  border-radius: 0;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.service-row:hover { transform: none !important; box-shadow: none !important; }

/* Interactive pieces sit in the page rather than another rounded panel. */
.ic-stage {
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
}
.ic-page-banner {
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 20px 0 !important;
  box-shadow: none !important;
}
.ic-game-stage .ic-game-hud { padding-inline: 0; }

@media (max-width: 920px) {
  .portfolio-card:nth-child(2n + 3),
  #unity .unity-card:nth-child(even) { margin-top: 0; }
  .ic-page-banner { align-items: flex-start; }
}
@media (max-width: 700px) {
  .ic-quick-nav { max-width: calc(100% - 24px); }
  .ic-quick-nav a { font-size: 11px; }
  .ic-stage canvas { height: min(380px, 70vh); }
}

/* Unity: clearer affordances without changing the site's visual language. */
.hero-note a { color: var(--ink); border-bottom: 1px solid var(--accent); }
.hero-note a:hover { color: var(--accent); }
.contact-help { margin: -6px 0 16px; color: #ee9b8f; font-size: 13px; }
.contact-help[hidden] { display: none; }
#portfolio .case-media { position: relative; cursor: zoom-in; }
#portfolio .case-media:focus-visible,
#showAll:focus-visible,
.faq-list summary:focus-visible,
.hero-note a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
#portfolio .case-media--editor img {
  width: var(--unity-crop-width);
  max-width: none;
  height: auto;
  object-fit: initial;
  transform: translateX(var(--unity-crop-x));
  transform-origin: top left;
}
#portfolio .case:hover .case-media--editor img {
  transform: translateX(var(--unity-crop-x)) scale(1.015);
}
#portfolio .case-media--car { --unity-crop-width: 140%; --unity-crop-x: -15%; }
#portfolio .case-media--garden { --unity-crop-width: 160%; --unity-crop-x: 0%; }
#portfolio .case-media::after {
  content: "Увеличить ↗";
  position: absolute;
  right: 15px;
  bottom: 15px;
  padding: 7px 10px;
  color: #f4f2ed;
  background: #0d0f12dd;
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  transition: opacity .2s ease;
}
#portfolio .case-media:hover::after,
#portfolio .case-media:focus-visible::after { opacity: 1; }
.unity-lightbox {
  width: min(1200px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}
.unity-lightbox::backdrop { background: #030508e8; backdrop-filter: blur(8px); }
.unity-lightbox figure { margin: 0; }
.unity-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 155px);
  object-fit: contain;
  background: #080a0e;
}
.unity-lightbox-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
}
.unity-lightbox-caption { min-width: 0; margin-right: auto; }
.unity-lightbox-caption strong { display: block; color: var(--ink); font-size: 17px; line-height: 1.3; }
.unity-lightbox-caption span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.unity-lightbox-controls { display: flex; align-items: center; gap: 7px; flex: none; }
.unity-lightbox-count { color: var(--muted); font-size: 12px; min-width: 39px; text-align: center; }
.unity-lightbox button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}
.unity-lightbox button:hover { border-color: var(--accent); color: var(--accent); }
.unity-lightbox button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.unity-lightbox-close { font-size: 25px !important; }
@media (max-width: 700px) {
  #portfolio .case-media::after { opacity: 1; right: 10px; bottom: 10px; }
  .unity-lightbox { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .unity-lightbox img { max-height: calc(100dvh - 140px); }
  .unity-lightbox-bar { display: grid; grid-template-columns: 1fr; padding: 11px 12px; gap: 12px; }
  .unity-lightbox-caption { margin-right: 0; }
  .unity-lightbox-caption strong { font-size: 14px; }
  .unity-lightbox-controls { width: 100%; justify-content: space-between; }
  .unity-lightbox-count { flex: 1; }
  .unity-lightbox button { width: 38px; height: 38px; }
  #ic-lab .ic-controls { padding-bottom: 60px; }
  .ic-quick-nav { transition: opacity .2s ease, transform .2s ease; }
  body.ic-unity-controls-visible .ic-quick-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
  }
}
@media (max-width: 390px) {
  .head .head-in { gap: 6px !important; }
  .head .brand { font-size: 17px; }
  .head .ic-switch { gap: 1px; padding: 3px; margin-left: auto; }
  .head .ic-switch a { padding: 7px 7px !important; font-size: 11px !important; }
  .head .ic-switch a[href="/unity/"] { font-size: 0 !important; }
  .head .ic-switch a[href="/unity/"]::after { content: "Unity"; font-size: 11px; }
  .head .menu { flex: none; margin-left: 0; padding: 6px 8px; font-size: 11px; }
}
