/* --------------------------------------------------------------------------
   Mobile refinement layer — keeps the same visual identity and hierarchy
   without shrinking or clipping the desktop design on small screens.
   Loaded after style.css so it safely overrides only mobile behavior.
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  html {
    scroll-padding-top: 80px;
  }

  .site-header {
    padding: 12px 0;
  }

  .header-inner {
    gap: 12px;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 7px;
    margin-inline-start: auto;
  }

  .main-nav {
    top: 76px;
    z-index: 1001;
  }

  .main-nav.open {
    max-height: min(70vh, 440px);
    overflow-y: auto;
  }

  .hero-layout {
    gap: 36px;
  }

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

@media (max-width: 620px) {
  :root {
    --header-height: 74px;
  }

  html,
  body {
    width: 100%;
    overflow-x: clip;
  }

  .container {
    width: min(var(--container), calc(100% - 28px));
  }

  .site-header {
    padding: 10px 0;
  }

  .header-inner {
    gap: 8px;
  }

  .brand {
    min-width: 0;
    gap: 7px;
  }

  .brand-mark {
    width: 48px;
    height: 42px;
    flex: 0 0 auto;
  }

  .brand-copy {
    display: flex;
    min-width: 0;
  }

  .brand-copy strong {
    max-width: 106px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-copy small {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .theme-switcher,
  .language-switch,
  .menu-button {
    flex: 0 0 auto;
  }

  .theme-toggle,
  .language-switch,
  .menu-button {
    width: 41px;
    min-width: 41px;
    height: 41px;
    min-height: 41px;
  }

  .theme-toggle {
    padding: 0;
  }

  .language-switch {
    justify-content: center;
    gap: 4px;
    padding: 0;
  }

  .language-option {
    font-size: 9px;
  }

  .language-separator {
    height: 11px;
  }

  .main-nav {
    top: 67px;
    right: 14px;
    left: 14px;
    padding-inline: 12px;
    border-radius: 18px;
  }

  .main-nav.open {
    padding: 12px;
  }

  .main-nav a {
    padding: 12px;
    font-size: 12px;
  }

  .theme-palette {
    top: 66px;
    inset-inline: 12px;
    width: auto;
    max-height: calc(100vh - 82px);
    overflow-y: auto;
  }

  /* Hero: the two desktop actions stay side-by-side and the visual stays rich. */
  .hero {
    min-height: auto;
    padding: 99px 0 64px;
  }

  .hero-layout {
    gap: 27px;
  }

  .availability-pill {
    margin-bottom: 17px;
    padding: 7px 11px;
    font-size: 9px;
  }

  .hero-kicker {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(34px, 10.3vw, 43px);
    line-height: 1.23;
    letter-spacing: -1.35px;
  }

  html[dir="ltr"] .hero h1 {
    letter-spacing: -1.8px;
  }

  .hero-description {
    margin-top: 17px;
    font-size: 13px;
    line-height: 1.9;
  }

  .hero-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 9px;
    margin-top: 25px;
  }

  .hero-buttons .button {
    width: 100%;
    min-height: 50px;
    gap: 7px;
    padding: 0 9px;
    font-size: 10px;
    white-space: nowrap;
  }

  .hero-buttons .button-icon {
    font-size: 15px;
  }

  .download-icon {
    width: 21px;
    height: 21px;
    font-size: 13px;
  }

  .hero-meta {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 29px;
  }

  .meta-line {
    display: none;
  }

  .meta-item {
    min-width: 0;
  }

  .meta-item strong {
    font-size: 23px;
  }

  .meta-item span {
    font-size: 9px;
  }

  .meta-tools {
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--border);
  }

  .meta-tools strong {
    font-size: 10px;
  }

  .meta-tools span {
    display: block;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-visual {
    width: 100%;
    min-height: 446px;
    max-width: 390px;
    margin-inline: auto;
  }

  .portrait-frame {
    width: min(88vw, 310px);
    height: auto;
    aspect-ratio: 0.76;
    border-radius: 160px 160px 28px 28px;
  }

  .orbit-large {
    width: min(98vw, 360px);
    height: min(98vw, 360px);
  }

  .orbit-small {
    width: min(78vw, 292px);
    height: min(78vw, 292px);
  }

  .portrait-caption {
    bottom: 13px;
    max-width: calc(100% - 22px);
    gap: 6px;
    padding: 8px 10px;
    font-size: 7.5px;
  }

  .caption-dot {
    width: 6px;
    height: 6px;
  }

  /* Keep the floating editor tools as compact details rather than hiding them. */
  .floating-tool {
    display: flex;
    min-width: 0;
    padding: 6px;
    border-radius: 10px;
  }

  .floating-tool > span:last-child {
    display: none;
  }

  .tool-badge {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    font-size: 9px;
  }

  .tool-premiere {
    top: 55px;
    right: 0;
  }

  .tool-after-effects {
    top: 164px;
    left: 0;
  }

  .tool-davinci {
    right: 0;
    bottom: 74px;
  }

  .project-card {
    bottom: 0;
    left: 50%;
    width: min(calc(100% - 12px), 275px);
    min-width: 0;
    padding: 9px 11px;
    border-radius: 13px;
    animation: none;
    transform: translateX(-50%);
  }

  .project-card strong {
    font-size: 8.5px;
  }

  .project-card small {
    font-size: 7.5px;
  }

  .project-icon {
    width: 30px;
    height: 30px;
    font-size: 9px;
  }

  /* Shared section typography stays close to the desktop hierarchy. */
  .about-section,
  .services-section,
  .portfolio-section,
  .feedback-section,
  .contact-section {
    padding-top: 76px;
    padding-bottom: 82px;
  }

  .section-heading,
  .portfolio-heading,
  .feedback-heading {
    margin-bottom: 30px;
  }

  .section-label {
    margin-bottom: 12px;
    padding: 6px 10px;
    font-size: 9px;
  }

  .section-heading h2 {
    font-size: clamp(31px, 9.4vw, 39px);
    line-height: 1.25;
  }

  .section-heading > p {
    margin-top: 14px;
    font-size: 12.5px;
    line-height: 1.85;
  }

  .about-story-card,
  .experience-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .about-story-card h3 {
    font-size: 22px;
    line-height: 1.42;
  }

  .about-story-card > p {
    font-size: 12.5px;
  }

  /* Preserve the desktop stat-row feeling instead of making it three long cards. */
  .about-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    display: block;
    min-height: 102px;
    padding: 14px 10px;
    border-radius: 16px;
  }

  .stat-card strong {
    font-size: clamp(21px, 6.3vw, 26px);
  }

  .stat-card span {
    margin-top: 6px;
    font-size: 8px;
    line-height: 1.5;
    text-align: start;
  }

  .experience-panel {
    padding-inline: 17px;
  }

  .panel-heading {
    gap: 10px;
    padding-bottom: 18px;
  }

  .panel-icon {
    width: 39px;
    height: 39px;
    border-radius: 11px;
  }

  .panel-heading strong {
    font-size: 13px;
  }

  .experience-timeline {
    gap: 20px;
    margin-top: 21px;
  }

  .timeline-item {
    gap: 13px;
  }

  .timeline-content p {
    font-size: 10px;
  }

  /* Cards retain their desktop detailing but breathe better on narrow screens. */
  .services-grid {
    gap: 14px;
  }

  .service-card,
  .service-card:last-child {
    min-height: 350px;
    padding: 20px;
    border-radius: 20px;
  }

  .service-card-featured {
    min-height: auto;
  }

  .service-card h3 {
    font-size: 23px;
  }

  .service-card-featured h3 {
    font-size: 30px;
  }

  .service-card p {
    font-size: 12px;
  }

  .services-process {
    padding: 18px;
  }

  .process-steps {
    gap: 8px;
  }

  .process-step {
    padding: 9px 7px;
  }

  .process-step strong {
    font-size: 10px;
  }

  .process-step span {
    font-size: 8px;
  }

  /* Portfolio filters are a single smooth row instead of wrapping unevenly. */
  .portfolio-heading {
    gap: 14px;
  }

  .portfolio-heading-note {
    width: 100%;
    margin: 0;
  }

  .portfolio-toolbar {
    gap: 12px;
    margin-bottom: 19px;
    padding-bottom: 16px;
  }

  .portfolio-filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .portfolio-filters::-webkit-scrollbar {
    display: none;
  }

  .portfolio-filter {
    flex: 0 0 auto;
    padding: 8px 11px;
    font-size: 9px;
  }

  .portfolio-count {
    width: 100%;
    padding-inline: 2px;
  }

  .portfolio-grid {
    gap: 14px;
  }

  .portfolio-card {
    border-radius: 19px;
  }

  .portfolio-media,
  .portfolio-media img {
    min-height: 215px;
  }

  .portfolio-content {
    min-height: 148px;
    padding: 16px;
  }

  .portfolio-title-row h3 {
    font-size: 16px;
  }

  .portfolio-content p {
    font-size: 10.5px;
  }

  .feedback-heading {
    gap: 15px;
  }

  .feedback-heading-mark {
    width: 63px;
    height: 63px;
    border-radius: 19px;
  }

  .feedback-heading-mark span {
    margin-top: 15px;
    font-size: 55px;
  }

  .feedback-grid-list {
    gap: 13px;
  }

  .feedback-card {
    min-height: 268px;
    padding: 19px;
    border-radius: 19px;
  }

  .feedback-card-text {
    font-size: 12px;
    line-height: 1.9;
  }

  .contact-layout {
    gap: 31px;
  }

  .contact-copy h2 {
    font-size: clamp(31px, 9.6vw, 40px);
    line-height: 1.24;
  }

  .contact-copy > p {
    margin-top: 16px;
    font-size: 12.5px;
  }

  .contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 25px;
  }

  .contact-actions .button,
  .contact-whatsapp-button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-inline: 10px;
    font-size: 10px;
    white-space: nowrap;
  }

  .contact-note {
    margin-top: 18px;
    font-size: 10px;
  }

  .contact-panel {
    width: 100%;
    padding: 18px;
    border-radius: 21px;
  }

  .contact-panel h3 {
    font-size: 15px;
  }

  .contact-channel {
    min-height: 67px;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .contact-channel-icon {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }

  .contact-channel-copy strong {
    font-size: 9.5px;
  }

  .contact-panel-footer {
    gap: 8px;
  }

  .contact-panel-status {
    font-size: 9px;
  }

  .footer-main {
    gap: 20px;
    padding: 26px 0 21px;
  }

  .footer-brand img {
    width: 48px;
    height: 40px;
  }

  .footer-links {
    gap: 9px 15px;
  }

  .footer-links a {
    font-size: 10px;
  }

  .footer-socials a {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 390px) {
  .container {
    width: min(var(--container), calc(100% - 24px));
  }

  .header-inner {
    gap: 5px;
  }

  .brand-mark {
    width: 43px;
    height: 39px;
  }

  .brand-copy strong {
    max-width: 78px;
    font-size: 10px;
  }

  .header-actions {
    gap: 4px;
  }

  .theme-toggle,
  .language-switch,
  .menu-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .theme-toggle-dot {
    width: 15px;
    height: 15px;
  }

  .hero h1 {
    font-size: clamp(32px, 10.2vw, 39px);
  }

  .hero-buttons .button {
    font-size: 9px;
  }

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

  .portrait-frame {
    width: min(87vw, 288px);
  }

  .orbit-large {
    width: min(96vw, 330px);
    height: min(96vw, 330px);
  }

  .orbit-small {
    width: min(74vw, 265px);
    height: min(74vw, 265px);
  }

  .floating-tool {
    padding: 5px;
  }

  .tool-badge {
    width: 26px;
    height: 26px;
    font-size: 8px;
  }

  .tool-after-effects {
    top: 145px;
  }

  .tool-davinci {
    bottom: 69px;
  }

  .project-card {
    width: min(calc(100% - 8px), 255px);
  }

  .about-stats {
    gap: 6px;
  }

  .stat-card {
    min-height: 96px;
    padding: 12px 8px;
  }

  .stat-card span {
    font-size: 7.5px;
  }

  .contact-actions .button,
  .contact-whatsapp-button {
    font-size: 9px;
  }
}
