/*
  TechCoder Software responsive layer
  Desktop component rules live in style.css and components.css. This file only
  changes layout when the available inline space is no longer sufficient.
*/

/* Prevent intrinsic content from widening grid and flex tracks. */
.hero-copy,
.hero-visual,
.heading-row > *,
.heading-split > *,
.about-story,
.about-details,
.ai-copy,
.workflow-studio,
.testimonial-intro,
.testimonial-carousel,
.contact-copy,
.contact-form-card,
.footer-brand,
.footer-links,
.mou-card > div,
.job-row > div,
.contact-methods > * > div {
  min-width: 0;
}

.contact-methods strong,
.form-privacy,
.office-strip a,
.footer-links a,
.job-row h3 {
  overflow-wrap: anywhere;
}

/* Keep the two fixed controls from covering each other. */
.back-to-top.is-visible + .toast { bottom: 76px; }

/* The expanded 12-route navigation changes to the accessible menu before it crowds the header. */
@media (max-width: 1240px) {
  .site-header { padding: 13px 0; }
  .site-header.scrolled { padding: 8px 0; }

  .nav-cta { display: none; }

  .menu-toggle { display: block; }

  /*
    The menu remains in the DOM for keyboard users. main.js toggles .is-open
    and the button's aria-expanded state; visibility keeps a closed menu out
    of tab order until then.
  */
  .primary-nav {
    position: absolute;
    z-index: 1;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    display: flex;
    max-height: calc(100dvh - 86px);
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 1px solid rgba(163, 220, 255, .2);
    border-radius: 14px;
    color: var(--white);
    background: rgba(6, 20, 43, .97);
    box-shadow: 0 20px 45px rgba(0, 5, 20, .34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s step-end;
  }

  .primary-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .22s ease, transform .22s ease;
  }

  .nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
  }

  .nav-link:hover,
  .nav-link.active { background: rgba(115, 219, 255, .1); }
  .nav-link::after { display: none; }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.25px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
  }

  .tech-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .industry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .section { padding: 102px 0; }

  .heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .heading-row > p { max-width: 630px; margin-bottom: 0; }

  .heading-split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .heading-split .heading-side { padding-bottom: 0; }

  .hero {
    min-height: 0;
    padding: 137px 0 42px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    min-height: 0;
  }

  .hero-copy { max-width: 720px; padding-top: 0; }

  .hero-visual {
    width: min(620px, 100%);
    margin-inline: auto;
  }

  .hero-scroll-row { padding-top: 8px; }

  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .proof-grid p,
  .proof-grid p:first-child {
    min-height: 68px;
    padding: 16px 22px;
  }

  .proof-grid p:nth-child(2) { border-right: 0; }

  .proof-grid a {
    min-height: 68px;
    padding: 16px 22px;
    border-top: 1px solid rgba(148, 195, 249, .12);
  }

  .about-layout,
  .ai-layout,
  .testimonial-layout,
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .about-story { min-height: 0; }
  .story-visual { margin-left: 0; }

  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mou-card {
    grid-template-columns: 72px 145px minmax(0, 1fr) 22px;
    gap: 18px;
    padding-right: 19px;
  }

  .mou-date { padding-right: 15px; }
  .mou-card img { width: 145px; height: 116px; }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 45px;
  }

  .footer-brand > p { max-width: 460px; }
}

