/* Personal content and accessibility overrides for the published archive layout. */
@font-face {
  font-family: "Aslina";
  src: url("assets/fonts/Aslina-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "SJ Narrow";
  src: url("assets/fonts/SJ-Narrow-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; }
#viewport { width: 100%; overflow: hidden; }
#stage { overflow: hidden; }
#three-scene .floating-plates-layer { contain: strict; overflow: hidden; }
#three-scene .floating-plate-strip { overflow: hidden; scrollbar-width: none; touch-action: manipulation; }

#stage .brand { padding-left: 78px; }
#stage .brand img {
  position: absolute;
  top: 3px;
  left: 0;
  display: block;
  width: 62px;
  height: 62px;
}
#stage[data-dark-surface="true"] .brand img { filter: invert(.62); }
#stage .brand h1 {
  font-family: "Aslina", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
#stage .brand > div { font-size: 16px; letter-spacing: .02em; }
#stage .brand-short, #stage[data-layout="portrait"] .brand-full { display: none; }
#stage[data-layout="portrait"] .brand-short { display: inline; }
#stage .three-scene.ready { opacity: 1; }
#stage .archive-fallback {
  position: absolute;
  top: 46%;
  left: 30%;
  z-index: -1;
  width: min(50%, 850px);
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  box-shadow: 0 30px 65px #11181b5c;
  transform: translate(-50%, -50%) perspective(900px) rotateY(-11deg);
  touch-action: pan-y;
}
#stage.archive-loaded .archive-fallback { display: none; }
#stage:not(.archive-loaded) .detail-content { opacity: 1; }
#stage:not(.archive-loaded) .object-caption { display: none; }
#stage:not(.archive-loaded) .archive-hint kbd { margin-inline: 2px; }
#stage .system-footer { pointer-events: none; }
#stage .archive-navigation {
  z-index: 5;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  color: var(--theme-ink);
}
#stage .archive-navigation > button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: inherit;
  border-radius: 50%;
  background: transparent;
  transition: background-color .18s ease, scale .18s ease;
}
#stage .archive-navigation > button svg {
  width: 23px;
  height: 23px;
  transition: translate .18s ease;
}
#stage .archive-navigation > button:disabled { opacity: .35; }
#stage .archive-navigation > button:focus-visible,
#stage .archive-navigation .file-ticks button:focus-visible {
  outline: 2px solid var(--theme-ink);
  outline-offset: 1px;
}
#stage .archive-navigation button:focus:not(:focus-visible) { outline: none; }
#stage .archive-navigation button:active:not(:disabled) { scale: .9; }
#stage .archive-navigation .file-ticks { gap: 0; }
#stage .archive-navigation .file-ticks button {
  width: 22px;
  height: 42px;
  border-radius: 999px;
  transition: scale .18s ease;
}
#stage .archive-navigation .file-ticks button::before {
  inset: 50% auto auto 50%;
  width: 5px;
  height: 5px;
  border-radius: 9px;
  background: var(--theme-ink);
  opacity: .38;
  transform: translate(-50%, -50%);
  transition: height .2s ease, opacity .2s ease;
}
#stage .archive-navigation .file-ticks button.selected::before { height: 17px; opacity: 1; }
#stage .archive-navigation button[data-preview]::after {
  content: attr(data-preview);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 1;
  transform: translate(-50%, 3px);
  border: 1px solid var(--glass-edge);
  border-radius: 9px;
  padding: 5px 10px;
  background: var(--glass-fill);
  backdrop-filter: blur(16px);
  box-shadow: 0 5px 16px var(--glass-shadow);
  color: var(--theme-ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
#stage .archive-navigation button[data-preview]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (hover: hover) {
  #stage .archive-navigation > button:hover:not(:disabled) { background: var(--glass-active); }
  #stage .archive-navigation > [data-action="prev"]:hover:not(:disabled) svg { translate: 0 -2px; }
  #stage .archive-navigation > [data-action="next"]:hover:not(:disabled) svg { translate: 0 2px; }
  #stage .archive-navigation .file-ticks button:hover::before { height: 12px; opacity: .8; }
  #stage .archive-navigation .file-ticks button.selected:hover::before { height: 17px; opacity: 1; }
  #stage .archive-navigation button[data-preview]:hover:not(:disabled)::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #stage .archive-navigation button, #stage .archive-navigation button::before,
  #stage .archive-navigation button::after, #stage .archive-navigation button svg { transition: none; }
}
#stage .archive-callout .file-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  letter-spacing: .015em;
}
#stage .read-file:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 5px; }
#stage .detail-content:focus-visible { outline: none; }
#stage .detail-content > h2 {
  font-family: "SJ Narrow", "Arial Narrow", sans-serif;
  font-weight: 300;
  letter-spacing: 0;
}
.detail-project-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--theme-ink);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.detail-project-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.archive-bookmark {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  font-size: 11px;
  letter-spacing: 1px;
  text-align: left;
}
.archive-bookmark > span { flex-shrink: 0; white-space: nowrap; letter-spacing: 0; }
.archive-bookmark:hover { background-color: var(--glass-active); }
.archive-bookmark:focus-visible { outline: 2px solid var(--theme-ink); outline-offset: 4px; }
#stage:is([data-layout="compact"], [data-layout="portrait"]) .archive-bookmark {
  padding-inline: 12px;
  font-size: 9px;
}

