/* Reusable pieces: buttons, cards, the project dialog, footer navigation.
   Load order is part of the cascade: keep the numeric prefixes in sequence. */
/* Shared primitives: buttons, chips, cards and the project dialog. */
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,.045) }
.tl { display: block; overflow: hidden; padding: .09em .02em .12em; margin: -.09em -.02em -.12em }
.w-item { border-radius: 24px; border-color: rgba(210,220,255,.13); box-shadow: 0 16px 44px rgba(0,0,0,.18) }
.w-arrow { position: absolute; border: 1px solid rgba(237,233,227,.18); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: opacity .35s, border-color .35s; color: rgba(237,233,227,.7); top: 22px; right: 22px; width: 40px; height: 40px; opacity: .72; background: rgba(11,13,18,.5); backdrop-filter: blur(10px) }
.fit-card { position: relative; min-height: 190px; padding: 32px; border-radius: 20px; overflow: hidden }
.hitch-principle { border-right: 1px solid var(--line); min-height: 200px; padding: 28px; border: 1px solid var(--line) !important; border-radius: 18px; background: rgba(17,21,29,.64) }
.hitch-principle span { display: block; margin-bottom: 16px; color: var(--accent-soft); font: 9px var(--mono); letter-spacing: .2em; width: max-content; padding: 6px 9px; border-radius: 999px; background: rgba(120,151,255,.10) }
.special-card { border-radius: 24px }
@media(max-width:980px) {
  .nav-links li:nth-child(-n+4) { display: none }
  .process-grid { grid-template-columns: 1fr 1fr }
  .proc-item { min-height: 250px }
  .hitch-principles { grid-template-columns: 1fr 1fr }
}
@media(max-width:768px) {
  .primary-nav { top: 8px; left: 8px; right: 8px; min-height: 56px; padding: 7px 8px 7px 13px; border-radius: 16px }
  .nav-logo { font-size: 10px; letter-spacing: .16em }
  .nav-links { display: none }
  .nav-actions { gap: 0 }
  .lang-switch { padding: 2px }
  .lang-btn { min-width: 40px; min-height: 38px }
  .hero { min-height: 100svh; padding: 116px 20px 58px; justify-content: center }
  .hero-title { font-size: clamp(38px,11.5vw,54px); line-height: 1.02; letter-spacing: -.035em; overflow-wrap: anywhere }
  .tl { padding: .08em 0 .13em; margin: -.08em 0 -.13em }
  .hero-eyebrow { max-width: 280px; margin-bottom: 18px; line-height: 1.6; letter-spacing: .18em }
  .hero-sub { margin-top: 24px; max-width: 34rem; font-size: 15px; line-height: 1.65 }
  .hero-cta { width: 100%; margin-top: 30px; gap: 12px }
  .btn-p { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 18px; border-radius: 12px }
  .btn-g { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 18px; border-radius: 12px }
  .btn-g { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025) }
  .signal-strip { margin-top: 18px; gap: 6px }
  .signal-chip { padding: 7px 9px; font-size: 8px; letter-spacing: .08em }
  .scroll-ind { display: none }
  section { padding: 78px 20px }
  .s-label { margin-bottom: 42px; gap: 12px; letter-spacing: .18em; line-height: 1.5 }
  .work-grid { gap: 12px }
  .w-item { min-height: 300px; aspect-ratio: auto; border-radius: 18px }
  .w-item.wide { min-height: 300px; aspect-ratio: auto; border-radius: 18px }
  .w-content { padding: 22px }
  .w-title { max-width: 82%; font-size: 22px }
  .w-item::after { right: 22px; bottom: 23px }
  .w-arrow { width: 38px; height: 38px; top: 16px; right: 16px }
  .fit-grid { grid-template-columns: 1fr; gap: 10px }
  .special-grid { grid-template-columns: 1fr; gap: 10px }
  .process-grid { grid-template-columns: 1fr; gap: 10px }
  .hitch-principles { grid-template-columns: 1fr; gap: 10px }
  .fit-card { min-height: 0; padding: 26px 22px; border-radius: 16px }
  .special-card { min-height: 0; padding: 26px 22px; border-radius: 16px }
  .proc-item { min-height: 0; padding: 26px 22px; border-radius: 16px }
  .hitch-principle { min-height: 0; padding: 26px 22px; border-radius: 16px }
  .fit-card::before { left: 22px }
  .hitch-principle { min-height: 0; padding: 26px 22px; border-radius: 16px; border: 1px solid var(--line) !important }
  .hitch-intro h2 { font-size: clamp(30px,9vw,44px); line-height: 1.08 }
  .hitch-intro p { font-size: 14px; line-height: 1.72 }
  .special-card p { font-size: 14px; line-height: 1.72 }
  .proc-n { margin-bottom: 24px }
  .proc-name { font-size: 22px }
  .proc-desc { font-size: 14px }
  .svc-list { gap: 8px }
  .svc-item { grid-template-columns: 42px minmax(0,1fr); gap: 12px; padding: 20px 16px; border-radius: 14px }
  .svc-item:hover { padding-left: 16px; transform: none }
  .svc-name { font-size: 19px; line-height: 1.25 }
  .svc-desc { font-size: 13px; line-height: 1.6 }
  .svc-tag { display: none }
  .svc-n { width: 34px; height: 28px }
  .about-text h2 { overflow-wrap: anywhere }
  .contact-wrap h2 { overflow-wrap: anywhere }
  .contact-email { display: inline-block; max-width: 100%; overflow-wrap: anywhere; line-height: 1.5 }
  .modal-panel { width: calc(100vw - 20px); max-height: calc(100svh - 20px); padding: 42px 22px 26px; border-radius: 18px }
  .modal-outcome { flex-direction: column; gap: 10px }
}
@media(max-width:360px) {
  .hero-title { font-size: 36px }
  .signal-chip { font-size: 7px }
}
@media(prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  #loader { display: none !important }
  #portfolio { opacity: 1 !important }
  body { overflow-y: auto !important }
  .sr { opacity: 1 !important; transform: none !important }
  .ti { opacity: 1 !important; transform: none !important }
}
/* Touch devices: hide mouse cursor elements, restore cursor */
@media(hover: none) and (pointer: coarse) {
  body { cursor: auto }
  html { cursor: auto }
}
/* Tap highlight off globally */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent }
/* ── PROJECT MODAL ──────────────────────────────────────── */
#proj-modal { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: transparent; color: inherit; opacity: 0; transition: opacity .38s ease }
#proj-modal[open] { display: flex; opacity: 1; transition: opacity .38s ease }
/* The opaque state is the base style, so a browser that skips the entry
   transition still shows the dialog instead of leaving it invisible. */
