/* Portfolio controls: neutral actions at rest; blue only during interaction.
   Deliberately excludes game controls and the Gojira invitation/intro. */
:root {
  --control-blue: #2938d7;
  --control-wash: #2938d70a;
  --control-radius: 999px;
}
body.kaiju-mode {
  --control-blue: #a2b5ff;
  --control-wash: #a2b5ff12;
}

/* Top-level navigation has one clear selected item, not a row of boxes. */
header nav { gap: 8px; margin-right: 18px; }
header nav button {
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  line-height: 1.25;
  white-space: nowrap;
  transition: border-color .18s ease, background-color .18s ease;
}
header nav button.active,
header nav button[aria-current="page"] {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Match the light capsule in the reference, with a real 44px target. */
body:not(.kaiju-mode) #cover .intro .text-link,
body:not(.kaiju-mode) #cover .depth-panel #activate-depth,
body:not(.kaiju-mode) #cover .depth-panel .gojira-shortcut,
.contact-submit,
.case-return {
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ink);
  padding: 11px 22px;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}
body:not(.kaiju-mode) #cover .intro .text-link { min-height: 52px; }
body:not(.kaiju-mode) #cover .depth-panel #activate-depth,
body:not(.kaiju-mode) #cover .depth-panel .gojira-shortcut {
  margin: 4px 0;
  font-size: 12px;
}
.case-return { font-size: 12px; }
.contact-submit { font-size: 14px; }

/* Small utilities stay unboxed. A clear focus ring remains for keyboard use. */
header #lang,
footer button,
footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  padding: 8px 10px;
  text-decoration: none;
}
header #lang { gap: 3px; }
footer { align-items: center; }
.case-link { border-color: currentColor; }

/* Keep the family strip and project imagery editorial, without extra frames. */
.logo-tones button {
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ink);
}
.logo-tones button[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 5px;
  color: var(--ink);
}
.family-portraits figcaption button[aria-expanded="true"] {
  background: var(--control-wash);
  color: var(--ink);
  box-shadow: inset 0 -2px currentColor;
}

/* Fields keep their labels and boundary, but lose the heavy rectangular box. */
#contact-form input,
#contact-form select,
#contact-form textarea {
  border: 0;
  border-bottom: 1px solid #7d847e;
  border-radius: 0;
  background: transparent;
  padding-inline: 4px;
}
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
  border-bottom-color: var(--control-blue);
  outline: 2px solid var(--control-blue);
  outline-offset: 4px;
}

header :is(button, a, input):focus-visible,
footer :is(button, a):focus-visible,
#cover .intro .text-link:focus-visible,
#cover .depth-panel #activate-depth:focus-visible,
#cover .depth-panel .gojira-shortcut:focus-visible,
.contact-submit:focus-visible,
.case-return:focus-visible,
.case-link:focus-visible,
.logo-tones button:focus-visible,
.family-portraits figcaption button:focus-visible,
.education summary:focus-visible,
#work .case-card:focus-visible {
  outline: 2px solid var(--control-blue);
  outline-offset: 4px;
}

@media (hover: hover) {
  header nav button:hover,
  header #lang:hover,
  footer :is(button, a):hover,
  .logo-tones button:hover,
  .family-portraits figcaption button:hover,
  body:not(.kaiju-mode) #cover .intro .text-link:hover,
  body:not(.kaiju-mode) #cover .depth-panel #activate-depth:hover,
  body:not(.kaiju-mode) #cover .depth-panel .gojira-shortcut:hover,
  .contact-submit:hover,
  .case-return:hover { background: var(--control-wash); }
}

@media (min-width: 801px) and (max-width: 1000px) {
  header { flex-wrap: wrap; gap: 8px 16px; }
  header nav {
    order: 3;
    width: 100%;
    margin: 8px 0 0;
    justify-content: space-between;
  }
  header #sound-toggle { order: 1; margin-left: auto; }
  header #lang { order: 2; }
}

@media (max-width: 800px) {
  header nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    margin: 8px 0 0;
    width: 100%;
  }
  header nav button {
    min-height: 44px;
    padding: 8px 3px;
    font-size: clamp(10px, 2.8vw, 12px);
  }
  header #lang { padding-inline: 6px; }
  footer { gap: 4px 8px; }
  footer :is(button, a) { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  header nav button,
  #cover .intro .text-link,
  #cover .depth-panel #activate-depth,
  #cover .depth-panel .gojira-shortcut,
  .contact-submit,
  .case-return { transition: none; }
}

/* Interaction cues never become decoration around the character. */
body:not(.kaiju-mode) #cover .intro .text-link,
body:not(.kaiju-mode) #cover .depth-panel #activate-depth,
body:not(.kaiju-mode) #cover .depth-panel .gojira-shortcut,
.contact-submit,.case-return { text-decoration: underline; text-underline-offset: 5px; }
:is(header nav button,header #lang,footer button,footer a,.logo-tones button,.contact-submit,.case-return,.case-link):active,
body:not(.kaiju-mode) #cover :is(.text-link,#activate-depth,.gojira-shortcut):active { border-color:var(--control-blue); }
@media(hover:hover){
 :is(header nav button,header #lang,footer button,footer a,.logo-tones button,.contact-submit,.case-return,.case-link):hover,
 body:not(.kaiju-mode) #cover :is(.text-link,#activate-depth,.gojira-shortcut):hover { border-color:var(--control-blue); }
}


/* V52: restore the graphite primary CTA, with a separate keyboard focus ring. */
body:not(.kaiju-mode) #cover .intro .text-link {
  background: #252725;
  color: #fff;
  text-decoration: none;
  border-color: transparent;
}
body:not(.kaiju-mode) #cover .intro .text-link:active {
  background: #151715;
}
@media (hover: hover) {
  body:not(.kaiju-mode) #cover .intro .text-link:hover {
    background: #343734;
    color: #fff;
  }
}

/* Keep the two scene actions together. Captions remain on their own row;
   the Gojira invitation keeps its existing layout and event handlers. */
body:not(.kaiju-mode) #cover .depth-panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 8px;
  min-height: 44px;
}
body:not(.kaiju-mode) #cover .depth-panel .secret-controls {
  margin: 0;
  align-items: center;
  flex-wrap: nowrap;
}
body:not(.kaiju-mode) #cover .depth-panel #activate-depth,
body:not(.kaiju-mode) #cover .depth-panel .gojira-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
body:not(.kaiju-mode) #cover .depth-panel .mood-caption,
body:not(.kaiju-mode) #cover .depth-panel .kaiju-invite,
body:not(.kaiju-mode) #cover .depth-panel > .mood-controls:not(.secret-controls) {
  flex-basis: 100%;
}
/* Author display rules must never expose hidden sensor or scene controls. */
#cover .depth-panel [hidden] { display: none !important; }

/* V52: invitation and replay CTAs share the paper version's pill shape.
   This changes geometry only, preserving the existing colours and actions. */
body.kaiju-mode #cover .depth-panel .kaiju-invite .kaiju-enter,
.kaiju-dialog.kg-runner .kg-overlay .kg-primary {
  border-radius: var(--control-radius, 999px);
}
