/* magic.css: the soft, living layer shared by the MITI and IPMS sites. The Magic UI ideas in plain CSS:
   blur-fade, text-animate, letters that assemble, a hand-drawn highlighter, a marquee, a number ticker, word
   rotate, a spotlight card, a shiny and magnetic button, a gliding nav line, pictures that unveil and drift,
   a stamp that presses. Nothing hides without magic.js (it sets html.mg-ready), and reduced motion rests
   everything in its finished state. Colours come from the page's own tokens. */

:root { --mg-ease: cubic-bezier(.22, 1, .36, 1); --mg-spring: cubic-bezier(.34, 1.56, .64, 1);
        --mg-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 22px 44px -26px rgba(16, 24, 40, .32); }
.mg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- logo: a small mark and the name ---------- */
.mg-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mg-logo__mark { width: 32px; height: 32px; flex: none; display: block; overflow: visible; transition: transform .6s var(--mg-spring); }
.mg-logo__name { font: 600 20px/1 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; }
.mg-logo__name small { font: inherit; font-weight: 400; color: var(--muted); margin-left: .26em; letter-spacing: -0.01em; }
@media (max-width: 639px) { .mg-logo__name { font-size: 18px; } .mg-logo__mark { width: 28px; height: 28px; } .mg-logo { gap: 8px; } }
@media (max-width: 359px) { .nav .mg-logo__name small { display: none; } }

/* ---------- chips: a small rounded line above a heading, the open-now status ---------- */
.mg-chip, .section-head p.mg-chip { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 7px 16px 7px 12px; border-radius: 999px;
           background: color-mix(in oklab, var(--ink) 5%, var(--bg)); border: 1px solid color-mix(in oklab, var(--ink) 9%, transparent);
           font: 500 14px/1.2 var(--font-text); color: var(--ink); letter-spacing: 0; }
