/* Shared responsive refinements for every NOVIX page. */

html {
  width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.shell,
.section,
main > section {
  min-width: 0;
}

.shell > *,
.section > *,
main > section > * {
  min-width: 0;
}

@media (max-width: 980px) {
  .site-header,
  .nav {
    position: relative;
    z-index: 120;
    height: auto;
    min-height: 76px;
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-header .main-nav,
  .nav .nav-links,
  .site-header .header-actions,
  .nav .header-actions,
  .nav .desktop-cta {
    display: none !important;
  }

  .brand-image-link,
  .brand-with-logo {
    min-width: 0;
    max-width: calc(100% - 58px);
  }

  .brand-logo {
    width: clamp(72px, 20vw, 88px);
    flex: 0 0 auto;
  }

  .brand-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-header .mobile-toggle,
  .nav .mobile-toggle {
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-left: auto;
  }

  .mobile-menu {
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(92px + env(safe-area-inset-top)) max(20px, var(--pad)) calc(28px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 28px;
  }

  .mobile-menu nav a {
    min-height: 48px;
    font-size: clamp(25px, 6vw, 38px) !important;
    line-height: 1.22;
    padding: 10px 0;
  }

  .mobile-menu-bottom {
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: auto;
  }

  .mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 10px 0 18px;
  }

  .mobile-menu-actions a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 14px;
  }

  .home-hero {
    min-height: 0;
    padding-top: clamp(36px, 8vw, 72px);
    padding-bottom: 56px;
  }

  .home-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .home-title {
    max-width: 100%;
    font-size: clamp(48px, 10vw, 86px);
    line-height: .94;
    overflow-wrap: anywhere;
  }

  .orb-stage {
    width: 100%;
    min-height: clamp(300px, 64vw, 480px);
  }

  .page-hero {
    min-height: 0;
    padding-top: clamp(64px, 11vw, 100px);
    padding-bottom: clamp(48px, 9vw, 82px);
  }

  .page-title {
    max-width: 100%;
    font-size: clamp(48px, 11vw, 96px);
    overflow-wrap: anywhere;
  }

  .project-detail-intro,
  .project-detail-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .project-detail-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-detail-image,
  .project-gallery-item {
    min-width: 0;
  }

  .contact-grid,
  .case-summary,
  .case-story {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 22px;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .project-next {
    flex-wrap: wrap;
    gap: 22px;
  }
}

@media (max-width: 680px) {
  .home-title {
    font-size: clamp(42px, 11.5vw, 68px);
    letter-spacing: -.055em;
  }

  .hero-description,
  .page-lead {
    font-size: 15px;
    line-height: 1.7;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .btn,
  .hero-actions .btn-outline,
  .contact-bottom .btn,
  .project-next .btn {
    min-height: 48px;
  }

  .orb-stage {
    min-height: 300px;
    border-radius: 22px;
  }

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

  .orbit-b {
    width: min(56vw, 220px);
    height: min(56vw, 220px);
  }

  .orb-1 { width: 32vw; height: 32vw; }
  .orb-2 { width: 24vw; height: 24vw; }
  .orb-3 { width: 38vw; height: 38vw; }
  .orb-4 { width: 16vw; height: 16vw; }

  .section {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .section-title {
    font-size: clamp(34px, 9vw, 54px);
    line-height: 1.06;
    overflow-wrap: anywhere;
  }

  .project-detail-hero h1,
  .case-hero h1 {
    font-size: clamp(42px, 13vw, 76px);
    line-height: .98;
    overflow-wrap: anywhere;
  }

  .project-detail-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .project-detail-facts > div {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: baseline;
  }

  .project-detail-image,
  .project-gallery-item {
    border-radius: 14px;
  }

  .project-detail-image img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .project-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .project-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .filter-bar,
  .filters,
  .experience-filters {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .form-row,
  .project-form .form-row,
  .project-form .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-form input,
  .project-form textarea,
  .project-form select,
  input,
  textarea,
  select {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }

  .phone-input-group {
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
  }

  .phone-input-group select {
    padding-right: 16px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 18px;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

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

  .contact-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .contact-bottom .btn,
  .project-next .btn {
    width: 100%;
  }

  .page-hero-orb {
    width: min(72vw, 350px);
    height: min(72vw, 350px);
  }

  .hoya-map {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .shell {
    --pad: 18px;
  }

  .btn-large,
  .btn-outline {
    padding-inline: 16px;
    font-size: 13px;
  }

  .mobile-menu {
    padding-left: 18px;
    padding-right: 18px;
  }

  .project-detail-facts > div {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

/* Header account action, shared across all pages. */
.header-actions,
.header-desktop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-icon-link {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: #f4f4f1;
  background: rgba(255,255,255,.035);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.auth-icon-link .auth-link-label {
  display: none;
}

.auth-icon-link:hover,
.auth-icon-link:focus-visible {
  color: var(--acid);
  border-color: rgba(185,255,98,.65);
  background: rgba(185,255,98,.08);
}

.auth-icon-link:focus-visible,
.auth-menu-link:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.auth-menu-link {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

.mobile-menu-actions .whatsapp-link,
.mobile-menu-actions .auth-menu-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  color: #f4f4f1;
  background: rgba(255,255,255,.04);
  font-size: 14px;
}

.mobile-menu-actions .auth-menu-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-icon-link { transition: none; }
}

@media (max-width: 1180px) {
  .site-header .main-nav,
  .nav .nav-links,
  .site-header .header-actions,
  .nav .header-actions,
  .site-header .header-desktop-actions {
    display: none !important;
  }

  .site-header .mobile-toggle,
  .nav .mobile-toggle {
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-left: auto;
  }

  .mobile-menu {
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(92px + env(safe-area-inset-top)) max(20px, var(--pad)) calc(28px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 28px;
  }

  .mobile-menu nav a {
    min-height: 48px;
    font-size: clamp(25px, 6vw, 38px) !important;
    line-height: 1.22;
    padding: 10px 0;
  }

  .mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 10px 0 18px;
  }
}

.courses-empty-state {
  display: flex;
  min-height: 68vh;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 70px;
}

.courses-empty-state h1 {
  margin: 18px 0;
  font: 600 clamp(52px, 9vw, 108px)/.95 "Space Grotesk", sans-serif;
  letter-spacing: -.07em;
}

.courses-empty-state > p {
  max-width: 540px;
  color: #aeb0ba;
  font-size: 16px;
  line-height: 1.75;
}

@media (max-width: 600px) {
  .courses-empty-state { min-height: 62vh; }
  .courses-empty-state h1 { font-size: clamp(46px, 13vw, 72px); }
  .courses-empty-state > p { font-size: 14px; }
}

/* =========================================================
   MOBILE OVERFLOW FIXES — keep text inside its box
   ========================================================= */

/* Decorative glows must never widen the page. */
.blog-hero,
.page-hero,
.project-detail-hero,
.case-hero,
.case-hero-rich,
.courses-hero,
.contact-inner,
.newsletter-card,
.featured-article {
  overflow-x: clip;
}

/* Long words / gradient spans wrap instead of poking out of cards. */
h1, h2, h3, h4,
.gradient-text,
.blog-title,
.page-title,
.contact-inner h2,
.newsletter-card h2,
.featured-content h2,
.case-hero-rich h1,
.case-hero-rich h2 {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

.gradient-text {
  /* inline-block clipped gradients can overflow; keep them inline so they wrap */
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (max-width: 980px) {
  .blog-hero { overflow: hidden; }
  .blog-hero::after { width: 420px; height: 420px; right: -180px; top: -160px; }
  .page-hero-orb { width: 420px; height: 420px; right: -180px; top: -160px; }
  .blog-hero-grid,
  .blog-hero-copy { min-width: 0; max-width: 100%; }
  .blog-hero-grid { gap: 32px; }
}

@media (max-width: 680px) {
  /* CTA card (the "Turn thinking into momentum" box) */
  .contact-inner {
    min-height: 0;
    padding: 28px 22px;
    gap: 24px;
  }

  .contact-inner h2 {
    max-width: 100%;
    margin: 28px 0;
    font-size: clamp(34px, 11.5vw, 60px);
    line-height: .95;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
  }

  .contact-section { padding: 64px 0; }

  .blog-title { font-size: clamp(44px, 14vw, 72px); line-height: .92; max-width: 100%; overflow-wrap: anywhere; }
  .page-title { font-size: clamp(42px, 13.5vw, 72px); line-height: .96; }

  .newsletter-card h2,
  .featured-content h2 { overflow-wrap: anywhere; }

  .newsletter-card { gap: 36px; padding-left: 22px; padding-right: 22px; }

  /* Case study (Aurelia etc.) facts: stack so labels/values fit */
  .case-hero-rich,
  .case-summary-rich,
  .case-facts { min-width: 0; max-width: 100%; }
  .case-facts { grid-template-columns: minmax(0, 1fr); }
  .case-facts .fact * { overflow-wrap: anywhere; }

  /* Courses hero orbit labels */
  .courses-hero { overflow: hidden; }
  .courses-hero-orbit { overflow: hidden; max-width: 100%; }
  .courses-hero-orbit > span { font-size: 9px; letter-spacing: .1em; }

  /* Phone mock-ups & marquee clipped inside own cards */
  .case-thumb { overflow: hidden; }
  .marquee-wrap { overflow: hidden; }

  .btn, .btn-large, .btn-small, .btn-outline { max-width: 100%; }
  .project-detail-facts strong,
  .project-detail-facts span { overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .contact-inner { padding: 24px 18px; }
  .contact-inner h2 { font-size: clamp(30px, 11vw, 40px); }
}

/* =========================================================
   CASE STUDY (rich layout, e.g. case-aurelia.html)
   ========================================================= */
.case-hero-rich { padding: 90px 0 40px; }
.case-hero-rich h1 {
  margin: 24px 0 32px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(56px, 13vw, 184px);
  line-height: .9;
  letter-spacing: -.07em;
  overflow-wrap: anywhere;
}
.case-summary-rich {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 80px;
  align-items: end;
}
.case-summary-rich > p { margin: 0; color: #b2b5bd; font-size: 19px; line-height: 1.6; }
.case-facts > div { padding-top: 13px; border-top: 1px solid var(--line); min-width: 0; }
.case-facts > div > span {
  display: block; color: #8a8e99; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.case-facts > div > strong { display: block; margin-top: 7px; font-size: 13px; line-height: 1.4; }

.case-feature { padding-top: 24px; padding-bottom: 24px; }
.case-art {
  position: relative;
  height: 74vh;
  min-height: 520px;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 75% 20%, rgba(214,170,120,.35), transparent 40%),
    linear-gradient(145deg, #3a2a1f, #15110d);
}
.case-story-rich {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: 100px;
}
.case-story-rich h2 {
  margin: 0; font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 4vw, 60px); line-height: 1; letter-spacing: -.055em;
}
.case-story-rich p { margin: 0 0 20px; color: #989ca6; font-size: 16px; line-height: 1.85; }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

@media (max-width: 980px) {
  .case-summary-rich,
  .case-story-rich { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .case-art { height: auto; min-height: 420px; }
}

@media (max-width: 680px) {
  .case-hero-rich { padding: 56px 0 28px; }
  .case-hero-rich h1 { font-size: clamp(44px, 15vw, 76px); }
  .case-summary-rich > p { font-size: 16px; }
  .case-facts { gap: 12px; }
  .results-grid { grid-template-columns: minmax(0, 1fr); }
  .case-art { min-height: 360px; border-radius: 20px; }
  .case-art .browser-frame { inset: 8% 5%; padding: 18px; }
  .case-art .mock-copy { left: 6%; right: 6%; bottom: 24%; }
  .case-art .mock-copy div { font-size: clamp(28px, 9vw, 40px); }
  .case-art .mock-pill { right: 6%; bottom: 7%; font-size: 10px; padding: 9px 13px; }
}

/* =========================================================
   CLASS-NAME ALIASES — markup uses these names, base CSS
   defined the singular/short versions
   ========================================================= */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag-row span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bfc2c9;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.service-detail .detail-num { color: #696d77; font-size: 11px; }
.service-detail > div,
.service-detail > p { min-width: 0; }

.values-grid,
.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.deliverable-grid { gap: 16px; }
.value-card > span,
.deliverable > span { color: #676b76; font-size: 10px; letter-spacing: .1em; }

@media (max-width: 980px) {
  .values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deliverable-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .values-grid,
  .deliverable-grid { grid-template-columns: minmax(0, 1fr); }
  .value-card, .deliverable { min-height: 0; }
  .tag-row { margin-top: 16px; }
  .service-detail { gap: 18px 16px; padding: 34px 0; }
}

@media (max-width: 680px) {
  /* Project cards: category label goes under the text instead of a squeezed column */
  .project-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .project-meta > div { width: 100%; min-width: 0; }
  .project-meta > span { order: -1; font-size: 11px; letter-spacing: .04em; }
  .project-meta h3 { font-size: clamp(22px, 6.4vw, 26px); overflow-wrap: anywhere; }
}

/* =========================================================
   LANGUAGE SWITCHER + HEADER QUICK ICONS
   ========================================================= */
.lang-switcher { position: relative; flex: 0 0 auto; }

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  min-width: 44px;
  padding: 0 12px;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #f4f4f1;
  background: rgba(255,255,255,.035);
  font: 600 11px/1 Inter, sans-serif;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.lang-button svg { flex: 0 0 20px; }
.lang-button:hover,
.lang-button[aria-expanded="true"],
.lang-button:focus-visible {
  color: var(--acid);
  border-color: rgba(185,255,98,.65);
  background: rgba(185,255,98,.08);
}
.lang-button:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  min-width: 170px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(15,16,21,.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: #e8e8ea;
  background: transparent;
  font: 500 14px/1.2 Inter, sans-serif;
  text-align: left;
  cursor: pointer;
}
.lang-option b { opacity: 0; color: var(--acid); }
.lang-option.is-active b { opacity: 1; }
.lang-option:hover,
.lang-option:focus-visible { background: rgba(255,255,255,.07); outline: none; }

/* Quick icons next to the burger: hidden on desktop (desktop uses header-actions) */
.header-quick { display: none; }

@media (max-width: 1180px) {
  .header-quick {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .header-quick + .mobile-toggle,
  .site-header .header-quick + .mobile-toggle,
  .nav .header-quick + .mobile-toggle { margin-left: 8px; }

  .header-quick .lang-button { padding: 0; width: 44px; }
  .header-quick .lang-current { display: none; }
  .header-quick .auth-icon-link { display: inline-grid; }
  /* header can shrink: logo text gives way first */
  .brand-image-link, .brand-with-logo { flex: 1 1 auto; min-width: 0; max-width: none; }
}

@media (max-width: 380px) {
  .header-quick { gap: 6px; }
  .header-quick + .mobile-toggle { margin-left: 6px; }
  .brand-title { display: none; }
}

/* Language switcher as the last item of the mobile menu */
.mobile-menu-actions .lang-switcher { width: 100%; }
.mobile-menu-actions .lang-button {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  height: auto;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  letter-spacing: normal;
}
.mobile-menu-actions .lang-menu {
  position: static;
  min-width: 0;
  margin-top: 8px;
  box-shadow: none;
}

/* Header icons: exactly one language + account set at any width.
   Desktop (>1180px) uses the header actions; the quick icons next to the
   burger belong to tablet/mobile only and must never show on desktop. */
@media (min-width: 1181px) {
  .header-quick,
  .header-quick * {
    display: none !important;
  }
}

/* Project cards (Home + Work): every line of text under a card stays on a single line */
.project-meta { align-items: center; gap: 14px; }
.project-meta > div,
.project-feature .project-meta > div { flex: 1 1 0; min-width: 0; max-width: none; }
.project-meta h3,
.project-meta p,
.project-feature .project-meta p,
.project-feature .project-meta .project-tech {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.project-meta > span { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 680px) {
  .project-meta { align-items: flex-start; gap: 8px; }
  .project-meta > div { width: 100%; }
  .project-meta h3 { font-size: clamp(19px, 5.6vw, 24px); overflow-wrap: normal; }
  .project-meta p,
  .project-feature .project-meta p,
  .project-feature .project-meta .project-tech { font-size: 11.5px; line-height: 1.6; }
}

/* Mobile: no account icon outside the hamburger menu (it stays inside the menu) */
.header-quick { display: none !important; }