.bread-modal {
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--theme-line);
  color: var(--theme-ink);
  background: var(--theme-panel);
}
.bread-modal::backdrop { background: #071015b0; backdrop-filter: blur(8px); }
.bread-modal .bread-terminal {
  width: auto;
  max-height: none;
  padding: clamp(18px, 4vw, 42px);
  border: 0;
  box-shadow: none;
}
.bread-modal .bread-settings { display: flex; align-items: center; gap: 24px; padding-block: 20px; border-top: 1px solid var(--theme-line); }
.bread-settings select { padding: 7px 12px; border: 1px solid var(--theme-line); border-radius: 4px; color: var(--theme-ink); background: var(--theme-field); }
.bread-terminal .search-results { min-height: 105px; }
.plate-scroll { container-type: size; }
.plate-sheet {
  position: relative;
  flex: none;
  width: min(100cqw, calc(100cqh * var(--plate-ratio, 1)));
}
.plate-sheet .plate-image { display: block; width: 100%; height: auto; }
.is-zoomed .plate-sheet { width: max(145%, var(--plate-native-width, 0px)); }
.plate-sheet.is-watermarked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/portfolio/bread-heo-watermark.svg?v=aslina") repeat;
  pointer-events: none;
}
.javascript-note { position: absolute; bottom: 24px; left: 24px; z-index: 10; padding: 12px; color: var(--theme-ink); background: var(--theme-panel); }

#stage[data-layout="compact"] .brand { padding-left: 72px; }
#stage[data-layout="compact"][data-mode="detail"] .archive-atmosphere:after {
  background: linear-gradient(90deg, transparent 36%, rgba(var(--theme-paper-rgb), .92) 54%, var(--theme-paper) 73%);
}
#stage[data-layout="portrait"] .brand {
  padding-left: 64px;
  transform: scale(.55) !important;
  transform-origin: top left;
}
#stage[data-layout="portrait"] .brand img { width: 54px; height: 54px; }
#stage[data-layout="portrait"] .brand h1 { font-size: 34px; line-height: 1.05; }
#stage[data-layout="portrait"] .brand > div { font-size: 12px; }
#stage[data-layout="portrait"] .archive-fallback { width: 78%; left: 50%; top: 36%; }
#stage[data-layout="portrait"][data-mode="detail"] .archive-fallback { top: 23%; }

@media (max-width: 430px) {
  #stage[data-layout="portrait"] .brand { transform: scale(.47) !important; }
  #stage[data-layout="portrait"] .terminal-tools { gap: 2px; }
  .bread-modal { width: calc(100vw - 22px); }
  .bread-terminal h2 { font-size: 24px; }
  .bread-terminal .result-row { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #stage .archive-fallback, #stage .three-scene, #stage .archive-ui, #stage .scene-atmosphere { transition: none; }
}

/* Hide the temporary static layout from the very first paint. */
html:not([data-archive-ready="true"]) #viewport { opacity: 0; pointer-events: none; }
#viewport { transition: opacity .8s cubic-bezier(.22,1,.36,1); }
#archive-loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: #10191b; color: #dfe5df; opacity: 1; visibility: visible; transition: opacity .65s ease, visibility 0s .65s; }
.archive-loader-card { display: flex; flex-direction: column; align-items: center; width: min(220px,70vw); gap: 14px; }
.archive-loader-name { font: 700 26px/1.2 Aslina,sans-serif; }
.archive-loader-label { font: 10px/1.5 monospace; letter-spacing: .22em; opacity: .45; }
.archive-loader-track { width: 100%; height: 1px; overflow: hidden; background: #dfe5df20; margin: 12px 0 2px; }
.archive-loader-track i { display: block; width: 45%; height: 100%; background: #dfe5df90; animation: archive-loading 1.7s ease-in-out infinite; }
.archive-load-status { font: 12px/1.6 sans-serif; color: inherit; opacity: .65; text-align: center; }
.archive-load-status:empty { display: none; }
.archive-load-status button { color: inherit; background: transparent; border: 1px solid #dfe5df55; border-radius: 24px; padding: 10px 18px; cursor: pointer; }
.archive-loader-back { font: 11px/1.5 sans-serif; color: inherit; opacity: .4; text-decoration: none; margin-top: 10px; }
.archive-loader-back:hover, .archive-loader-back:focus-visible { opacity: 1; }
html[data-archive-ready="true"] #archive-loader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes archive-loading { from { transform: translateX(-110%); } to { transform: translateX(330%); } }
@media (prefers-reduced-motion: reduce) { #viewport, #archive-loader { transition: none; } .archive-loader-track i { animation: none; width: 100%; opacity: .4; } }