.mg-chip b { font-weight: 600; color: var(--accent); }
.mg-chip__sep { width: 1px; height: 14px; background: color-mix(in oklab, var(--ink) 18%, transparent); flex: none; }
.mg-chip__muted { color: var(--muted); }
.section-head > .mg-chip, .mo-pc__text > .mg-chip { margin-bottom: var(--s-2); }
.mg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.mg-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transition: background-color .3s ease; }
.mg-chip.is-open .mg-pulse { background: #2f9e6a; }
.mg-chip.is-open .mg-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #2f9e6a; opacity: 0; animation: mg-ping 2.4s var(--mg-ease) infinite; }
@keyframes mg-ping { 0% { transform: scale(.55); opacity: .75; } 100% { transform: scale(1.9); opacity: 0; } }
/* a phone: the second hero button stays a soft pill (the kit turns it into an underlined link there) */
@media (max-width: 639px) { html[data-buttons="pill"] .btn-row > .btn--secondary { text-decoration: none; background: color-mix(in oklab, var(--ink) 8%, var(--bg)); } }

/* ---------- text-animate: a heading's words rise out of a blur when it comes on screen ---------- */
html.mg-ready .mg-words .mg-w { display: inline-block; opacity: 0; transform: translateY(.3em); filter: blur(8px); }
html.mg-ready .mg-words.is-in .mg-w { animation: mg-word .85s var(--mg-ease) forwards; animation-delay: calc(var(--i) * 55ms); }
@keyframes mg-word { to { opacity: 1; transform: none; filter: none; } }

/* ---------- letters that assemble: a big word, one letter after another ---------- */
html.mg-ready [data-letters] .mg-l { display: inline-block; opacity: 0; transform: translateY(.35em) rotate(6deg); filter: blur(12px); }
html.mg-ready [data-letters].is-in .mg-l { animation: mg-letter 1.1s var(--mg-spring) forwards; animation-delay: calc(var(--i) * 80ms); }
@keyframes mg-letter { 60% { filter: blur(0); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- highlighter: a hand-drawn line under the key words, drawn from left to right. The line is the
   mark's own background (--mg-mark-img, an SVG of the site's colour), so the words stay plain text ---------- */
.mg-mark { white-space: nowrap; padding-bottom: .14em; background-image: var(--mg-mark-img); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% .3em; }
html.mg-ready .mg-mark { background-size: 0% .3em; transition: background-size 1.1s var(--mg-ease) var(--mg-mark-delay, 0ms); }
html.mg-ready .mg-mark.is-in { background-size: 100% .3em; }

/* ---------- word rotate: one word swaps for the next with a soft blur ---------- */
.mg-rotate { display: inline-grid; justify-items: start; }
.mg-rotate > span { grid-area: 1 / 1; white-space: nowrap; transition: opacity .5s ease, transform .6s var(--mg-ease), filter .5s ease; }
.mg-rotate > span:not(.is-on) { opacity: 0; transform: translateY(.6em); filter: blur(5px); }
.mg-rotate > span.is-out { transform: translateY(-.6em); }
.mg-rotate:not(:has(.is-on)) > span:first-child { opacity: 1; transform: none; filter: none; }

/* ---------- blur-fade: a part arrives once, softly, when it comes on screen ---------- */
html.mg-ready [data-reveal]:not(.is-in) { opacity: 0; }
html.mg-ready [data-reveal].is-in { animation: mg-rise .9s var(--mg-ease) backwards; animation-delay: calc(var(--d, 0) * 80ms); }
@keyframes mg-rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

/* ---------- unveil: a photograph opens from a smaller rounded window and settles from 1.12 ---------- */
html.mg-ready [data-unveil] { transition: clip-path 1s var(--mg-ease) calc(var(--d, 0) * 90ms); clip-path: inset(0 round var(--mg-r, 24px)); }
html.mg-ready [data-unveil]:not(.is-in) { clip-path: inset(4% 3% round 36px); }
/* drift: inside its frame the photograph moves a little slower than the page (magic.js sets its translate) */
[data-parallax] { overflow: clip; }
[data-parallax] img { scale: 1.1; }
html.mg-ready [data-unveil][data-parallax]:not(.is-in) img { scale: 1.22; }

/* ---------- spotlight card: a soft light follows the pointer, and the card's edge lights up near it ---------- */
.mg-spot { position: relative; isolation: isolate; }
.mg-spot::before, .mg-spot::after { content: ""; position: absolute; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .45s ease; }
.mg-spot::before { inset: 0; z-index: -1; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--mg-spot, var(--accent)) 13%, transparent), transparent 70%); }
.mg-spot::after { inset: -1px; padding: 1px; background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--mg-spot, var(--accent)) 75%, transparent), transparent 70%);
                  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
@media (hover: hover) and (pointer: fine) { .mg-spot:hover::before, .mg-spot:hover::after { opacity: 1; } }

