/* ==========================================================================
   responsive.css: breakpoints (sm 640, md 768, lg 1024) and reduced motion
   ========================================================================== */

/* ---------- Up-scaling ---------- */
@media (min-width: 640px) {
  .hero-tag {
    max-width: 220px;
  }
  .btn-contact {
    padding: 0.875rem 2.5rem;
    font-size: 0.875rem;
  }
  .marquee {
    padding-top: 8rem;
  }
  .about {
    padding-inline: 2rem;
  }
  .about-body {
    gap: 5rem;
  }
  .about-text {
    gap: 3.5rem;
  }
  .services {
    padding: 6rem 2rem 9.5rem;
    border-radius: 50px 50px 0 0;
  }
  .svc-sub {
    margin-bottom: 5rem;
  }
  .svc-item {
    padding-block: 2.5rem;
  }
  .work {
    margin-top: -3rem;
    border-radius: 50px 50px 0 0;
  }
  .pcard {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .nav-in {
    padding: 2rem 2.5rem 1rem;
  }
  .nav a {
    font-size: 1.125rem;
  }
  .hero-head {
    padding-top: 5.5rem;
  }
  .hero-tag {
    max-width: 280px;
  }
  .btn-contact {
    padding: 1rem 3rem;
    font-size: 1rem;
  }
  .marquee {
    padding-top: 10rem;
  }
  .about {
    padding-inline: 2.5rem;
  }
  .about-body {
    gap: 6rem;
  }
  .about-text {
    gap: 4rem;
  }
  .services {
    padding: 8rem 2.5rem 11.5rem;
    border-radius: 60px 60px 0 0;
  }
  .svc-sub {
    margin-bottom: 7rem;
  }
  .svc-item {
    padding-block: 3rem;
  }
  .work {
    margin-top: -3.5rem;
    border-radius: 60px 60px 0 0;
  }
  .pcard {
    top: calc(8rem + var(--i) * 28px);
    padding: 2rem;
  }
  .pcard-grid,
  .pcard-col {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .nav a {
    font-size: 1.4rem;
  }
  .hero-head {
    padding-top: 6.25rem;
  }
  .hero-tag {
    max-width: 320px;
  }
}

/* ---------- Down-scaling ---------- */
@media (max-width: 1080px) {
  .index li {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 1.2fr);
  }
  .index .tech {
    grid-column: 2 / -1;
    margin-top: -0.6rem;
  }
}

/* About cards leave the corners and sit under the text */
@media (max-width: 1023px) {
  .about-floats {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 560px;
    margin-top: 3.5rem;
  }
  .float {
    position: static;
    width: auto;
  }
  .float-card {
    height: 100%;
    transform: none;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards stop stacking and flow normally */
@media (max-width: 767px) {
  .card-slot {
    height: auto !important;
    margin-bottom: 1rem;
  }
  .pcard {
    position: relative;
    top: auto !important;
    transform: none;
    padding: 10px;
    border-width: 1px;
    border-radius: 24px;
  }
  .pcard-top {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 6px 4px 12px;
  }
  .pcard-num { font-size: 42px; }
  .pcard-title { min-width: 0; }
  .pcard-title h3 { font-size: 21px; line-height: 1.1; }
  .pcard-title .eyebrow { font-size: 9px; line-height: 1.5; letter-spacing: .1em; margin-bottom: 5px; }
  .pcard-kind { font-size: 8px; margin-bottom: 6px; padding: 4px 7px; letter-spacing: .1em; }
  .pcard-actions { grid-column: 1 / -1; width: 100%; justify-content: flex-start; gap: 8px; }
  .pcard-actions .pill-ghost, .pcard-actions .case-btn {
    min-height: 40px;
    padding: 9px 13px;
    font-size: 10px;
    letter-spacing: .06em;
  }
  .pcard-actions > span.pill-ghost { white-space: normal; }
  .pcard-col { grid-template-rows: auto auto; gap: 8px; }
  .pcard-panel { padding: 13px; border-radius: 15px; }
  .pcard-lede { font-size: 13px; line-height: 1.55; }
  .pcard-feats { gap: 12px; }
  .pcard-feats strong { font-size: 13px; }
  .pcard-feats span { font-size: 12px; line-height: 1.5; }
  .pcard-details { border-radius: 15px; background: var(--panel); }
  .pcard-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 12px 13px;
    list-style: none;
    font-size: 12px;
    cursor: pointer;
  }
  .pcard-details > summary::-webkit-details-marker { display: none; }
  .pcard-details > summary::after { content: '+'; font-size: 18px; color: var(--grey); }
  .pcard-details[open] > summary::after { content: '−'; }
  .pcard-details[open] > summary { border-bottom: 1px solid var(--edge); }
  .pcard-details > summary:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; border-radius: 15px; }
  .pcard-details > .pcard-feats { height: auto; background: transparent; }
  .pcard-shot .bot-card {
    position: static;
    width: auto;
    padding: 10px 12px;
    border: 0;
    border-top: 1px solid #292929;
    border-radius: 0;
    background: var(--panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  .pcard-shot .bot-card p { font-size: 11px; line-height: 1.45; }
  .pcard-shot .bot-card .bot-top { font-size: 9px; margin-bottom: 4px; }
  .pcard-shot img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
  .pcard-grid {
    grid-template-columns: 1fr;
  }
  .pcard-shot {
    order: -1;
    min-height: 0;
    border-radius: 15px;
  }
  .sec-head {
    grid-template-columns: 1fr;
  }
  .sec-head p {
    justify-self: start;
  }
  .mini-grid {
    grid-template-columns: 1fr;
  }
  .stage {
    padding-bottom: 2.75rem;
  }
  .track {
    grid-template-columns: 1fr 1fr;
    row-gap: 2.5rem;
  }
  .index li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .index .tech {
    grid-column: auto;
    margin-top: 0;
  }
}

/* Phones: two-line hero name, portrait centred vertically */
@media (max-width: 639px) {
  .hero {
    min-height: 600px;
  }
  .hero-heading .hl {
    display: block;
  }
  .portrait {
    top: 50%;
    bottom: auto;
    height: auto;
    width: min(96vw, 440px);
    transform: translate3d(-50%, calc(-42% + var(--p) * 12%), 0) scale(calc(1 - var(--p) * 0.08));
  }
  .hero-bottom {
    align-items: flex-end;
    gap: 1rem;
  }
  .hero-left .pill {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }
  .mq-tile {
    width: 300px;
    height: 193px;
  }
  .mq-note {
    width: 290px;
    height: 268px;
    padding: 1rem 1.05rem;
  }
  .mq-note h3 {
    font-size: 1.15rem;
  }
  .mq-note > p {
    font-size: 0.8rem;
  }
  .mq-note dl div {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 0.5rem;
  }
  .mq-name strong {
    font-size: 1.15rem;
  }
  .about-floats {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .contact-direct li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
