/* Responsive layout refinements. Existing desktop colors and style stay in index.html. */
.brand-short { display: none; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; object-fit: contain; border-radius: 50%; }
.footer-brand-mark { width: 30px; height: 30px; flex: 0 0 auto; object-fit: contain; border-radius: 50%; }

@media (max-width: 767px) {
  html { scroll-padding-top: 92px; }
  footer { overflow-x: clip; }

  header.fixed {
    top: max(env(safe-area-inset-top), 10px) !important;
    width: calc(100% - 24px) !important;
    max-width: 560px !important;
    border-radius: 20px !important;
  }

  header.fixed > div {
    gap: 4px;
    padding: 7px 10px !important;
  }

  header .brand-full { display: none; }
  header .brand-short { display: inline; }
  header .brand-mark { width: 25px; height: 25px; }
  header > a {
    flex: 0 0 auto;
    gap: 7px !important;
    font-size: 15px !important;
  }

  header nav.site-nav {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  header nav.site-nav::-webkit-scrollbar { display: none; }
  header nav.site-nav a {
    flex: 0 0 auto;
    padding: 8px 6px !important;
    font-size: 9px !important;
    letter-spacing: .08em !important;
  }
  header .desktop-cta { display: none !important; }

  main.max-w-7xl {
    padding: 104px 18px 48px !important;
  }
  main.space-y-36 > :not([hidden]) ~ :not([hidden]) {
    margin-block-start: 68px !important;
  }

  #home {
    min-height: calc(100svh - 80px) !important;
    padding-top: 22px;
    padding-bottom: 14px;
  }
  #status-badge {
    max-width: 100%;
    padding: 7px 11px;
    font-size: 9px;
    line-height: 1.45;
    letter-spacing: .12em;
  }
  #home h1 {
    font-size: clamp(36px, 10vw, 42px) !important;
    line-height: 1.14 !important;
  }
  #home h1 [data-bind="profile.name_en"] {
    margin-top: 3px !important;
    font-size: 26px !important;
    line-height: 1.28 !important;
  }

  #home .hero-tagline {
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px !important;
  }
  .hero-tagline > span:first-child {
    flex: 0 0 20px;
    width: 20px;
    margin-top: 9px;
  }
  .hero-tagline > div {
    min-width: 0;
    flex-wrap: wrap;
    font-size: 11px !important;
    line-height: 1.5 !important;
  }
  #typewriter-text { overflow-wrap: anywhere; }

  .hero-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px !important;
    margin-top: 26px !important;
  }
  .hero-actions > a {
    min-height: 48px;
    justify-content: center;
    padding: 11px 12px !important;
    white-space: nowrap;
  }

  .hero-stats {
    gap: 10px !important;
    margin-top: 30px !important;
  }
  .hero-stats > div {
    padding: 14px !important;
    border-radius: 16px !important;
  }
  .hero-stats > div > div:first-child {
    font-size: 26px !important;
    line-height: 1.15 !important;
  }
  .hero-stats > div > div:last-child {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }

  #about, #work, #contact { scroll-margin-top: 94px; }
  #about > div:first-child, #work > div:first-child {
    margin-bottom: 24px !important;
  }
  .section-heading { font-size: 30px !important; line-height: 1.2 !important; }
  .section-sub { font-size: 14px !important; }
  #about-paragraphs { padding: 18px !important; gap: 18px !important; }
  #player-card { padding: 18px !important; }
  #player-card #vinyl { width: 128px !important; height: 128px !important; }
  #player-card .flex.items-center.justify-between.mt-6.px-2 {
    gap: 6px;
    padding-inline: 0 !important;
  }
  #player-card button {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
  }
  #player-card #song-play {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
  }
  #song-playlist { max-height: 190px !important; }

  #skills-grid, #projects-grid { gap: 14px !important; }
  #skills-grid > *, #projects-grid > * { padding: 18px !important; }
  #projects-teaser { align-items: flex-start !important; padding: 18px !important; }

  #contact > .glass-card {
    padding: 20px !important;
    border-radius: 22px !important;
  }
  #contact-form { width: 100%; }
  #contact-form .grid { grid-template-columns: 1fr !important; }
  #contact-form .field { min-height: 48px; }
  #contact-socials {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
    gap: 12px !important;
  }
  #contact-socials > a {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) 14px;
    align-items: center;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
    gap: 12px !important;
    padding: 14px 16px !important;
    overflow: hidden;
  }
  #contact-socials > a > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
  #contact-socials > a > svg { margin-left: 0 !important; }

  footer > div:first-child, footer > div:last-child { padding-inline: 18px !important; }
  footer > div:nth-child(2) {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px !important;
  }
  footer .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px !important;
  }
  footer > div:last-child { text-align: center; }
  #footer-socials { max-width: 100%; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 360px) {
  header.fixed > div { padding-inline: 7px !important; }
  header nav.site-nav a { padding-inline: 4px !important; font-size: 8px !important; }
  #home h1 { font-size: 34px !important; }
  #home h1 [data-bind="profile.name_en"] { font-size: 23px !important; }
  .hero-actions { gap: 8px !important; }
  #contact-socials { grid-template-columns: minmax(0, 1fr) !important; }
}