/* ---------- marquee: a slow band of real words; it pauses under the pointer ---------- */
.mg-band { overflow: hidden; padding-block: var(--s-4); -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.mg-marquee { --g: 12px; display: flex; gap: var(--g); width: max-content; animation: mg-scroll var(--mg-speed, 60s) linear infinite; }
.mg-band:hover .mg-marquee { animation-play-state: paused; }
.mg-marquee > ul { display: flex; gap: var(--g); margin: 0; padding: 0; list-style: none; }
.mg-marquee li { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px 0 16px; border-radius: 999px; white-space: nowrap;
                 background: color-mix(in oklab, #fff 45%, var(--bg)); border: 1px solid color-mix(in oklab, var(--ink) 9%, transparent);
                 font: 500 16px/1 var(--font-text); color: var(--ink); transition: background-color .3s ease, border-color .3s ease; }
.mg-marquee li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.mg-marquee li:hover { background: color-mix(in oklab, #fff 75%, var(--bg)); border-color: color-mix(in oklab, var(--accent) 40%, transparent); }
@keyframes mg-scroll { to { transform: translateX(calc(-50% - var(--g) / 2)); } }

/* ---------- shiny, magnetic button: a sheen crosses the primary on hover (now and then on the hero's), and on
   a mouse it leans a few pixels toward the pointer (magic.js sets its translate) ---------- */
html .btn.btn--primary { background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%); background-size: 250% 100%; background-position: 135% 0; background-repeat: no-repeat; }
html:not([data-motion="off"]) .btn.btn--primary {
  transition: background-color var(--m-out, .2s) var(--m-ease, ease), color var(--m-out, .2s) var(--m-ease, ease), border-color var(--m-out, .2s) var(--m-ease, ease),
              box-shadow var(--m-out, .2s) var(--m-ease, ease), transform var(--m-press, .12s) var(--m-ease, ease), translate .5s var(--mg-spring);
}
@media (hover: hover) {
  html:not([data-motion="off"]) .btn.btn--primary:hover {
    background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%); background-size: 250% 100%; background-repeat: no-repeat;
    background-position: -35% 0; box-shadow: 0 12px 26px -14px color-mix(in oklab, var(--action) 75%, transparent);
    transition: background-color var(--m-in, .2s) var(--m-ease, ease), color var(--m-in, .2s) var(--m-ease, ease), border-color var(--m-in, .2s) var(--m-ease, ease),
                box-shadow .35s var(--mg-ease), transform var(--m-press, .12s) var(--m-ease, ease), background-position 1s var(--mg-ease), translate .25s var(--mg-ease);
  }
}
html.mg-ready .hero .btn.btn--primary:not(:hover) { animation: mg-sheen 7s ease-in-out 2.6s infinite; }
@keyframes mg-sheen { 0%, 80% { background-position: 135% 0; } 100% { background-position: -35% 0; } }

/* ---------- the nav: the word of the section on screen keeps its line, in the accent ---------- */
.nav__links .nav__link.is-current { color: var(--accent); }
.nav__links .nav__link.is-current::before { transform: scaleX(1); transform-origin: left; }

/* ---------- dot pattern (as a ::before of a part, so it is never a box of its own) ---------- */
.mg-dotfield { position: relative; isolation: isolate; }
.mg-dotfield::before { content: ""; position: absolute; z-index: -1; pointer-events: none; inset: var(--mg-dots-inset, 0);
  background-image: radial-gradient(var(--mg-dots-c, color-mix(in oklab, var(--ink) 24%, transparent)) 1.1px, transparent 1.5px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse var(--mg-dots-w, 50%) var(--mg-dots-h, 60%) at var(--mg-dots-x, 70%) var(--mg-dots-y, 50%), #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse var(--mg-dots-w, 50%) var(--mg-dots-h, 60%) at var(--mg-dots-x, 70%) var(--mg-dots-y, 50%), #000 0%, transparent 72%); }

/* ---------- a stamp presses into the page when it comes on screen ---------- */
html.mg-ready [data-press]:not(.is-in) { opacity: 0; }
html.mg-ready [data-press].is-in { animation: mg-press .75s cubic-bezier(.2, .9, .3, 1.15) .25s backwards; }
@keyframes mg-press { from { opacity: 0; scale: 1.6; } 65% { scale: .97; } }

/* ---------- soft cards, icon tiles, photo tags ---------- */
.mg-card { background: color-mix(in oklab, #fff 50%, var(--bg)); border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent); border-radius: 20px;
           box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: transform .4s var(--mg-ease), box-shadow .4s var(--mg-ease), border-color .3s ease, background-color .3s ease; }
@media (hover: hover) { .mg-card:hover { transform: translateY(-3px); box-shadow: var(--mg-shadow); border-color: color-mix(in oklab, var(--ink) 14%, transparent); } }
.mg-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
           background: color-mix(in oklab, var(--accent) 11%, var(--bg)); color: var(--accent); transition: transform .5s var(--mg-spring), background-color .3s ease, color .3s ease; }
.mg-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { :is(.mg-card, .mg-spot):hover > .mg-icon { transform: rotate(-8deg) scale(1.07); background: var(--accent); color: var(--p-accent-ink, #fff); } }
.mg-tag { position: absolute; left: 14px; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 999px;
          background: color-mix(in oklab, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
          font: 500 14px/1 var(--font-text); color: var(--ink); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35); }
.mg-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
:is(.frame, figure) > .mg-tag { position: absolute; }

/* ---------- page bar: a thin line of the brand's colour along the top that grows as the page is read ---------- */
.mg-pagebar { position: fixed; z-index: 80; left: 0; top: 0; width: 100%; height: 3px; pointer-events: none; background: var(--mg-bar, var(--accent));
              transform-origin: 0 50%; transform: scaleX(var(--mg-page, 0)); border-radius: 0 3px 3px 0; }

/* ---------- decode: a heading's letters settle out of random characters, left to right (magic.js) ---------- */
html.mg-ready .mg-decode .mg-c { opacity: 0; }
html.mg-ready .mg-decode .mg-c.is-scr { opacity: 1; color: var(--mg-scramble, var(--accent)); }
html.mg-ready .mg-decode .mg-c.is-ok { opacity: 1; }
.mg-decode .mg-c { display: inline-block; text-align: center; white-space: pre; }

/* ---------- border beam: a short light runs round a card's edge ---------- */
@property --mg-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.mg-beam { position: relative; isolation: isolate; }
.mg-beam::before { content: ""; position: absolute; inset: -1px; z-index: 2; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--mg-a), transparent 0 64%, color-mix(in oklab, var(--mg-beam, var(--accent)) 60%, transparent) 78%, var(--mg-beam, var(--accent)) 86%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: mg-beam 5.5s linear infinite; }
@keyframes mg-beam { to { --mg-a: 360deg; } }

/* ---------- the inquiry: a soft card with the form, and its finale (each site draws its own, page CSS) ---------- */
footer.closing.mg-grow { height: auto; min-height: 100vh; min-height: 100svh; }
footer.closing.mg-grow > .wrap { height: auto; grid-template-rows: auto auto; }
.mg-close__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--s-7); align-items: start; }
.mg-close__grid > .section-head { grid-column: 1 / span 6; }
.mg-close__grid > .mg-formcard { grid-column: var(--mg-card-col, 7 / -1); }
.mg-close__grid > .section-head { display: grid; gap: var(--s-5); align-content: start; }
@media (max-width: 1023px) { .mg-close__grid > :is(.section-head, .mg-formcard) { grid-column: 1 / -1; } }
.mg-formcard { position: relative; isolation: isolate; border-radius: 28px; padding: clamp(22px, 3vw, 40px); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .08); }
.mg-formcard__head { display: flex; justify-content: space-between; gap: var(--s-4); font: 500 13px/1.3 var(--font-text); color: var(--muted); padding-bottom: var(--s-4); margin-bottom: var(--s-6); border-bottom: 1px solid var(--accent); }
.mg-formcard__head b { font-weight: 600; color: var(--ink); }
.mg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-4); }
.mg-form > :is(.field--full, .mg-check, .mg-form__foot) { grid-column: 1 / -1; }
.mg-form .field label { font: 500 14px/1.3 var(--font-text); color: var(--ink); }
.mg-form .field label small { font: inherit; font-weight: 400; color: var(--muted); }
.mg-form .field :is(input, textarea) { border-radius: 14px; background: color-mix(in oklab, #fff 72%, var(--bg)); border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease; }
.mg-form .field textarea { min-height: 128px; }
.mg-form .field :is(input, textarea):hover { border-color: color-mix(in oklab, var(--ink) 30%, transparent); }
.mg-form .field :is(input, textarea):focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent); }
.mg-form .field :is(input, textarea)[aria-invalid="true"] { border: 2px solid var(--error, #b42318); }
.mg-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; font: 400 14px/1.5 var(--font-text); color: var(--muted); cursor: pointer; }
.mg-check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid color-mix(in oklab, var(--ink) 32%, transparent);
  background: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.mg-check input::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); transition: transform .3s var(--mg-spring); }
