/* ==========================================================================
   NEXA CODE — components.css
   Header · navigation · buttons · marquee · forms · dialogs · palette ·
   cursor · toast · footer & shared interface atoms
   ========================================================================== */

/* --------------------------------------------------------------------------
   SCROLL PROGRESS
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 220;
  background: var(--fg);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  will-change: transform;
  mix-blend-mode: difference;
}

/* --------------------------------------------------------------------------
   CUSTOM CURSOR (pointer: fine only; disabled by user preference)
   -------------------------------------------------------------------------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  pointer-events: none;
  display: none;
  mix-blend-mode: difference;
  color: #fff;
}
.cursor__ring,
.cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor__ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  display: grid;
  place-items: center;
  transition: width 280ms var(--ease), height 280ms var(--ease),
    margin 280ms var(--ease), background-color 280ms var(--ease),
    border-color 280ms var(--ease), opacity 200ms linear;
}
.cursor__dot {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #fff;
}
.cursor__label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 180ms linear, transform 260ms var(--ease);
}
body.has-cursor .cursor {
  display: block;
}
body.has-cursor.cursor-ready .cursor__ring,
body.has-cursor.cursor-ready .cursor__dot {
  opacity: 1;
}
body.has-cursor,
body.has-cursor a,
body.has-cursor button {
  cursor: none;
}
body.has-cursor input,
body.has-cursor textarea,
body.has-cursor select {
  cursor: auto;
}
.cursor.is-hover .cursor__ring {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
}
.cursor.is-label .cursor__ring {
  width: 78px;
  height: 78px;
  margin: -39px 0 0 -39px;
  background: #fff;
  border-color: #fff;
}
.cursor.is-label .cursor__label {
  opacity: 1;
  transform: none;
  color: #000;
}
.cursor.is-label .cursor__dot {
  opacity: 0;
}
.cursor.is-press .cursor__ring {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
}
.cursor.is-hidden .cursor__ring,
.cursor.is-hidden .cursor__dot {
  opacity: 0;
}
@media (hover: none), (pointer: coarse) {
  .cursor {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 400ms var(--ease), border-color 400ms var(--ease),
    backdrop-filter 400ms var(--ease);
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 400ms var(--ease);
  z-index: -1;
}
.site-header.is-stuck::before {
  opacity: 0.86;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(0.9);
  -webkit-backdrop-filter: blur(18px) saturate(0.9);
}
.site-header.is-hidden {
  transform: translateY(-101%);
}
.site-header {
  transition-property: background-color, border-color, backdrop-filter, transform;
  transition-duration: 400ms, 400ms, 400ms, 500ms;
  transition-timing-function: var(--ease);
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  line-height: 1;
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--fg);
  transition: transform 700ms var(--ease);
}
.brand:hover .brand__mark {
  transform: rotate(-8deg);
}
.brand__type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  justify-self: center;
}
.main-nav a {
  position: relative;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 240ms linear;
  white-space: nowrap;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 360ms var(--ease);
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
  color: var(--fg);
}
.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.main-nav a.is-active {
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg-muted);
  transition: color 240ms linear, border-color 240ms linear,
    background-color 240ms linear, transform 240ms var(--ease);
}
.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--surface);
}
.icon-btn:active {
  transform: scale(0.93);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn--square {
  border-radius: var(--radius);
  width: 42px;
  height: 34px;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  color: var(--fg-faint);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  transition: background-color 260ms var(--ease), color 260ms var(--ease),
    border-color 260ms var(--ease);
  white-space: nowrap;
}
.header-cta svg {
  width: 13px;
  height: 13px;
  transition: transform 320ms var(--ease);
}
.header-cta:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.header-cta:hover svg {
  transform: translate(2px, -2px);
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  color: var(--fg);
}
.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 1px;
  margin-left: -7px;
  background: currentColor;
  transition: transform 360ms var(--ease), opacity 200ms linear;
}
.menu-toggle span:nth-child(1) {
  top: 16px;
}
.menu-toggle span:nth-child(2) {
  top: 21px;
}
.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(2.5px) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  transform: translateY(-2.5px) rotate(-45deg);
}

/* mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  padding: calc(var(--header-h) + 32px) var(--gutter) 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer.is-open {
  display: flex;
  animation: drawer-in 420ms var(--ease);
}
@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
.drawer__nav {
  display: flex;
  flex-direction: column;
}
.drawer__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 44px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
}
.drawer__link small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}
.drawer__link:active {
  color: var(--fg-muted);
}
.drawer__foot {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer__foot .meta-row {
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 320ms var(--ease), border-color 320ms var(--ease),
    background-color 320ms var(--ease), transform 320ms var(--ease);
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}
.btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 360ms var(--ease);
}
.btn:hover svg {
  transform: translate(2px, -2px);
}
.btn:active {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(0.985);
}
.btn--solid {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn--solid:hover {
  background: transparent;
  color: var(--fg);
}
.btn--outline {
  border-color: var(--line-strong);
  color: var(--fg);
  background: transparent;
}
.btn--outline:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}
.btn--bone {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
}
.btn--bone:hover {
  background: transparent;
  color: var(--bone);
}
.btn--sm {
  min-height: 42px;
  padding: 0 18px;
  font-size: 9px;
}
.btn--lg {
  min-height: 60px;
  padding: 0 32px;
}
.btn--wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 240ms linear, gap 280ms var(--ease);
}
.link-arrow:hover {
  color: var(--fg);
  gap: 12px;
}
.link-arrow svg {
  width: 12px;
  height: 12px;
}

/* --------------------------------------------------------------------------
   TAGS / CHIPS / BADGES
   -------------------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: transparent;
  transition: border-color 240ms linear, color 240ms linear;
}
.tag:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}
.tag--solid {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bone);
  box-shadow: 0 0 0 0 rgba(233, 229, 218, 0.5);
  animation: pulse-dot 2.6s var(--ease-in-out) infinite;
  position: relative;
  flex: none;
}
.scheme-bone .status-dot,
html[data-theme='bone'] .status-dot {
  background: var(--ink);
  box-shadow: 0 0 0 0 rgba(8, 8, 8, 0.3);
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.25;
  animation: spin-slow 8s linear infinite;
  border-style: dashed;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   MARQUEE
   -------------------------------------------------------------------------- */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 18px;
  user-select: none;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee--flush {
  border-block: 0;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: marquee-x var(--speed, 44s) linear infinite;
  will-change: transform;
}
.marquee[data-direction='right'] .marquee__track {
  animation-direction: reverse;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
.marquee__group {
  display: flex;
  align-items: center;
  flex: none;
}
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding-right: 26px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 34px);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}
.marquee__item i {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.5em;
  color: var(--fg-faint);
  transform: translateY(-0.15em);
}
.marquee--small .marquee__item {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 400;
  gap: 18px;
  padding-right: 18px;
}
.marquee--outline .marquee__item {
  color: transparent;
  -webkit-text-stroke: 1px var(--fg-muted);
}

