/* shell.css — sticky header, uppertab track, theme toggle, footer, toast. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-6);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  text-decoration: none;
}
.wordmark:hover,
.wordmark:focus-visible {
  color: var(--text-strong);
}
.wordmark:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-cool);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Uppertab bar — centered in the header. */
.uppertab-bar {
  display: inline-flex;
  gap: var(--sp-2);
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-full);
}
.uppertab-bar button {
  font-family: var(--font-body);
  font-size: var(--ts-small);
  color: var(--text-muted);
  padding: 6px var(--sp-4);
  border-radius: var(--r-full);
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}
.uppertab-bar button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--el-1);
}
.uppertab-bar button:hover:not([aria-selected="true"]) {
  color: var(--text-strong);
}

/* Theme toggle — single icon button on the right. */
.theme-toggle {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}
.theme-toggle:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}
.theme-toggle svg { display: block; width: 18px; height: 18px; }
[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .ico-sun { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .ico-moon { display: block; }

/* Uppertab horizontal "workspace" track. */
main {
  position: relative;
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
}
.uppertab-track {
  display: flex;
  width: 300vw;
  height: 100%;
  transform: translateX(var(--track-offset, 0));
  transition: transform 360ms var(--ease);
  will-change: transform;
}
.uppertab-panel {
  width: 100vw;
  flex: 0 0 100vw;          /* lock width so siblings can't shrink it */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.uppertab-panel[inert] {
  /* inert panels still take their flex slot but receive no input. */
  overflow-y: hidden;
}

/* Subtab bar — appears only inside the Landing panel. */
.subtab-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--subtab-height);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-8);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.subtab-bar button {
  font-family: var(--font-body);
  font-size: var(--ts-small);
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-2);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.subtab-bar button::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease);
}
.subtab-bar button[aria-current="true"] {
  color: var(--text-strong);
}
.subtab-bar button[aria-current="true"]::after {
  background: var(--accent-warm);
}
.subtab-bar button:hover:not([aria-current="true"]) {
  color: var(--text-strong);
}
@media (max-width: 640px) {
  .subtab-bar { gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x mandatory; }
  .subtab-bar button { scroll-snap-align: center; flex: 0 0 auto; }
}

/* Footer (lives at the bottom of the Landing panel, always visible because Landing scrolls). */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-24);
  padding: var(--sp-8) 0 var(--sp-12);
  color: var(--text-muted);
  font-size: var(--ts-small);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}
.site-footer dl { margin: 0; }
.site-footer dt {
  font-family: var(--font-mono);
  font-size: var(--ts-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.site-footer dd { margin: 0 0 var(--sp-3) 0; color: var(--text); }
.site-footer .small { font-size: var(--ts-small); color: var(--text-muted); }

@media (max-width: 720px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
}

/* Toast (for clipboard fallback on Collaboration mailto). */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-8);
  transform: translateX(-50%) translateY(20px);
  background: var(--text-strong);
  color: var(--surface-1);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-full);
  font-size: var(--ts-small);
  font-family: var(--font-mono);
  box-shadow: var(--el-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Generic helper: tile (used by About subtab). */
.tile {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  box-shadow: var(--el-1);
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--el-2);
}
.tile h3 {
  font-size: var(--ts-h3);
  margin-bottom: var(--sp-2);
}
.tile p { color: var(--text-muted); margin-bottom: var(--sp-3); }
.tile .tile-cta {
  font-family: var(--font-mono);
  font-size: var(--ts-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-cool);
}
