/**
 * Brand design page — stage + lockup + DOF nav.
 * OSD = huddi.css only.
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--stage-bg, #f7f3ec);
  color: var(--stage-ink, #1c1916);
}

body[data-theme="paper"] {
  --stage-bg: #f7f3ec;
  --stage-ink: #1c1916;
  --stage-muted: #5c564e;
  --stage-line: #ddd5c8;
}
body[data-theme="ink"] {
  --stage-bg: #12110f;
  --stage-ink: #f3efe7;
  --stage-muted: #8a8278;
  --stage-line: #2a2622;
}

#page {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem);
  padding-right: max(clamp(1.25rem, 4vw, 3rem), min(24ch, 30vw));
  padding-bottom: 6rem;
}

body.osd-dock-tl #page {
  padding-right: clamp(1.25rem, 4vw, 3rem);
  padding-left: max(clamp(1.25rem, 4vw, 3rem), min(24ch, 30vw));
}

.section {
  border-top: 1px solid var(--stage-line);
  padding: 2.5rem 0 1.5rem;
}
.section:first-child { border-top: none; padding-top: 0.5rem; }

.section__label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stage-muted);
  margin-bottom: 1.25rem;
}

.section__hint {
  font-size: 0.8rem;
  color: var(--stage-muted);
  max-width: 36rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ── Lockup ─────────────────────────────────────────────── */

.if-lockup {
  overflow: visible;
}

.if-lockup__horiz {
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow: visible;
}
.if-lockup__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: visible;
}

/* Layout box = landscape only; portrait may paint outside */
.if-lockup__mark {
  flex-shrink: 0;
  line-height: 0;
  position: relative;
  overflow: visible;
  /* isolation so overflow strokes aren't clipped by siblings */
  z-index: 1;
}
.if-lockup__mark svg.if-mark {
  display: block;
  overflow: visible !important;
  /* allow rotated portrait outside the landscape layout box */
  overflow: visible;
}
.if-lockup__type {
  position: relative;
  z-index: 0;
}

.if-lockup__word {
  font-weight: 500;
  color: var(--stage-ink);
  -webkit-font-smoothing: antialiased;
}
.if-lockup__tag {
  color: var(--stage-muted);
  text-transform: lowercase;
}

#iconOnly {
  overflow: visible;
  /* room so rotated portrait isn’t clipped by section */
  padding: 1.25rem 1.5rem;
}
#iconOnly .if-lockup__type { display: none; }
#iconOnly .if-lockup__mark { display: block; }

#lockupLarge {
  min-height: 6rem;
  overflow: visible;
  padding: 1.25rem 0.5rem;
}

#sec-icon,
#sec-lockup {
  overflow: visible;
}

/* ── Nav bar specimen ───────────────────────────────────── */

#navStage {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem 2rem;
  padding: 1.5rem;
  border: 1px solid var(--stage-line);
  border-radius: 2px;
  background: color-mix(in srgb, var(--stage-bg) 92%, var(--stage-ink) 4%);
}

#navTop { grid-column: 1 / -1; }
#navLeft { align-self: start; }
#navMeta {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage-muted);
  align-self: end;
}

.dof-nav {
  font-family: var(--specimen-font, Inter, system-ui, sans-serif);
  font-size: var(--nav-size, 16px);
  letter-spacing: var(--specimen-tracking, 0);
  font-variation-settings: var(--specimen-fvs, normal);
  color: var(--stage-ink);
}

.dof-track { display: flex; will-change: transform; }
.dof-track--y { flex-direction: column; }
.dof-track--x { flex-direction: row; align-items: center; gap: 0.25em; }

.dof-item {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0 0.2em;
  font: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transform-origin: left center !important;
  -webkit-font-smoothing: antialiased;
}
.dof-nav--top .dof-item { padding: 0 0.5em; }

.dof-item:focus-visible {
  outline: 2px solid #c45c3e;
  outline-offset: 3px;
}

.dof-item.hover-pull:hover {
  opacity: 1 !important;
  filter: blur(var(--hover-blur, 0px)) !important;
  transform: translate(0, 0) scale(1) rotate(0deg) !important;
  transition-duration: var(--hover-ms, 200ms) !important;
  /* pose snaps via hover override; optical eases via transition above */
  z-index: 2;
}

.dof-item.is-focus { font-weight: 600; }

.dof-nav--top {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.dof-brand-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  max-height: 2.5rem;
}
.dof-brand-slot .if-lockup__word {
  font-size: 1.05em !important;
}
.dof-brand-slot .if-lockup__tag { display: none; }
.dof-brand-slot .if-lockup__horiz { align-items: center; }

.dof-top-viewport { min-width: 0; flex: 1; overflow: hidden; }
.dof-nav--top[data-top-mode="FIXED"] .dof-top-viewport { overflow: visible; }

.dof-nav.debug-plane.dof-nav--left {
  position: relative;
}
.dof-nav--left.debug-plane::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  width: 3px;
  height: var(--dof-row, 48px);
  background: #c45c3e;
}

#hint {
  position: fixed;
  bottom: 10px;
  left: 14px;
  z-index: 40;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage-muted);
  opacity: 0.65;
  pointer-events: none;
}

/* ── HUDDI chrome ───────────────────────────────────────── */

#chrome {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

#topRight {
  position: absolute;
  top: calc(8px * var(--s, 2));
  right: calc(8px * var(--s, 2));
  bottom: calc(8px * var(--s, 2));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  z-index: 60;
}
body.osd-dock-tl #topRight {
  right: auto;
  left: calc(8px * var(--s, 2));
  align-items: flex-start;
}

#menu {
  pointer-events: auto;
  width: max-content;
  max-width: min(100%, 22ch);
  max-height: calc(100dvh - 16px * var(--s, 2));
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
}
#menu::-webkit-scrollbar { display: none; }

#trkStack {
  position: absolute;
  left: calc(8px * var(--s, 2));
  bottom: calc(8px * var(--s, 2));
  pointer-events: none;
  z-index: 60;
}
body.osd-dock-tl #trkStack {
  left: auto;
  right: calc(8px * var(--s, 2));
}
#trk {
  pointer-events: auto;
  display: flex;
  gap: 1ch;
}

#hudChip {
  position: absolute;
  top: calc(8px * var(--s, 2));
  left: calc(8px * var(--s, 2));
  pointer-events: none;
  display: none;
  z-index: 61;
  /* smooth hide without text shimmer — opacity only on chip host, not OSD rows */
  transition: opacity 280ms ease-in-out;
  opacity: 1;
}
#hudChip.is-hiding {
  opacity: 0;
}
body.osd-dock-tl #hudChip {
  left: auto;
  right: calc(8px * var(--s, 2));
}

@media (prefers-reduced-motion: reduce) {
  .dof-item, #hudChip { transition: none !important; }
}

@media (max-width: 720px) {
  #page { padding-right: 1rem; padding-left: 1rem; }
  #navStage {
    grid-template-columns: 1fr;
  }
}