@media (max-width: 700px) {
  :root { --container: min(1200px, calc(100% - 40px)); }

  html { scroll-padding-top: 76px; }
  .section { padding: 86px 0; }
  .section-heading { margin-bottom: 40px; }

  .eyebrow {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .proof-grid { grid-template-columns: minmax(0, 1fr); }
  .proof-grid p,
  .proof-grid p:first-child,
  .proof-grid p:nth-child(2) {
    min-height: 0;
    padding: 17px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 195, 249, .12);
  }

  .proof-grid a {
    min-height: 0;
    padding: 17px 0;
    border-top: 0;
  }

  .process-rail {
    align-items: flex-start;
    flex-direction: column;
    gap: 23px;
    margin-top: 62px;
  }

  .process-title { max-width: none; }

  .process-rail ol {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 14px;
  }

  .process-rail li:has(> i) { display: none; }

  .company-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* The fixed coordinate workflow cannot fit safely on a phone. */
  .workflow-map {
    display: grid;
    min-height: 0;
    gap: 10px;
    padding: 15px;
    overflow: visible;
  }

  .workflow-line { display: none; }

  .flow-step,
  .step-1,
  .step-2,
  .step-3,
  .step-4,
  .step-5,
  .step-6 {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
  }

  .studio-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .mou-timeline::before { display: none; }

  .mou-card {
    grid-template-columns: 66px minmax(0, 1fr) 20px;
    align-items: start;
    gap: 15px;
    min-height: 0;
    padding: 18px;
  }

  .mou-date { grid-row: span 2; padding-right: 14px; }
  .mou-date span { font-size: 1.75rem; }
  .mou-card img { width: 100%; height: 155px; grid-column: 2; }
  .mou-card > div:nth-of-type(2) { grid-column: 2; }
  .mou-card > i { grid-row: 1; grid-column: 3; }

  .career-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
  }

  .career-board-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .office-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 17px 0;
  }

  .office-strip a { width: 100%; margin-left: 0; }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .section { padding: 76px 0; }

  h1 { font-size: clamp(2.45rem, 12vw, 3.35rem); }
  h2 { font-size: clamp(2rem, 9.5vw, 2.65rem); }

  .hero { padding: 122px 0 32px; }
  .hero-copy .eyebrow { margin-bottom: 19px; }
  .hero-lead { font-size: .95rem; }

  .hero-actions,
  .hero-actions .button { width: 100%; }

  .hero-footnote { margin-top: 30px; }

  .hero-visual { min-height: 390px; }

  .orbit-one { width: 340px; height: 340px; top: 20px; }
  .orbit-two { width: 240px; height: 240px; top: 68px; }

  .dashboard-main {
    top: 72px;
    right: auto;
    left: 50%;
    width: min(365px, calc(100% - 36px));
    padding: 19px 18px 16px;
    transform: translateX(-50%) rotate(-3.7deg);
  }

  .dashboard-metric strong { font-size: 2.85rem; }
  .card-data { top: 43px; left: 0; }
  .card-security { right: 0; bottom: 30px; }
  .tag-api { top: 22px; right: 10px; }
  .tag-data { bottom: 14px; left: 40px; }

  .hero-scroll-row > span { display: none; }
  .hero-scroll-row { justify-content: flex-start; }

  .service-grid,
  .portfolio-grid { grid-template-columns: minmax(0, 1fr); }

  .portfolio-grid { grid-auto-rows: 245px; }
  .portfolio-wide,
  .portfolio-tall { grid-column: auto; grid-row: auto; }
  .portfolio-tall { min-height: 245px; }

  .filter-bar,
  .career-filters,
  .tech-controls {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .filter-button,
  .career-filter,
  .tech-tab { flex: 0 0 auto; }

  .mou-card {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 15px;
  }

  .mou-date {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-row: auto;
    grid-column: 1;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .mou-date small { margin-top: 0; }
  .mou-card img,
  .mou-card > div:nth-of-type(2) { grid-column: 1; }
  .mou-card > i { grid-column: 2; }

  .testimonial-slide { min-height: 286px; padding: 28px 24px; }
  .testimonial-slide blockquote { font-size: 1.12rem; }

  .career-board-top,
  .career-filters,
  .jobs-list { padding-right: 19px; padding-left: 19px; }

  .job-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px 13px;
    padding: 17px 0;
  }

  .job-row > span { grid-column: 2; }

  .job-apply {
    width: 100%;
    grid-column: 1 / -1;
    justify-content: center;
    padding: 10px;
    border: 1px solid #c8dced;
    border-radius: 8px;
    background: #f7fbff;
  }

  .contact-layout { gap: 38px; }
  .contact-form-card { padding: 24px 19px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-full { grid-column: auto; }

  .form-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .form-submit-row .button { width: 100%; }

  .footer-top { padding: 59px 0 43px; }
  .modal { padding: 16px; }
  .modal-dialog {
    max-height: calc(100dvh - 32px);
    overscroll-behavior: contain;
  }
}

@media (max-width: 480px) {
  :root { --container: min(1200px, calc(100% - 36px)); }

  .section { padding: 68px 0; }
  .eyebrow { font-size: .61rem; letter-spacing: .1em; }

  .brand-logo {
    max-width: min(146px, calc(100vw - 108px));
    height: 36px;
    padding: 3px 7px;
  }

  .brand-name { font-size: 1.04rem; }
  .brand-name small { font-size: .42rem; }

  .hero { padding-top: 110px; }
  .hero-visual { min-height: 338px; }
  .orbit-one { width: 290px; height: 290px; top: 18px; }
  .orbit-two { width: 208px; height: 208px; top: 59px; }
  .dashboard-main { top: 60px; width: calc(100% - 28px); }
  .dashboard-metric { margin-top: 20px; }
  .dashboard-metric strong { font-size: 2.5rem; }
  .signal-chart { height: 67px; margin-top: 13px; }

  .mini-card,
  .floating-tag,
  .orbital-node,
  .visual-connector { display: none; }

  .story-visual { width: 100%; height: 340px; border-radius: 22px; }

  .story-card-top {
    top: 30px;
    left: 18px;
    width: calc(100% - 36px);
    padding: 19px;
  }

  .story-label { margin-bottom: 26px; }
  .story-card-top strong { font-size: 1.82rem; }
  .story-disc { top: 23px; right: 19px; width: 20px; height: 20px; }

  .story-card-bottom {
    right: 15px;
    bottom: 21px;
    width: calc(100% - 30px);
    padding: 12px;
  }

  .capability-list { grid-template-columns: minmax(0, 1fr); }
  .process-rail ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-grid { grid-template-columns: minmax(0, 1fr); }

  .industry-card { min-height: 195px; }
  .portfolio-grid { grid-auto-rows: 220px; }
  .portfolio-card,
  .portfolio-tall { min-height: 220px; }
  .portfolio-overlay { padding: 20px; }

  .carousel-actions { margin-top: 4px; }
  .testimonial-slide { min-height: 268px; padding: 24px 19px; }
  .rating { margin-bottom: 19px; }
  .testimonial-slide blockquote { margin-bottom: 24px; }

  .career-hero .button { width: 100%; }
  .footer-links { grid-template-columns: minmax(0, 1fr); gap: 22px; }

  .footer-bottom > div { flex-wrap: wrap; gap: 10px 17px; }
  .back-to-top { right: 15px; bottom: 15px; }
  .toast { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
  .back-to-top.is-visible + .toast { bottom: 66px; }
}

@media (hover: none) {
  .service-card:hover,
  .portfolio-card:hover,
  .industry-card:hover,
  .mou-card:hover,
  .job-row:hover {
    transform: none;
    translate: 0;
  }
}
