:root {
  --accent-hover: #f2de4a;
  --accent-active: #c9b512;
  --error: #f0473d;
  --icon-accent-filter: brightness(0) saturate(100%) invert(77%) sepia(95%) saturate(596%) hue-rotate(7deg) brightness(96%) contrast(86%);
}

a, button, summary, input, select, textarea {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease, outline-color .2s ease;
}
.icon {
  display: block;
  flex: none;
  object-fit: contain;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}
.icon--dropdown {
  width: 4px;
  height: 4px;
}
.icon--arrow-right {
  width: 10px;
  height: 9px;
}

/* Button: Primary */
.btn--accent:hover { background: var(--accent-hover); }
.btn--accent:focus-visible {
  background: var(--accent);
  outline: 2px solid var(--primary);
  outline-offset: 0;
}
.btn--accent:active { background: var(--accent-active); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }

/* Button: Secondary */
.btn--outline:hover, .btn--outline:active { border-color: var(--primary); }
.btn--outline:focus-visible {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 0;
}

/* Button: Nav */
.nav__cta:hover { background: var(--accent); color: var(--bg); }
.nav__cta:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.nav__cta:active { background: var(--accent-active); color: var(--bg); }
.nav__cta[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* Nav Link */
.nav nav a { position: relative; padding-bottom: 4px; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--primary); }
.nav nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}
.nav nav a:focus-visible { color: var(--primary); outline: 1px solid var(--accent); outline-offset: 4px; }

/* Responsive navigation */
.nav__menu-toggle,
.nav__mobile { display: none; }
.nav__menu-toggle {
  width: 44px;
  height: 38px;
  padding: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}
.nav__menu-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform .24s ease, opacity .18s ease;
}
.nav__menu-toggle:hover,
.nav__menu-toggle:focus-visible,
.nav--menu-open .nav__menu-toggle { border-color: var(--accent); color: var(--accent); outline: none; }
body.nav-menu-open { overflow: hidden; }

/* Contact form submission states */
.form-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.form__status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 20px;
}
.form__status[hidden] { display: none; }
.form__status.is-success { color: var(--accent); }
.form__status.is-error { color: var(--error); }
.contact form.is-submitting { cursor: progress; }
.turnstile-field {
  grid-column: 1 / -1;
  height: 0;
  min-height: 0;
  overflow: hidden;
}
.turnstile-field iframe { max-width: 100%; }

@media (max-width: 1100px) {
  .nav__menu-toggle { display: grid; align-content: center; gap: 5px; }
  .nav__mobile {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: block;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    border-bottom: 1px solid var(--primary);
    background: rgba(13, 17, 32, .98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .24s ease, transform .24s ease, visibility 0s linear .24s;
  }
  .nav--menu-open .nav__mobile {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }
  .nav .nav__mobile nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 18px;
    padding-bottom: 24px;
  }
  .nav__mobile nav > a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    color: var(--primary);
    font-size: 22px;
    line-height: 1.2;
  }
  .nav__mobile nav > a:hover,
  .nav__mobile nav > a:focus-visible { color: var(--accent); }
  .nav__mobile .nav__mobile-cta {
    align-self: flex-start;
    margin-top: 22px;
    padding: 13px 20px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
  }
  .nav__mobile .nav__mobile-cta:hover,
  .nav__mobile .nav__mobile-cta:focus-visible { background: var(--accent); color: var(--bg); }
  .nav--menu-open .nav__menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav--menu-open .nav__menu-toggle span:nth-child(2) { opacity: 0; }
  .nav--menu-open .nav__menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

@media (max-width: 620px) {
  .nav__actions > .nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 112px;
    padding-inline: 8px;
    font-size: 11px;
    line-height: 13px;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .nav__actions { gap: 6px; }
  .language-menu summary { width: 56px; }
  .nav__menu-toggle { width: 40px; }
  .nav__actions > .nav__cta { max-width: 96px; padding-inline: 6px; font-size: 10px; }
}

