/* Mobile refinement 2026.10.18.8. These two defaults affect new markup only. */
.mobile-copy { display: none; }
.vektor-project-heading { display: contents; }

@media (max-width: 700px) {
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }

  /* Keep natural words and let each language choose its own line breaks. */
  html[lang] .hero h1 {
    font-size: clamp(40px, 12vw, 76px);
    line-height: 1.02;
    letter-spacing: -.045em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
  }
  .hero h1 span { display: inline; }
  html[lang="de"] .hero h1 { font-size: clamp(34px, 10.4vw, 68px); }
  html[lang="pl"] .hero h1 { font-size: clamp(34px, 10.9vw, 70px); }
  html:is([lang="fi"], [lang="sv"]) .hero h1 { font-size: clamp(34px, 11.4vw, 72px); }
  .hero { padding: 20px 0 0; }
  .hero-bottom { margin-top: 20px; gap: 18px; }
  .hero-bottom p { font-size: 16px; line-height: 1.5; }
  html[lang] :is(.page-heading h1, .service-hero h1) {
    font-size: clamp(32px, 9.5vw, 52px);
    line-height: 1.08;
    letter-spacing: -.035em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
  }
  .page-heading { padding: 26px 0 24px; }
  .page-heading p { margin-top: 14px; }
  html[lang="de"] body[data-service="speed"] .service-hero h1,
  html[lang="sv"] body[data-service="development"] .service-hero h1 {
    font-size: clamp(24px, 7.7vw, 52px);
  }
  html[lang="fi"] body[data-page="portfolio"] .page-heading h1 {
    font-size: clamp(23px, 7.4vw, 52px);
  }
  html[lang="fi"] body[data-page="services"] .page-heading h1 {
    font-size: clamp(27px, 8.5vw, 52px);
  }
  .section-heading { align-items: center; gap: 12px; }
  .section-heading h2 { min-width: 0; max-width: 100%; flex-shrink: 0; }
  .section-heading > .text-link { min-width: 0; min-height: 44px; }
  .site-header, .header-actions { min-width: 0; }

  /* Explicit width prevents aspect-ratio + min-height from widening the grid. */
  .services-grid { width: 100%; min-width: 0; }
  .services-grid .service-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .services-grid .service-integrations {
    min-height: 0;
    aspect-ratio: 1.8;
  }
  .services-grid .service-development { min-height: 0; }
  html[lang] .services-grid .service-card h3 {
    margin: 14px 10px 12px;
    max-width: none;
    font-size: clamp(16px, 4.25vw, 24px);
    line-height: 1.22;
    letter-spacing: -.025em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: pretty;
  }
  html[lang] .services-grid .service-development h3,
  html[lang] .services-grid .service-integrations h3 {
    margin: 17px;
    font-size: clamp(22px, 5.5vw, 30px);
  }
  .service-card .card-arrow,
  .service-development .card-arrow {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff45;
    border-radius: 8px;
    background: #101010b8;
    color: #fff;
  }
  .service-card .card-arrow .arrow { width: 20px; height: 20px; }
  .service-card::after {
    background: linear-gradient(180deg, #000b, #0008 36%, transparent 68%);
  }
  .service-speed::after, .service-analytics::after {
    background: linear-gradient(180deg, #fffd, #fff3 38%, transparent 65%);
  }

  /* A compact project heading, a full-width photograph and separate controls. */
  .vektor-feature { display: grid; grid-template-columns: minmax(0, 1fr); }
  .vektor-story { display: contents; }
  .vektor-project-heading { display: block; grid-column: 1; grid-row: 1; padding: 16px 18px 14px; }
  .vektor-project-heading .eyebrow { font-size: 11px; margin-bottom: 7px; }
  .vektor-project-heading h3 { font-size: 29px; line-height: 1.08; }
  .vektor-story > p, .vektor-story > .vektor-format { display: none; }
  .vektor-viewer { order: 0; grid-column: 1; grid-row: 2; width: 100%; }
  .vektor-story > .button {
    grid-column: 1;
    grid-row: 3;
    width: calc(100% - 32px);
    min-height: 54px;
    margin: 12px 16px 16px;
  }
  html[lang] .vektor-slide figcaption {
    min-height: 0;
    padding: 12px 16px 0;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: normal;
    hyphens: none;
  }
  .vektor-viewer > .vektor-controls {
    position: static;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
  }
  .vektor-counter { font-size: 13px; min-width: 52px; }
  .vektor-control-buttons { gap: 10px; }
  .vektor-control-buttons button { width: 52px; height: 48px; font-size: 27px; }
  .vektor-zoom { width: 48px; height: 48px; right: 12px; bottom: 12px; }
  .vektor-zoom .arrow { width: 24px; height: 24px; }
  body[data-page="portfolio"] .page-heading > .eyebrow,
  body[data-page="project"] .page-heading > .eyebrow { display: none; }
  .vektor-case-heading > div:first-child > .eyebrow { display: none; }
  .vektor-case-heading { gap: 14px; }
  .vektor-case-actions { flex-wrap: wrap; }
  .vektor-case-actions .button { font-size: 14px; min-height: 48px; }
  .vektor-case-card figcaption > div { min-width: 0; }
  .vektor-case-card h3 { overflow-wrap: normal; hyphens: none; }
  .vektor-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .vektor-dialog-toolbar .close-button { width: 48px; height: 48px; }
  .vektor-dialog-toolbar .eyebrow, .vektor-dialog-caption p { display: none; }
  .vektor-dialog-bottom { gap: 12px; }

  .check-block { padding: 22px 18px; }
  .check-block > div > p { margin-top: 10px; line-height: 1.45; }
  .check-note { display: none; }
  .check-form { margin-top: 16px; }
  .deliverables { grid-template-columns: minmax(0, 1fr); }
  .deliverables article { min-width: 0; padding: 22px 20px; }
  html[lang] .deliverables h3 {
    max-width: 100%;
    font-size: clamp(20px, 5.4vw, 25px);
    line-height: 1.25;
    overflow-wrap: normal;
    hyphens: none;
    text-wrap: pretty;
  }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .footer-bottom > span:last-child { max-width: 100%; text-align: left; }
  .faq-section { grid-template-columns: minmax(0, 1fr); }
  .faq-section > div { min-width: 0; }
  .faq-section summary {
    display: block;
    position: relative;
    padding-right: 28px;
    font-size: clamp(17px, 4.5vw, 20px);
  }
  .faq-section summary > span { position: absolute; right: 0; top: 0; }
}

/* A single column gives complete words and artwork room on narrow phones. */
@media (max-width: 379px) {
  .site-header { gap: 8px; }
  .brand { font-size: 21px; gap: 7px; }
  .brand-mark { width: 25px; height: 25px; }
  .header-actions { gap: 10px; }
  .language-picker summary { gap: 4px; }
  .language-picker summary svg { width: 18px; height: 18px; }
  .services-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  .services-grid .service-card, .services-grid .grid-cta {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .services-grid .service-card {
    aspect-ratio: 1.25;
    min-height: 0;
  }
  .services-grid .service-development { aspect-ratio: 5 / 3; }
  .services-grid .service-integrations { aspect-ratio: 1.8; }
  html[lang] .services-grid .service-card h3 { margin: 16px; font-size: 22px; }
}
