/* Native Durnfall Crafted materials. Plated controls; leather only on handled panels. */
:root {
  --web-craft-leather: url('./assets/craft/leather-dark.webp');
  --web-craft-panel: url('./assets/craft/frame-panel.webp');
  --web-craft-normal: url('./assets/craft/plate-normal.webp');
  --web-craft-hover: url('./assets/craft/plate-hover.webp');
  --web-craft-pressed: url('./assets/craft/plate-pressed.webp');
  --web-craft-disabled: url('./assets/craft/plate-disabled.webp');
  --web-craft-gold: url('./assets/craft/plate-gold.webp');
  --web-craft-gold-hover: url('./assets/craft/plate-gold-hover.webp');
  --web-craft-gold-pressed: url('./assets/craft/plate-gold-pressed.webp');
}

/* Match the game's 24-pixel plate slices; the centre fills without stretching corners. */
:root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
  .combat-rotation button, .lightbox-bottom button, .lightbox-close) {
  border: 1px solid transparent;
  border-radius: 0;
  border-image: var(--web-craft-normal) 24 fill / 12px / 0 stretch;
  background: none;
  box-shadow: none;
  color: #f1e1be;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: .065em;
  text-shadow: 0 1px 2px #000b;
  transition: color .15s;
}
:root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
  .combat-rotation button, .lightbox-bottom button, .lightbox-close):hover:not(:disabled) {
  border-image-source: var(--web-craft-hover);
  background: none;
  box-shadow: none;
}
:root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
  .combat-rotation button, .lightbox-bottom button, .lightbox-close):active:not(:disabled) {
  border-image-source: var(--web-craft-pressed);
  translate: 0 1px;
}
:root .button:hover { transform: none; }
:root .button.button-gold { border-image-source: var(--web-craft-gold); color: #fff4d8; }
:root .button.button-gold:hover:not(:disabled) { border-image-source: var(--web-craft-gold-hover); }
:root .button.button-gold:active:not(:disabled) { border-image-source: var(--web-craft-gold-pressed); }
:root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
  .combat-rotation button, .lightbox-bottom button, .lightbox-close):disabled {
  border-image-source: var(--web-craft-disabled);
  color: #afa18c;
  opacity: 1;
  filter: none;
  text-shadow: none;
  cursor: not-allowed;
  translate: none;
}
:root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
  .combat-rotation button, .lightbox-bottom button, .lightbox-close):focus-visible {
  outline: 2px solid #f1d797;
  outline-offset: 4px;
}

.contact-form[aria-busy=true] .contact-submit { cursor: wait; }

/* Answers are still native radios: the plate shows hover, selection and keyboard focus. */
.fit-answer span {
  border: 1px solid transparent;
  border-image: var(--web-craft-normal) 24 fill / 10px / 0 stretch;
  background: none;
  color: #dfd0b2;
  font-family: var(--display);
  letter-spacing: .015em;
  text-shadow: 0 1px 2px #000b;
}
.fit-answer:hover span { border-image-source: var(--web-craft-hover); }
.fit-answer input:checked + span {
  border-color: transparent;
  border-image-source: var(--web-craft-gold);
  background: none;
  color: #fff4d8;
  box-shadow: none;
}
.fit-answer:hover input:checked + span { border-image-source: var(--web-craft-gold-hover); }
.fit-answer:active span { border-image-source: var(--web-craft-pressed); }
.fit-answer input:focus-visible + span { outline: 2px solid #f1d797; outline-offset: 3px; }

/* A tactile binding around the questions and contact desk, with quiet reading areas. */
.fit-test, .contact-form {
  border: 1px solid transparent;
  border-image: var(--web-craft-panel) 40 / 20px / 0 stretch;
  background: linear-gradient(145deg, #100b0733, #0b08052e),
    var(--web-craft-leather) 0 0 / 512px 512px, #17110d;
  box-shadow: 0 15px 40px #0003;
}
.fit-test { padding: clamp(24px, 4vw, 44px); }
.fit-statement { border-bottom-color: #c7a76a40; }
.contact-field input, .contact-field textarea { background: #100e0cdd; }
.contact-field input:focus, .contact-field textarea:focus { background: #18140ff5; }

/* The gallery tabs read as leather-backed cards, keeping their full-frame thumbnails. */
.gallery-tabs button {
  border: 1px solid transparent;
  border-image: var(--web-craft-panel) 40 / 12px / 0 stretch;
  background: var(--web-craft-leather) 0 0 / 512px 512px, #17110d;
}
.gallery-tabs button:hover { border-color: transparent; }
.gallery-tabs button[aria-selected=true] {
  border-color: transparent;
  background: linear-gradient(#c39a4c18, #c39a4c08),
    var(--web-craft-leather) 0 0 / 512px 512px, #17110d;
  outline: 1px solid #dfbf7a;
  outline-offset: -3px;
}
@media (max-width: 600px) {
  .fit-test { padding: 27px 17px; }
  .fit-statements { gap: 0; }
  .fit-answer span { padding-inline: 4px; font-size: 9px; }
  .fit-actions .button { gap: 12px; padding-inline: 13px; letter-spacing: .04em; }
}
@media (prefers-reduced-motion: reduce) {
  :root :is(.button, .nav-cta, .menu-toggle, .teaser-play, .gallery-arrows button,
    .combat-rotation button, .lightbox-bottom button, .lightbox-close):active:not(:disabled) { translate: none; }
}