/* --------------------------------------------------------------------------
   ACCORDION (shared)
   -------------------------------------------------------------------------- */
.acc {
  border-top: 1px solid var(--line);
}
.acc__item {
  border-bottom: 1px solid var(--line);
}
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  text-align: left;
  color: var(--fg);
  transition: color 240ms linear;
}
.acc__btn:hover {
  color: var(--fg);
}
.acc__title {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.7vw, 21px);
  font-weight: 300;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.acc__title span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}
.acc__icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
}
.acc__icon::before,
.acc__icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  transition: transform 380ms var(--ease), opacity 240ms linear;
}
.acc__icon::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}
.acc__icon::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}
.acc__btn[aria-expanded='true'] .acc__icon::after {
  transform: scaleY(0);
}
.acc__btn[aria-expanded='true'] .acc__icon::before {
  transform: rotate(180deg);
}
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 520ms var(--ease);
}
.acc__panel > div {
  overflow: hidden;
}
.acc__item.is-open .acc__panel {
  grid-template-rows: 1fr;
}
.acc__body {
  padding: 0 0 24px;
  max-width: 64ch;
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   FORMS
   -------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.field__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.field__label em {
  font-style: normal;
  opacity: 0.7;
}
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 260ms var(--ease), background-color 260ms var(--ease);
}
.field__input::placeholder {
  color: var(--fg-ghost);
}
.field__input:hover {
  border-bottom-color: var(--line-strong);
}
.field__input:focus {
  outline: none;
  border-bottom-color: var(--fg);
}
.field__input:focus-visible {
  outline: none;
}
textarea.field__input {
  min-height: 120px;
  resize: vertical;
  padding-top: 12px;
}
select.field__input {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) calc(50% + 3px),
    calc(100% - 5px) calc(50% + 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
select.field__input option {
  background: var(--bg);
  color: var(--fg);
}
.field.is-invalid .field__input {
  border-bottom-color: var(--fg);
}
.field.is-invalid .field__label {
  color: var(--fg);
}
.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
}
.field__error svg {
  width: 12px;
  height: 12px;
  flex: none;
}
.field__count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  text-align: right;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  cursor: pointer;
  position: relative;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check__box {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  display: grid;
  place-items: center;
  transition: background-color 220ms linear, border-color 220ms linear;
}
.check__box svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 200ms linear, transform 260ms var(--ease-spring);
}
.check input:checked + .check__box {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.check input:checked + .check__box svg {
  opacity: 1;
  transform: none;
}
.check input:focus-visible + .check__box {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.check a,
.inline-link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.check a:hover,
.inline-link:hover {
  text-decoration-thickness: 2px;
}
.form__note {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--fg-faint);
}
.form__status {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.55;
}
.form__status svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}
.form__status--ok {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.form__status--err {
  border-style: dashed;
}

/* range slider (lab + shared) */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line-strong);
}
.range::-moz-range-track {
  height: 1px;
  background: var(--line-strong);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--fg);
  border: 0;
  transition: transform 200ms var(--ease);
}
.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}
.range:hover::-webkit-slider-thumb {
  transform: scale(1.25);
}
.range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   DIALOGS
   -------------------------------------------------------------------------- */
