/* Hemm — shared finishing touches (all public pages) */

/* Smooth cross-page navigation (Chrome / Safari 18+; ignored elsewhere) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: hemm-out .22s ease both; }
::view-transition-new(root) { animation: hemm-in .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hemm-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes hemm-in { from { opacity: 0; transform: translateY(8px); } }

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
::selection { background: #E2FF8C; color: #071210; }

/* Autofill: keep our dark fields instead of the browser's white/blue box */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--af-ink, #eef3ee) !important;
  caret-color: var(--af-ink, #eef3ee);
  -webkit-box-shadow: 0 0 0 1000px var(--af-bg, transparent) inset !important;
  box-shadow: 0 0 0 1000px var(--af-bg, transparent) inset !important;
  transition: background-color 600000s 0s, color 600000s 0s;
  font: inherit;
}
input:autofill { background-clip: text; }

/* Taps and presses: crisp, physical feedback */
a, button, [role="button"], summary, label { -webkit-tap-highlight-color: transparent; }
:where(.btn, button, [role="button"], .side-cta, .sticky-lead, .lang-switch a) {
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease, opacity .2s;
  touch-action: manipulation;
}
:where(.btn, button, [role="button"]):not(:disabled):active { transform: scale(.965); }
:where(.btn, button):disabled { opacity: .6; cursor: progress; }

/* Lime buttons: a soft light that follows the pointer */
.btn-lime, .btn.lime, .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-lime::after, .btn.lime::after, .btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.55), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
@media (hover: hover) { .btn-lime:hover::after, .btn.lime:hover::after, .btn-primary:hover::after { opacity: 1; } }

/* Tap ripple (added by ui.js) */
.hemm-ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); opacity: .35;
  background: currentColor; animation: hemm-ripple .55s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes hemm-ripple { to { transform: scale(1); opacity: 0; } }

/* Keyboard focus that is visible but calm */
:focus-visible { outline: 2px solid #E2FF8C; outline-offset: 3px; border-radius: 10px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* Button loading state (ui.js adds .is-loading while a form sends) */
.is-loading { color: transparent !important; pointer-events: none; }
.is-loading::before { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid rgba(7,18,16,.25); border-top-color: #071210; animation: hemm-spin .7s linear infinite; }
@keyframes hemm-spin { to { transform: rotate(360deg); } }

/* Success pop for confirmations */
.lf-ok, .form-ok, .ok-pop { animation: hemm-pop .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes hemm-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* Gentle shake for an invalid field */
.shake { animation: hemm-shake .38s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes hemm-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Reading progress line (articles) */
.read-progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 200; pointer-events: none;
  background: #E2FF8C; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* Images fade in once decoded */
img.fade-img { opacity: 0; transition: opacity .5s ease; }
img.fade-img.loaded { opacity: 1; }

/* Language switcher */
.lang-switch { position: relative; display: inline-flex; }
.lang-switch > button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: inherit; font: 600 12px/1 inherit; letter-spacing: .08em; cursor: pointer; }
.lang-switch > button svg { width: 14px; height: 14px; opacity: .8; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px; padding: 6px; border-radius: 16px; z-index: 80;
  background: rgba(10,22,19,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.6); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
.lang-switch.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #dfe7e2; text-decoration: none; font-size: 14px; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: rgba(226,255,140,.1); color: #E2FF8C; }
.lang-menu a span { opacity: .55; font-size: 12px; letter-spacing: .06em; }
.lang-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 13px; }
.lang-foot a { color: inherit; opacity: .65; text-decoration: none; }
.lang-foot a:hover, .lang-foot a[aria-current] { opacity: 1; color: #E2FF8C; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}

/* Language switcher placement in the home header */
.hdr .lang-switch { margin-left: 8px; }
.hdr .lang-switch + .hcta { margin-left: 10px; }
@media (max-width: 1100px) {
  .hdr .lang-switch { margin-left: auto; margin-right: 10px; }
  .hdr .lang-switch ~ .burger { margin-left: 0; }
  .hdr .lang-switch > button { height: 46px; padding: 0 14px; }
}
.lang-mnav { padding: 18px 0 4px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); font-size: 15px; gap: 8px 16px; }
.mnav .lang-mnav { display: flex; flex-wrap: wrap; }
.mnav .lang-mnav a { font-size: 15px !important; font-weight: 500; letter-spacing: 0; padding: 8px 14px !important; border: 1px solid rgba(255,255,255,.14) !important; border-radius: 999px; display: inline-flex !important; width: auto !important; }
.mnav .lang-mnav a[aria-current] { border-color: rgba(226,255,140,.5) !important; }