/* Text Field, Text Area and Dropdown */
.field input, .field textarea, .field select {
  color: var(--secondary);
}
.field input::placeholder, .field textarea::placeholder { color: var(--secondary); opacity: 1; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--primary); }
.field input:focus, .field textarea:focus, .field select:focus,
.field--open select {
  border: 2px solid var(--accent);
  padding-inline: 15px;
}
.field input:disabled, .field textarea:disabled, .field select:disabled { opacity: .5; cursor: not-allowed; }
.field--invalid input, .field--invalid textarea, .field--invalid select {
  border-color: var(--error);
  color: var(--error);
}
.field--invalid input::placeholder, .field--invalid textarea::placeholder { color: var(--error); }
.field--invalid input:focus, .field--invalid textarea:focus, .field--invalid select:focus {
  border: 1px solid var(--error);
  padding-inline: 16px;
}
.field--invalid .error { display: block; color: var(--error); }
.error { display: none; color: var(--error); }
.field--filled input, .field--filled textarea, .field--filled select { color: var(--secondary); }
.select-control { position: relative; }
.select-control select { appearance: none; padding-right: 42px; }
.select-control .select-arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--secondary);
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform .2s ease, opacity .2s ease;
}
.field--open .select-arrow { transform: translateY(-50%) rotate(180deg); }
.field:has(select:disabled) .select-arrow { opacity: .5; }

/* Footer Link */
.footer { height: auto; }
.footer__main { height: auto; min-height: 312px; padding-bottom: 56px; }
.footer__main > div:not(.footer__brand) a::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 9px;
  margin-left: 6px;
  background: url('../images/icons/arrow-right.svg') center / contain no-repeat;
  vertical-align: 0;
  transition: filter .2s ease, transform .2s ease;
}
.footer__main > div:not(.footer__brand) a:hover,
.footer__main > div:not(.footer__brand) a:focus-visible { color: var(--primary); }
.footer__main > div:not(.footer__brand) a:hover::after,
.footer__main > div:not(.footer__brand) a:focus-visible::after { filter: var(--icon-accent-filter); transform: translateX(2px); }
.footer__main > div:not(.footer__brand) a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* View Project Link */
.view-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
}
.view-project:hover, .view-project:focus-visible { color: var(--primary); }
.view-project:hover > .icon,
.view-project:focus-visible > .icon { filter: var(--icon-accent-filter); transform: translateX(2px); }
.view-project:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.work__archive { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 24px 0 64px; }
.work__archive .view-project { margin-top: 0; }

/* Case study cards (Polare, Yuchai Prairie) */
.work { height: auto; }
.project.project--case { height: auto; padding-bottom: 80px; }
.project--case header { height: auto; margin-bottom: 24px; }
.project--case h3 a:hover { color: var(--accent); }
.project--case h3 a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.project--case .project__grid { padding-top: 0; }
.project--case .project__copy .project__tagline {
  margin: 0 0 16px;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
}
.project--case .project__copy .project__description { margin: 0; }
.project--case .view-project { margin-top: 28px; }
.project__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 40px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.project__stats li { display: flex; flex-direction: column; gap: 8px; }
.project__stats strong { color: var(--accent); font-size: 22px; font-weight: 500; line-height: 1.2; }
.project__stats span { max-width: 32ch; color: var(--secondary); font-size: 13px; line-height: 1.5; }

@media (max-width: 900px) {
  .project.project--case { padding-bottom: 64px; }
  .project__stats { gap: 16px; }
}

@media (max-width: 620px) {
  .project__stats { grid-template-columns: 1fr; gap: 24px; }
  .project__stats span { max-width: none; }
}

.lightbox__nav--prev .icon { transform: rotate(180deg); }
.lightbox__nav:hover .icon,
.lightbox__nav:focus-visible .icon { filter: var(--icon-accent-filter); }

@media (hover: none) {
  .nav nav a:hover { color: var(--secondary); }
  .nav__cta:hover { background: transparent; color: var(--accent); }
  .language-menu summary:hover { border-color: var(--border); }
  .language-menu[open] summary { border-color: var(--accent); }
  .language-menu button:hover { background: transparent; color: var(--secondary); }
  .language-menu button[aria-current] { background: var(--line); color: var(--accent); }
}

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