.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--fg);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
}
.modal[open] {
  animation: modal-in 420ms var(--ease);
}
.modal::backdrop {
  background: rgba(4, 4, 4, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdrop-in 300ms linear;
}
.modal--wide {
  width: min(880px, calc(100vw - 32px));
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg-muted);
  transition: color 200ms linear, border-color 200ms linear,
    transform 300ms var(--ease);
}
.modal__close:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  transform: rotate(90deg);
}
.modal__close svg {
  width: 14px;
  height: 14px;
}
.modal h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-top: 12px;
}
.modal__lead {
  margin-top: 16px;
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 60ch;
}
.modal__body {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.modal__actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.modal__scroll {
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.modal__scroll::-webkit-scrollbar {
  width: 4px;
}
.modal__scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
}
.doc-section h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 8px;
}
.doc-section p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-muted);
}
.doc-section a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* --------------------------------------------------------------------------
   COMMAND PALETTE
   -------------------------------------------------------------------------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(60px, 12vh, 140px) 16px 16px;
  background: rgba(4, 4, 4, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms linear, visibility 240ms;
}
.palette.is-open {
  opacity: 1;
  visibility: visible;
}
.palette__panel {
  width: min(660px, 100%);
  background: var(--ink);
  color: #f4f2ec;
  border: 1px solid rgba(244, 242, 236, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(-14px) scale(0.99);
  transition: transform 320ms var(--ease);
  --fg: #f4f2ec;
  --fg-muted: rgba(244, 242, 236, 0.6);
  --fg-faint: rgba(244, 242, 236, 0.4);
  --line: rgba(244, 242, 236, 0.14);
  --line-strong: rgba(244, 242, 236, 0.3);
  --surface: rgba(255, 255, 255, 0.06);
  --bg: #080808;
}
.palette.is-open .palette__panel {
  transform: none;
}
.palette__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.palette__search svg {
  width: 16px;
  height: 16px;
  color: var(--fg-faint);
  flex: none;
}
.palette__input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 16px;
  padding: 4px 0;
}
.palette__input::placeholder {
  color: var(--fg-faint);
}
.palette__input:focus {
  outline: none;
}
.palette__list {
  max-height: min(46vh, 420px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}
.palette__group-label {
  padding: 10px 12px 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.palette__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 3px;
  text-align: left;
  color: var(--fg-muted);
  font-size: 13.5px;
  transition: background-color 160ms linear, color 160ms linear;
}
.palette__item svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.75;
}
.palette__item span {
  flex: 1;
}
.palette__item kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-faint);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 5px;
}
.palette__item.is-active,
.palette__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
}
.palette__empty {
  padding: 24px 14px 30px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-align: center;
}
.palette__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  flex-wrap: wrap;
}
.palette__foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.palette__foot kbd {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 1px 4px;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   TOAST
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 280;
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms linear, transform 340ms var(--ease),
    visibility 240ms;
  max-width: calc(100vw - 32px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.toast svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.site-footer__cta {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  padding-block: clamp(56px, 8vw, 104px) clamp(32px, 4vw, 56px);
}
.site-footer__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.site-footer__cta-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.footer-mail {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(17px, 1.9vw, 24px);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  transition: border-color 260ms linear;
}
.footer-mail:hover {
  border-color: var(--fg);
}
.footer-mail svg {
  width: 16px;
  height: 16px;
}
.footer-wordmark {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 0.78;
  padding-block: 8px 0;
  user-select: none;
}
.footer-wordmark svg {
  width: 100%;
  height: auto;
  color: var(--fg);
}
.footer-wordmark text {
  font-family: var(--font-display);
  font-weight: 300;
  fill: currentColor;
  letter-spacing: -0.03em;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 0.7fr));
  gap: 32px;
  padding-block: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 4px;
}
.footer-col a,
.footer-col button {
  align-self: flex-start;
  font-size: 13px;
  color: var(--fg-muted);
  transition: color 200ms linear;
  text-align: left;
}
.footer-col a:hover,
.footer-col button:hover {
  color: var(--fg);
}
.footer-col p {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 30ch;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-brand .brand {
  justify-self: start;
}
.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.footer-base__right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  transition: color 200ms linear;
}
.to-top:hover {
  color: var(--fg);
}
.to-top svg {
  width: 12px;
  height: 12px;
}

/* --------------------------------------------------------------------------
   BODY LOCKS / SVG DEFS
   -------------------------------------------------------------------------- */
body.modal-open,
body.drawer-open {
  overflow: hidden;
}
html:has(body.modal-open),
html:has(body.drawer-open) {
  overflow: hidden;
}
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   NOSCRIPT
   -------------------------------------------------------------------------- */
.noscript {
  position: relative;
  z-index: 210;
  margin-top: var(--header-h);
  padding: 12px var(--gutter);
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}
.noscript a {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — shared chrome
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }
  .header-inner {
    grid-template-columns: 1fr auto;
  }
  .menu-toggle {
    display: block;
  }
  .header-cta {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }
  .site-footer__cta {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 68px;
  }
  .brand__sub {
    display: none;
  }
  .brand__mark {
    width: 26px;
    height: 26px;
  }
  .brand__name {
    font-size: 12px;
  }
  .icon-btn--square {
    display: none;
  }
  .form__grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-base {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
  }
  .marquee {
    padding-block: 14px;
  }
  .modal {
    width: calc(100vw - 20px);
    max-height: 90vh;
    padding: 22px 18px;
  }
  .cursor {
    display: none !important;
  }
}
