/* Mobile layer. Text and UI are code; raster is used only for photography.
   Loaded after styles.css, so equal-specificity rules here win. */

:root {
  --font-display: Arial, Helvetica, sans-serif;
  --font-text: Arial, Helvetica, sans-serif;
  --m-gutter: 18px;
  --m-radius: 15px;
  --m-line: #2b2f35;
  --m-card: linear-gradient(158deg, #15181c 0%, #0a0c0e 100%);
}

.m-block { display: none; }
.quiz-note { display: none; }

@media (max-width: 760px) {
  /* ---------- shared mobile primitives ---------- */
  .m-block {
    display: block;
    width: calc(100% - var(--m-gutter) * 2);
    max-width: 560px;
    margin: 0 auto;
    padding: 54px 0 50px;
    text-align: center;
  }
  .m-kicker {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 0 0 22px; color: var(--accent);
    font-family: var(--font-display);
    font-size: clamp(13px, 3.9vw, 17px); font-weight: 700; line-height: 1.2;
    letter-spacing: .5px; text-transform: uppercase;
  }
  .m-title {
    margin: 0 auto;
    font-family: var(--font-display);
    font-size: clamp(23px, 6vw, 30px); font-weight: 700;
    line-height: 1.12; letter-spacing: -.2px; text-transform: uppercase;
  }
  .m-title .accent { color: var(--accent); }
  .m-lead {
    margin: 18px auto 26px; max-width: 460px; color: #c4c6c9;
    font-size: clamp(15px, 4.1vw, 18px); line-height: 1.5;
  }
  .m-card {
    position: relative;
    border: 1px solid var(--m-line); border-radius: var(--m-radius);
    background: var(--m-card); text-align: left;
  }

  /* circular outlined icon badge */
  .m-ico {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 54px; height: 54px;
    border: 1px solid #33383e; border-radius: 50%;
    color: var(--accent); background: rgba(9, 11, 13, .9);
  }
  .m-ico svg { width: 26px; height: 26px; }
  .m-ico--blue { color: var(--blue); }
  .m-ico--sm { width: 44px; height: 44px; }
  .m-ico--sm svg { width: 22px; height: 22px; }
  svg.m-glyph { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  /* ---------- 05 · specialization ---------- */
  #services .mobile-services { padding-bottom: 50px; }
  .mobile-niche {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    aspect-ratio: 3 / 2; min-height: 215px;
    padding: 20px 18px;
    border: 1px solid #3a3f45; border-radius: var(--m-radius);
    background-image: none; background-color: #0a0c0e;
  }
  .mobile-niche__photo {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: center 62%;
  }
  .mobile-niche__shade {
    z-index: 1;
    background:
      linear-gradient(180deg, rgba(4,5,6,.94) 0%, rgba(4,5,6,.62) 34%, rgba(4,5,6,.12) 62%, rgba(4,5,6,.55) 100%),
      linear-gradient(100deg, rgba(4,5,6,.72) 0%, rgba(4,5,6,.1) 58%);
  }
  .mobile-niche__number { font-size: clamp(15px, 4.4vw, 19px); }
  .mobile-niche strong { margin-top: 10px; font-family: var(--font-display); }
  .mobile-niche__arrow {
    right: 18px; top: 18px; width: 48px; height: 48px;
    border-color: #7b8086; background: rgba(8, 10, 12, .55);
    font-size: 30px;
  }
  .mobile-niche__tags {
    left: 18px; bottom: 16px; max-width: calc(100% - 36px);
    padding: 10px 14px; border-radius: 9px;
    border-color: #4a4f55; background: rgba(9, 11, 13, .88);
    font-size: clamp(10px, 3vw, 13px); letter-spacing: .3px;
  }

  /* ---------- 07 · launch timeline ---------- */
  #steps > .responsive-copy { display: none; }
  #steps .m-block { display: block; }

  .m-timeline { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
  .m-tl-item { position: relative; display: grid; grid-template-columns: 34px 1fr; align-items: stretch; gap: 14px; }
  .m-tl-rail { position: relative; display: block; }
  .m-tl-rail::before {
    content: ""; position: absolute; left: 50%; top: 13px;
    width: 15px; height: 15px; border-radius: 50%;
    background: #ffd9c9; box-shadow: 0 0 0 4px rgba(255, 75, 31, .28), 0 0 16px 3px rgba(255, 75, 31, .75);
    transform: translateX(-50%);
  }
  .m-tl-rail::after {
    content: ""; position: absolute; left: 50%; top: 34px; bottom: -14px;
    width: 2px; background: linear-gradient(to bottom, var(--accent), rgba(255, 75, 31, .35));
    transform: translateX(-50%);
  }
  .m-tl-item:last-child .m-tl-rail::after { bottom: 10px; }
  .m-tl-arrow {
    position: absolute; left: 50%; bottom: -14px; z-index: 2;
    width: 0; height: 0; border-inline: 5px solid transparent;
    border-top: 8px solid var(--accent); transform: translateX(-50%);
  }
  .m-tl-item:last-child .m-tl-arrow { bottom: 4px; }
  .m-tl-item--next .m-tl-rail::before { background: #cfe2ff; box-shadow: 0 0 0 4px rgba(40, 125, 255, .26), 0 0 16px 3px rgba(40, 125, 255, .7); }
  .m-tl-item--next .m-tl-rail::after { background: linear-gradient(to bottom, var(--blue), rgba(40, 125, 255, .35)); }
  .m-tl-item--next .m-tl-arrow { border-top-color: var(--blue); }

  .m-tl-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 18px 18px 20px; }
  .m-tl-card > div { min-width: 0; }
  .m-tl-day { margin: 0 0 6px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 1px; }
  .m-tl-item--next .m-tl-day { color: var(--blue); }
  .m-tl-card h3 { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 5.4vw, 26px); font-weight: 700; line-height: 1.1; text-transform: uppercase; }
  .m-tl-card p { margin: 8px 0 0; color: #b9bcc1; font-size: clamp(14px, 3.9vw, 16px); line-height: 1.4; }
  .m-tl-card .m-ico { border-color: #3a3f45; background: rgba(255, 255, 255, .03); }

  .m-steps-note {
    display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 16px;
    margin-top: 14px; padding: 20px 16px;
  }
  .m-steps-note > span { display: grid; gap: 10px; justify-items: center; color: #c8cacd; font-size: clamp(12px, 3.4vw, 14px); line-height: 1.35; text-align: center; }
  .m-steps-note > span svg { width: 30px; height: 30px; color: var(--accent); }
  .m-steps-note i { display: block; width: 1px; height: 100%; min-height: 54px; background: #2b2f35; }

  /* ---------- 06 · full management wheel ---------- */
  #management > .responsive-copy { display: none; }

  .m-wheel { position: relative; width: 100%; aspect-ratio: 1 / 1; margin: 6px 0 4px; }
  .m-wheel__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
  .m-wheel__ray { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .85; }
  .m-wheel__ring { fill: none; stroke: var(--accent); stroke-width: 2.4; filter: drop-shadow(0 0 7px rgba(255, 90, 35, .85)); }
  .m-wheel__ring--faint { stroke: rgba(255, 90, 35, .16); stroke-width: 1; stroke-dasharray: 3 6; filter: none; }
  .m-wheel__dot { fill: #ffe2d6; filter: drop-shadow(0 0 5px rgba(255, 90, 35, .95)); }
  .m-wheel__core {
    position: absolute; left: 50%; top: 50%; z-index: 2;
    display: grid; place-items: center;
    width: 41%; aspect-ratio: 1 / 1; border-radius: 50%;
    color: #fff; font-family: var(--font-display);
    font-size: clamp(24px, 7.4vw, 36px); font-weight: 700; letter-spacing: 1px;
    text-shadow: 0 0 18px rgba(255, 110, 50, .55);
    transform: translate(-50%, -50%);
  }
  .m-wheel__node {
    position: absolute; z-index: 3;
    width: 33%; padding: 10px 8px;
    border: 1px solid rgba(255, 90, 35, .62); border-radius: 11px;
    background: rgba(6, 7, 9, .93);
    box-shadow: 0 0 16px rgba(255, 75, 31, .16);
    text-align: center;
  }
  .m-wheel__node b { display: block; color: var(--accent); font-family: var(--font-display); font-size: clamp(17px, 5vw, 22px); font-weight: 700; line-height: 1; }
  .m-wheel__node span { display: block; margin-top: 6px; color: #eceef0; font-size: clamp(9px, 2.7vw, 12px); font-weight: 600; line-height: 1.25; text-transform: uppercase; }
  .m-wheel__node--1 { left: 50%; top: 0; transform: translateX(-50%); }
  .m-wheel__node--2 { right: 0; top: 20%; }
  .m-wheel__node--3 { right: 0; bottom: 20%; }
  .m-wheel__node--4 { left: 50%; bottom: 0; transform: translateX(-50%); }
  .m-wheel__node--5 { left: 0; bottom: 20%; }
  .m-wheel__node--6 { left: 0; top: 20%; }

  .m-wheel-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    width: 100%; min-height: 62px; margin-top: 20px; padding: 0 20px;
    border: 1px solid #3f8fff; border-radius: 10px;
    color: #fff; background: rgba(9, 21, 44, .9);
    box-shadow: 0 0 22px rgba(40, 125, 255, .26), inset 0 0 26px rgba(40, 125, 255, .1);
    font-family: var(--font-display); font-size: clamp(14px, 4.1vw, 18px); font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase; cursor: pointer;
  }
  .m-wheel-cta svg { flex: 0 0 auto; width: 26px; height: 26px; color: #6aa8ff; }
  .m-note {
    display: flex; align-items: center; gap: 14px;
    margin-top: 12px; padding: 16px;
    color: #c8cacd; font-size: clamp(13px, 3.7vw, 16px); line-height: 1.4;
  }

  /* ---------- 07 · quiz ---------- */
  .quiz-intro { text-align: center; }
  .quiz-intro .section-label { margin: 0 0 14px; text-align: center; font-size: clamp(13px, 3.9vw, 17px); }
  .quiz-intro h2 {
    margin: 0 auto; max-width: 320px; text-align: center;
    font-size: clamp(23px, 6vw, 30px); line-height: 1.12; letter-spacing: -.2px;
  }
  .quiz-intro > p:not(.section-label) {
    max-width: 460px; margin: 18px auto 26px; text-align: center;
    font-size: clamp(15px, 4.1vw, 18px); line-height: 1.5;
  }
  .quiz-benefit { justify-content: center; }

  .quiz-card {
    border-color: rgba(255, 90, 35, .55);
    border-radius: var(--m-radius);
    box-shadow: 0 0 0 1px rgba(255, 90, 35, .12), 0 0 34px rgba(255, 75, 31, .16), inset 0 0 40px rgba(255, 75, 31, .05);
  }
  .quiz-back { border-radius: 9px; }
  .quiz-controls .primary-button {
    border-radius: 9px;
    box-shadow: 0 0 18px rgba(255, 75, 31, .3);
  }
  .quiz-step > input, .quiz-fields input { border-radius: 8px; }

  .quiz-note {
    display: flex; align-items: center; gap: 14px;
    width: calc(100% - var(--m-gutter) * 2);
    max-width: 560px;
    margin: 16px auto 0; padding: 16px;
    color: #c8cacd; font-size: clamp(13px, 3.7vw, 16px); line-height: 1.4;
  }

  /* ---------- 08 · AI manager ---------- */
  #ai-manager > .responsive-copy--ai { display: none; }
  #ai-manager .m-block--ai { padding-bottom: 30px; }

  .m-chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 24px; }
  .m-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; border: 1px solid var(--m-line); border-radius: 999px;
    background: var(--m-card); color: #eceef0; font-size: clamp(13px, 3.6vw, 15px); font-weight: 600;
  }
  .m-chip b { color: var(--accent); font-weight: 700; }

  /* Neutralize the desktop container-query stage: it collapses to 0 height
     on mobile (container-type: size with no explicit height) and clips the
     chat panel entirely, so give it normal block flow instead. */
  #ai-manager .screen-stage {
    container-type: normal;
    overflow: visible;
    height: auto;
    min-height: 0;
  }
  #ai-manager .ai-chat-panel {
    position: relative; left: auto; top: auto;
    display: grid; grid-template-rows: none; align-content: start;
    gap: 10px;
    width: calc(100% - var(--m-gutter) * 2);
    max-width: 560px;
    height: auto; min-height: 0;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid rgba(255, 90, 35, .38);
    border-radius: var(--m-radius);
    background: var(--m-card);
    box-shadow: 0 0 30px rgba(255, 75, 31, .14);
  }
  #ai-manager .ai-message {
    min-height: 0;
    padding: 12px 46px 12px 13px;
    border-radius: 8px;
    font-size: 13px;
  }
  #ai-manager .ai-message time { right: 10px; top: 11px; font-size: 10px; }
  #ai-manager .ai-chat-input { height: 48px; padding-left: 13px; border-radius: 8px; font-size: 13px; }
  #ai-manager .ai-chat-input button { width: 32px; height: 32px; margin-right: 6px; }
  /* ---------- 09 · responsibility ---------- */
  #responsibility > .responsive-copy { display: none; }
  #responsibility .m-block--responsibility { padding-top: 0; }

  /* Real silhouette cutout (background removed with a human-segmentation
     model, same idea as the hero's mobile portrait) instead of a rectangular
     crop with a soft-fade box — the edge follows Dmitry's actual outline,
     so it reads as "cut out" rather than a blurry rectangle. Sized like the
     hero's mobile photo: inset, not full-bleed. */
  .m-resp-photo {
    position: relative;
    width: min(78vw, 320px);
    margin: 0 auto 26px;
    aspect-ratio: 1 / 1;
  }
  .m-resp-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }

  .m-fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; text-align: left; }
  .m-fact {
    position: relative;
    padding: 18px 16px 16px;
    border: 1px solid var(--m-line); border-radius: var(--m-radius);
    background: var(--m-card);
  }
  .m-fact .m-ico { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; }
  .m-fact .m-ico svg { width: 19px; height: 19px; }
  .m-fact strong { display: block; max-width: calc(100% - 44px); font-family: var(--font-display); font-size: clamp(18px, 5vw, 22px); font-weight: 700; text-transform: uppercase; }
  .m-fact small { display: block; margin-top: 10px; color: #b9bcc1; font-size: clamp(12px, 3.4vw, 14px); line-height: 1.35; }

  .m-quote {
    margin: 22px 0 0; padding: 18px 20px;
    border: 1px solid rgba(255, 90, 35, .55); border-radius: var(--m-radius);
    box-shadow: 0 0 24px rgba(255, 75, 31, .14);
    color: var(--accent); font-weight: 700; font-size: clamp(14px, 4vw, 16px); line-height: 1.4; text-align: center;
  }
  .m-signature {
    margin: 20px 0 0; color: #f3f1ed;
    font-family: "Segoe Script", "Brush Script MT", cursive; font-size: clamp(24px, 7vw, 30px); font-weight: 400;
  }
  /* ---------- 10 · contacts ---------- */
  #contacts .contact-responsive-copy { display: none; }
  #contacts .footer-brand,
  #contacts .footer-cases, #contacts .footer-services,
  #contacts .footer-steps, #contacts .footer-contacts { display: none; }

  /* Same collapse bug as the AI-manager stage: container-type:size with no
     explicit height clips the form entirely once min-height is stripped
     at this breakpoint — drop containment, let it flow normally. */
  #contacts .screen-stage {
    container-type: normal;
    overflow: visible;
    position: relative; inset: auto; transform: none;
    display: block;
    width: 100%; height: auto; min-height: 0; aspect-ratio: auto;
    padding: 0;
  }
  #contacts .screen-stage > img { display: none; }

  #contacts .inline-audit {
    position: relative; left: auto; top: auto;
    display: grid; grid-template-rows: none; align-content: start;
    gap: 12px;
    width: calc(100% - var(--m-gutter) * 2); max-width: 560px;
    height: auto; min-height: 0;
    margin: 8px auto 0; padding: 20px;
    border: 1px solid rgba(255, 90, 35, .38);
    border-radius: var(--m-radius);
    background: var(--m-card);
    box-shadow: 0 0 30px rgba(255, 75, 31, .14);
  }
  #contacts .inline-audit input { min-height: 54px; border-radius: 8px; font-size: 15px; }
  #contacts .inline-audit button { min-height: 56px; border-radius: 9px; font-size: 14px; font-weight: 700; }
  #contacts .inline-audit p { position: static; margin: 2px 0 0; }

  .m-badge {
    display: inline-flex; align-items: center;
    padding: 8px 16px; margin-bottom: 20px;
    border: 1px solid var(--blue); border-radius: 999px;
    color: #dfeaff; background: rgba(15, 30, 55, .65);
    box-shadow: 0 0 16px rgba(40, 125, 255, .2);
    font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  }
  .m-audit-card { padding: 4px 20px 6px; text-align: left; }
  .m-audit-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; }
  .m-audit-row + .m-audit-row { border-top: 1px solid var(--m-line); }
  .m-audit-text p { display: flex; align-items: baseline; gap: 10px; margin: 0; }
  .m-audit-text b { color: var(--accent); font-family: var(--font-display); font-size: 20px; font-weight: 700; }
  .m-audit-text strong { font-family: var(--font-display); font-size: clamp(15px, 4.2vw, 17px); font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
  .m-audit-text small { display: block; margin-top: 5px; color: #b9bcc1; font-size: clamp(12px, 3.4vw, 14px); line-height: 1.35; }

  .m-wave { display: block; width: 100%; height: 22px; margin: 22px 0 0; overflow: visible; }
  .m-wave path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .85; filter: drop-shadow(0 0 6px rgba(255, 75, 31, .5)); }

  .m-contact-disclaimer {
    margin: 16px auto 0;
    width: calc(100% - var(--m-gutter) * 2); max-width: 560px;
    color: #9a9da2; font-size: 12px; line-height: 1.4; text-align: center;
  }
  .m-footer-nav {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 22px;
    margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--m-line);
  }
  .m-footer-nav a, .m-footer-nav button {
    border: 0; padding: 0; color: #cfd1d4; background: transparent;
    font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; text-decoration: none; cursor: pointer;
  }
  .m-footer-note { margin: 16px 0 0; color: #6c6f74; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

  .m-signature--on-photo {
    position: absolute; z-index: 2; right: 6%; bottom: 4%; margin: 0;
    color: #fff; font-size: clamp(13px, 4vw, 16px);
    text-shadow: 0 2px 8px rgba(0,0,0,.65), 0 0 16px rgba(0,0,0,.5);
  }

  #ai-manager .feature-toast {
    position: static; margin: 14px auto 0;
    width: calc(100% - var(--m-gutter) * 2); max-width: 560px;
    padding: 13px 15px; font-size: 13px; line-height: 1.4;
  }
}

@media (max-width: 370px) {
  .m-block { padding: 44px 0 42px; }
  .mobile-niche { min-height: 158px; padding: 16px 14px; }
  .mobile-niche__arrow { right: 13px; top: 13px; width: 42px; height: 42px; font-size: 26px; }
  .mobile-niche__tags { left: 13px; bottom: 12px; max-width: calc(100% - 26px); padding: 8px 10px; }
  .m-tl-item { grid-template-columns: 28px 1fr; gap: 10px; }
  .m-tl-card { padding: 15px 14px 16px; }
  .m-tl-card .m-ico { width: 44px; height: 44px; }
  .m-tl-card .m-ico svg { width: 21px; height: 21px; }
  .m-wheel__node { width: 36%; padding: 8px 5px; border-radius: 9px; }
  .m-wheel-cta { min-height: 56px; padding: 0 14px; }
}