.mg-check input:checked { background: var(--accent); border-color: var(--accent); }
.mg-check input:checked::after { transform: rotate(-45deg) scale(1); }
.mg-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mg-check input[aria-invalid="true"] { border: 2px solid var(--error, #b42318); }
.mg-check a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mg-check .field__error { grid-column: 2; margin: 0; }
.mg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mg-form__foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-5); padding-top: var(--s-2); }
.mg-form__status { margin: 0; font: 500 14px/1.45 var(--font-text); color: var(--muted); }
.mg-form__status:empty { display: none; }
.mg-form__note { margin: 0; font: 400 14px/1.45 var(--font-text); color: var(--muted); }
.mg-done__text a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.mg-formcard[data-state="failed"] .mg-form__status { color: var(--error, #b42318); }
.mg-form__mailto { display: flex; width: fit-content; align-items: center; height: 38px; margin-top: var(--s-3); padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--p-accent-ink, #fff);
                   font: 500 14px/1 var(--font-text); text-decoration: none; transition: filter .2s ease; }
.mg-form__mailto:hover { filter: brightness(1.08); }
.mg-formcard[data-state="sending"] .mg-form [type="submit"] { cursor: progress; opacity: .85; }
.mg-formcard[data-state="leaving"] .mg-form { animation: mg-leave .42s ease forwards; }
@keyframes mg-leave { to { opacity: 0; transform: translateY(-8px) scale(.98); filter: blur(6px); } }
.mg-done { display: grid; justify-items: center; text-align: center; gap: var(--s-3); padding-block: var(--s-6) var(--s-4); }
.mg-done[hidden] { display: none; }
.mg-done:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 18px; }
.mg-done__title { margin: 0; font: 500 clamp(24px, 2.4vw, 32px)/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.mg-done__text { margin: 0; max-width: 38ch; color: var(--muted); }
@media (max-width: 639px) { .mg-form { grid-template-columns: minmax(0, 1fr); } .mg-form__foot .btn { width: 100%; } .mg-formcard { border-radius: 22px; } }

/* ---------- the intro on a first visit: the logo for a moment, then the page is uncovered from the bottom up.
   The page's head line sets html.mg-intro once per visit; the cover ends invisible even without script ---------- */
.mg-intro { display: none; }
html.mg-intro-on .mg-intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--mg-intro-bg, var(--bg));
  animation: mg-intro-out .35s ease .85s forwards; }