@starting-style { #proj-modal[open] { opacity: 0 } }
#proj-modal.closing { opacity: 0 }
/* The panel supplies the scrim, so the user agent backdrop stays out of the way. */
#proj-modal::backdrop { background: transparent }
.modal-bd { position: absolute; inset: 0; background: rgba(8,8,8,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px) }
#proj-modal[open] .modal-panel { transform: translateY(0) }
#proj-modal.closing .modal-panel { transform: translateY(28px) }
.modal-close:hover { border-color: rgba(237,233,227,.5); color: var(--fg) }
.modal-meta::before { content: ''; display: block; width: 22px; height: 1px; background: rgba(237,233,227,.25); flex-shrink: 0 }
.modal-outcome { border-top: 1px solid rgba(237,233,227,.07); padding-top: 24px; display: flex; gap: 18px; align-items: baseline }
.w-item { cursor: pointer }
.w-item:hover::after { opacity: 1 }
@media(max-width:768px) {
  .modal-panel { padding: 36px 28px }
  .modal-desc { font-size: 13px }
}
/* PROCESS */
.proc-item:hover { background: rgba(237,233,227,.022) }
.proc-n { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 30px; border-radius: 999px; background: rgba(120,151,255,.1); font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: rgba(237,233,227,.2); margin-bottom: 32px }
/* SERVICE DESCRIPTIONS */
.svc-body { display: flex; flex-direction: column; gap: 7px }
.svc-item:hover .svc-desc { color: var(--dim) }
/* AVAILABILITY BADGE */
.avail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(105,211,155,.55); flex-shrink: 0; animation: avpulse 2.6s ease-in-out infinite }
@keyframes avpulse { 0%,100% { opacity:1; box-shadow:0 0 8px rgba(74,222,128,.55); }
  50% { opacity:.35; box-shadow:0 0 3px rgba(74,222,128,.2); } }
/* CONTACT PHONE */
.contact-phone:hover { color: var(--fg) }
/* FOOTER NAV */
.footer-nav { display: flex; gap: 28px }
.footer-nav a:hover { color: rgba(237,233,227,.5) }
@media(max-width:768px) {
  .process-grid { grid-template-columns: 1fr 1fr }
  .proc-item { border-right: none; border-bottom: 1px solid rgba(237,233,227,.06); padding: 32px 24px }
  .proc-item:last-child { border-bottom: none }
  .footer-nav { display: none }
}
/* Card and list surfaces. */
.proc-item { position: relative; min-height: 300px; border-right: 1px solid rgba(237,233,227,.06); transition: background .4s; padding: 32px 28px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg,rgba(23,28,39,.72),rgba(13,17,25,.62)) }
.proc-item:last-child { border-right: none; border: 1px solid var(--line) }
@media(max-width:980px) {
  .process-grid { grid-template-columns: 1fr 1fr }
}
@media(max-width:768px) {
  .process-grid { grid-template-columns: 1fr; gap: 10px }
  .proc-item { min-height: 0; padding: 26px 22px; border: 1px solid var(--line); border-radius: 16px }
  .proc-item:last-child { min-height: 0; padding: 26px 22px; border: 1px solid var(--line); border-radius: 16px }
  .w-item::after { right: 22px; bottom: 23px }
  .modal-panel { width: calc(100vw - 20px); max-height: calc(100svh - 20px); padding: 42px 22px 26px; border-radius: 18px }
}
