/* Motion measured on the reference: nav 200ms / 8px, search 180ms / 6px,
   cards 220ms / 4px, drawers 250–300ms. Content remains our own catalogue. */
:root {
  --motion-base: 220ms cubic-bezier(.2,.8,.2,1);
  --nav-tint: #edf4ff;
  --lift-shadow: 0 12px 24px #0078ff14, 0 4px 8px #0f172a0a;
}
.header { z-index: 20; background: var(--surface); backdrop-filter: none; }
.header-inner { position: static; transition: height 200ms; }
.header.scrolled .header-inner { height: 60px; }
.brand-mark { transition: width 200ms, height 200ms; }
.header.scrolled .brand-mark { width: 32px; height: 32px; }
#nav { position: static; gap: 2px; }
.nav-menu { position: static; }
.nav-trigger, #nav > .nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
}
.nav-trigger > span { display: inline-block; color: var(--muted); transition: transform 200ms; }
.nav-menu.is-open > .nav-trigger, .nav-trigger:hover, #nav > .nav-contact:hover {
  color: var(--blue);
  background: var(--nav-tint);
}
.nav-menu.is-open > .nav-trigger > span { transform: rotate(180deg); }
.mega-menu {
  position: absolute;
  inset: 100% 0 auto;
  width: auto;
  padding: 0;
  margin: 0;
  border: 0;
  border-block: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 16px 48px #0f172a24;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 200ms, transform 200ms, visibility 200ms;
  animation: none;
}
/* Invisible bridge keeps pointer travel between the trigger and panel continuous. */
.mega-menu::before { content: ''; position: absolute; inset: -18px 0 100%; }
.nav-menu.is-open > .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.mega-clip { max-height: calc(100dvh - 160px); overflow: auto; overscroll-behavior: contain; }
.mega-inner {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 1.4fr;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px max(24px, calc((100vw - 1280px) / 2));
  gap: 32px;
}
.mega-three { grid-template-columns: 1fr 1fr 1.2fr; }
.mega-blog { grid-template-columns: 1.4fr .9fr 1.1fr; }
.mega-column { min-width: 0; }
.mega-column > h2 { margin: 0 0 12px 12px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.mega-links { display: flex; flex-direction: column; gap: 2px; }
#nav .mega-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  white-space: normal;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  transition: background 150ms, color 150ms;
}
#nav .mega-links a:hover, #nav .mega-links a:focus-visible, #nav .mega-post:hover {
  color: var(--blue);
  background: var(--nav-tint);
}
.mega-links a > span { color: var(--muted); }
.mega-feature {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--nav-tint), var(--surface-soft));
}
.mega-eyebrow { display: inline-block; border-radius: 999px; padding: 6px 10px; background: var(--surface); font-size: 11px; letter-spacing: .08em; color: var(--blue); }
.mega-symbol { position: absolute; top: 20px; right: 20px; color: var(--blue); font-size: 25px; font-weight: 800; opacity: .55; }
.mega-feature h2 { font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.4; margin-top: 4px; }
.mega-feature p { font-size: 13px; color: var(--sub); line-height: 1.8; padding-bottom: 16px; }
#nav .mega-feature > a.button {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  color: white;
  background: #2258e6;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 8px;
  white-space: normal;
  font-size: 13px;
}
#nav .mega-feature > a.button:hover { background: #1644bc; }
#nav .mega-feature a span { color: inherit; }
#nav a.mega-post {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: normal;
  transition: background 150ms;
}
.mega-post-icon { flex: 0 0 50px; height: 50px; display: grid; place-items: center; background: linear-gradient(135deg,#438ffe,#1851c7); border-radius: 8px; color: white !important; font-size: 23px; }
.mega-post:nth-of-type(2) .mega-post-icon { background: linear-gradient(135deg,#f78d55,#ce4928); }
.mega-post:nth-of-type(3) .mega-post-icon { background: linear-gradient(135deg,#a38be5,#6953bd); }
.mega-post strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.mega-post small { display: block; font-size: 12px; line-height: 1.5; margin-top: 5px; color: var(--muted); }
.search-host { position: relative; display: flex; }
.search-dialog {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: min(560px, calc(100dvh - 170px));
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px #0000001f;
  z-index: 30;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms, transform 180ms;
}
.search-dialog[open] { animation: none; }
.search-dialog.is-visible { opacity: 1; transform: translateY(0); }
.search-heading { margin-bottom: 10px; }
.search-heading h2 { font-size: 17px; }
.search-heading .icon-button { width: 30px; height: 30px; }
.search-hint { margin-top: 12px; }
.search-field { transition: border-color 150ms, box-shadow 150ms; }
.search-field:focus-within { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px #0056d926; }
.search-suggestions { scrollbar-width: thin; }
.search-suggestions a { transition: background 150ms; }
.search-suggestions .product-art, .search-suggestions .software-art { width: 44px; }
.search-suggestions small { font-size: 10px; }
.icon-button { transition: background 150ms, border-color 150ms, color 150ms, transform 150ms; }
.icon-button:active { transform: scale(.95); }
#search-button[aria-expanded="true"] { color: var(--blue); background: var(--nav-tint); }
.drawer, .nav-drawer {
  transform: translateX(100%);
  transition: transform 300ms ease;
}
.drawer[open], .nav-drawer[open] { animation: none; }
.drawer.is-visible, .nav-drawer.is-visible { transform: translateX(0); }
.drawer::backdrop, .nav-drawer::backdrop {
  background: #0f172a59;
  opacity: 0;
  backdrop-filter: none;
  animation: none;
  transition: opacity 300ms;
}
.drawer.is-visible::backdrop, .nav-drawer.is-visible::backdrop { opacity: 1; }
.nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(360px, 88vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  transition-duration: 250ms;
}
.nav-drawer[open] { display: flex; flex-direction: column; }
.nav-drawer::backdrop { background: #0f172a99; transition-duration: 250ms; }
.mobile-nav-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mobile-nav-head strong { font-size: 16px; }
.mobile-nav-head .icon-button { width: 36px; height: 36px; }
.mobile-nav-slot { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mobile-nav-foot { padding: 20px; border-top: 1px solid var(--line); }
.mobile-nav-foot p { margin-bottom: 12px; font-size: 13px; color: var(--sub); }
.mobile-nav-foot .button { width: 100%; }
.button { transition: transform 250ms cubic-bezier(.2,.8,.2,1), box-shadow 250ms, background 150ms, border-color 150ms; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px #0078ff2e; }
.button:active { transform: translateY(0) scale(.97); box-shadow: 0 1px 3px #10294d26; }
.hero-copy, .app-panel, .section-entered { animation: none; }
.app-panel { aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 24px; border-radius: 16px; background: linear-gradient(135deg,#e8f0fe,#c7ddff); box-shadow: var(--lift-shadow); }
.panel-top, .panel-bottom { display: none; }
.app-grid { margin: 0; gap: 16px; }
.app-tile { border-radius: 12px; transition: transform var(--motion-base); }
.app-tile:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 12px 24px #0f172a26; }
.product { border-radius: 12px; animation: none; transition: transform var(--motion-base), box-shadow var(--motion-base), border-color var(--motion-base); }
.product:hover, .product:focus-within { transform: translateY(-4px); border-color: var(--blue); box-shadow: var(--lift-shadow); }
.product:hover .product-visual > .product-art, .product:hover .product-visual > .software-art { transform: none; }
.collection-card { border-radius: 16px; transition: transform var(--motion-base), box-shadow var(--motion-base), border-color var(--motion-base); }
.collection-card:hover, .collection-card:focus-visible { transform: translateY(-4px); box-shadow: var(--lift-shadow); border-color: var(--blue); }
.collection-card:hover .collection-glyph { transform: none; }
.guide-card { transition: transform var(--motion-base), box-shadow var(--motion-base), border-color var(--motion-base); }
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--lift-shadow); }
.accordion-body { display: flow-root; overflow: hidden; }
.faq-list details[open] p { animation: none; }
.faq-list summary::after { content: '+'; transition: transform 200ms; }
.faq-list details[open] summary::after { content: '+'; transform: rotate(45deg); }
.faq-list summary, .store-info summary { transition: color 150ms; }
.faq-list summary:hover, .store-info summary:hover { color: var(--blue); }
[data-theme="dark"] { --nav-tint: #1c3050; --lift-shadow: 0 12px 24px #0008, 0 4px 8px #0005; }
[data-theme="dark"] .mega-menu { box-shadow: 0 16px 48px #0008; }
[data-theme="dark"] .app-panel { background: linear-gradient(135deg,#172554,#1e3a8a); }
@media (min-width: 1441px) { .mega-inner { padding-inline: 32px; } }
@media (min-width: 901px) and (max-width: 1150px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 10px; }
  #nav { gap: 0; justify-content: center; }
  .nav-trigger, #nav > .nav-contact { padding-inline: 10px; font-size: 13px; }
  .mega-inner { gap: 20px; padding-inline: 28px; }
}
@media (max-width: 900px) {
  .header.scrolled .header-inner { height: 60px; }
  #nav { display: flex; flex-direction: column; align-items: stretch; padding: 16px; max-height: none; border: 0; box-shadow: none; background: transparent; }
  .nav-trigger, #nav > .nav-contact { display: flex; width: 100%; justify-content: space-between; padding: 14px 16px; font-size: 15px; }
  .mega-menu {
    display: grid;
    grid-template-rows: 0fr;
    position: static;
    width: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    transform: none;
    transition: grid-template-rows 200ms, opacity 200ms, visibility 200ms;
  }
  .mega-menu::before { display: none; }
  .nav-menu.is-open > .mega-menu { grid-template-rows: 1fr; }
  .mega-clip { min-height: 0; max-height: none; overflow: hidden; }
  .mega-inner { display: block; padding: 10px 0 12px 12px; }
  .mega-column { padding-bottom: 16px; }
  .mega-column:last-of-type { padding-bottom: 4px; }
  .mega-column > h2 { margin-block: 8px; font-size: 11px; }
  #nav .mega-links a { padding: 10px 12px; font-size: 13px; }
  .mega-feature { display: none; }
  .mega-post-icon { flex-basis: 40px; height: 40px; font-size: 20px; }
  .mega-post strong { font-size: 13px; }
  .mega-post small { font-size: 11px; }
  .nav-contact { margin-top: 6px; }
  .search-host { position: static; }
  .search-dialog { inset: calc(100% + 1px) 16px auto auto; width: min(400px,calc(100vw - 32px)); max-height: calc(100dvh - 150px); }
}
@media (max-width: 740px) {
  .header-inner { grid-template-columns: minmax(0,1fr) auto auto; }
  .header.scrolled .header-inner { height: 58px; }
  #nav a { background: transparent; }
  .app-panel { width: min(100%,350px); }
  .app-grid { gap: 12px; }
  .search-dialog { border-radius: 0 0 12px 12px; inset-inline: 0; width: 100%; max-width: none; }
  /* Global mobile nav styles in the original stylesheet must not hide breadcrumbs. */
  .breadcrumbs { position: static; display: flex; box-shadow: none; border: 0; padding: 0; background: transparent; }
  .breadcrumbs a { padding: 0; background: none; }
}
@media (hover: none) {
  .product:hover, .collection-card:hover, .guide-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