.mg-intro__mark { width: 88px; height: 88px; overflow: visible; }
@keyframes mg-intro-out { to { opacity: 0; visibility: hidden; } }
@keyframes mg-intro-mark { to { transform: translateY(-24px) scale(.9); opacity: 0; } }

/* ---------- small shared keyframes ---------- */
@keyframes mg-pop { from { transform: scale(0); } }
@keyframes mg-float { 50% { transform: translateY(-7px); } }

/* ---------- print: everything shows ---------- */
@media print {
  html.mg-ready :is([data-reveal], [data-press], [data-unveil]), html.mg-ready :is(.mg-words .mg-w, [data-letters] .mg-l) { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; clip-path: none !important; }
  html.mg-ready .mg-mark { background-size: 100% .3em; }
}

/* ---------- reduced motion: everything rests in its finished state ---------- */
@media (prefers-reduced-motion: reduce) {
  .mg-marquee { animation: none; flex-wrap: wrap; width: auto; }
  .mg-marquee > ul[aria-hidden] { display: none; }
  .mg-marquee > ul { flex-wrap: wrap; justify-content: center; }
  .mg-band { -webkit-mask-image: none; mask-image: none; }
  .mg-chip.is-open .mg-pulse::after { animation: none; }
  .mg-logo__mark, .mg-card, .mg-icon { transition: none; }
  [data-parallax] img { scale: 1; }
  .mg-beam::before { animation: none; --mg-a: 200deg; }
  .mg-formcard[data-state="leaving"] .mg-form { animation: none; opacity: 0; }
}
